Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.117.132.79
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp-musonza /
vendor /
musonza /
chat /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
Feature
[ DIR ]
drwxr-xr-x
2020-04-08 12:13
Helpers
[ DIR ]
drwxr-xr-x
2020-04-08 12:13
Unit
[ DIR ]
drwxr-xr-x
2020-04-08 12:13
TestCase.php
3.78
KB
-rw-r--r--
2020-04-08 12:13
Save
Rename
<?php namespace Musonza\Chat\Tests; require __DIR__.'/../database/migrations/create_chat_tables.php'; require __DIR__.'/Helpers/migrations.php'; use CreateChatTables; use CreateTestTables; use Illuminate\Foundation\Application; use Musonza\Chat\ChatServiceProvider; use Musonza\Chat\Facades\ChatFacade; use Musonza\Chat\Tests\Helpers\Models\User; use Orchestra\Database\ConsoleServiceProvider; class TestCase extends \Orchestra\Testbench\TestCase { protected $conversation; protected $prefix = 'chat_'; protected $userModelPrimaryKey; public $users; /** @var User */ protected $alpha; /** @var User */ protected $bravo; /** @var User */ protected $charlie; /** @var User */ protected $delta; public function __construct() { parent::__construct(); } public function setUp(): void { parent::setUp(); $this->artisan('migrate', ['--database' => 'testbench']); $this->withFactories(__DIR__.'/Helpers/factories'); $this->migrate(); $this->users = $this->createUsers(6); list($this->alpha, $this->bravo, $this->charlie, $this->delta) = $this->users; } protected function migrateTestTables() { $config = config('musonza_chat'); $userModel = app($config['user_model']); $this->userModelPrimaryKey = $userModel->getKeyName(); } protected function migrate() { $this->migrateTestTables(); (new CreateChatTables())->up(); (new CreateTestTables())->up(); } /** * Define environment setup. * * @param Application $app * * @return void */ protected function getEnvironmentSetUp($app) { parent::getEnvironmentSetUp($app); // Setup default database to use sqlite :memory: $app['config']->set('database.default', 'testbench'); $app['config']->set('database.connections.testbench', [ 'driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '', ]); // $app['config']->set('database.default', 'testbench'); // $app['config']->set('database.connections.testbench', [ // 'driver' => 'mysql', // 'database' => 'chat', // 'username' => 'root', // 'host' => '127.0.0.1', // 'password' => 'my-secret-pw', // 'prefix' => '', // 'strict' => true, // 'engine' => null, // 'modes' => [ // 'ONLY_FULL_GROUP_BY', // 'STRICT_TRANS_TABLES', // 'NO_ZERO_IN_DATE', // 'NO_ZERO_DATE', // 'ERROR_FOR_DIVISION_BY_ZERO', // 'NO_ENGINE_SUBSTITUTION', // ], // ]); $app['config']->set('musonza_chat.user_model', 'Musonza\Chat\Tests\Helpers\Models\User'); $app['config']->set('musonza_chat.sent_message_event', 'Musonza\Chat\Eventing\MessageWasSent'); $app['config']->set('musonza_chat.broadcasts', false); $app['config']->set('musonza_chat.user_model_primary_key', null); $app['config']->set('musonza_chat.routes.enabled', true); $app['config']->set('musonza_chat.should_load_routes', true); } protected function getPackageProviders($app) { return [ ConsoleServiceProvider::class, ChatServiceProvider::class, ]; } protected function getPackageAliases($app) { return [ 'Chat' => ChatFacade::class, ]; } public function createUsers($count = 1) { return factory(User::class, $count)->create(); } public function tearDown(): void { (new CreateChatTables())->down(); (new CreateTestTables())->down(); parent::tearDown(); } }