public function setUp() { parent::setUp(); $this->artisan('db:seed'); $this->organization = new Organization(); $this->faker = Factory::create(); }
/** * Set up the test environment. */ protected function setUp() { parent::setUp(); $this->afterApplicationCreated(function () { $this->artisan('db:seed'); }); }
public function setUp() { parent::setUp(); DatabaseSeeder::$withMedia = false; $this->artisan('migrate'); $this->artisan('db:seed', ['--class' => 'ArticleSeeder']); }
/** * Prepare test environment. * * @see \Illuminate\Foundation\Testing\TestCase::setUp() */ public function setUp() { parent::setUp(); foreach ($this->seedDependency[$this->getName()] as $seeder) { $this->seed($seeder); } }
public function setUp() { parent::setUp(); $this->app['config']->set('database.default', 'sqlite'); $this->app['config']->set('database.connections.sqlite.database', ':memory:'); $this->migrate(); }
/** * */ public function setUp() { parent::setUp(); if ($this->useDatabase) { $this->setUpDb(); } }
public function setUp() { parent::setUp(); \Config::set('database.default', 'sqlite'); \Config::set('database.connections', ['sqlite' => array('driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '')]); $this->createDatabase(); }
/** * Setup the test environment. * * @return void */ protected function setUp() { parent::setUp(); // Unbind model before each test. app('sahib_form')->model(null); // Remove errors before each test. $this->session(['errors' => null]); }
/** * Setup DB and test variables before each test. */ protected function setUp() { parent::setUp(); $this->app['config']->set('database.default', 'sqlite'); $this->app['config']->set('database.connections.sqlite.database', ':memory:'); $this->migrate(); $this->user = $this->makeUser(); }
/** * Sets up prerequisites. */ public function setUp() { parent::setUp(); $websiteRepositoryMock = Mockery::mock(WebsiteRepositoryContract::class); $website = factory(Website::class)->make(); $websiteRepositoryMock->shouldReceive('findById')->with(1)->andReturn($website); $this->app->instance(WebsiteRepositoryContract::class, $websiteRepositoryMock); }
public function setUp() { parent::setUp(); $this->prepareForTests(); $this->userId = 1; // Clear response $this->httpResponse = new \Illuminate\Http\Response(); }
public function setUp() { \Illuminate\Foundation\Testing\TestCase::setUp(); $path = realpath(__DIR__ . '/migrations'); $path = substr($path, strlen(getcwd()) + 1); \Artisan::call('migrate', array('--path' => $path)); include_once dirname(__FILE__) . '/TestModel.php'; }
/** * Runs before every test. */ public function setUp() { parent::setUp(); Model::unguard(false); if (false === static::$staged) { $this->stage(); static::$staged = true; } $this->setService(); $config = $this->app->make('Config'); static::$wrapper = $config::get('df.resources_wrapper'); }
/** * Setup DB before each test. */ public function setUp() { parent::setUp(); $this->app['config']->set('database.default', 'sqlite'); $this->app['config']->set('database.connections.sqlite.database', ':memory:'); $this->app['config']->set('app.url', 'http://localhost/'); $this->app['config']->set('app.debug', false); $this->app['config']->set('app.key', env('APP_KEY', '1234567890123456')); $this->app['config']->set('app.cipher', 'AES-128-CBC'); $this->app->boot(); $this->migrate(); }
public function setUp() { parent::setUp(); // C locale means that no translations will be done. $this->app->setLocale('C'); // Reset clock stuff. We pick a timezone at random and reset (and freeze) // Carbon::now() to current time. $timezones = array('Antarctica/South_Pole', 'Arctic/Longyearbyen', 'Australia/Tasmania', 'Pacific/Pohnpei'); date_default_timezone_set($timezones[array_rand($timezones)]); Carbon::setTestNow(null); Carbon::setTestNow(Carbon::now()); $this->setUp_doctrine(); }
/** * Setup DB before each test. */ public function setUp() { parent::setUp(); $this->app['config']->set('database.default', 'sqlite'); $this->app['config']->set('database.connections.sqlite.database', ':memory:'); $this->app['config']->set('jsonapi', [EmployeesTransformer::class, OrdersTransformer::class]); $this->app['config']->set('app.url', 'http://localhost/'); $this->app['config']->set('app.debug', true); $this->app['config']->set('app.key', \env('APP_KEY', '1234567890123456')); $this->app['config']->set('app.cipher', 'AES-128-CBC'); $this->app->boot(); $this->migrate(); }
public function setUp() { parent::setUp(); Schema::dropIfExists('articles'); Schema::create('articles', function (Illuminate\Database\Schema\Blueprint $table) { $table->increments('id'); $table->string('body'); }); Schema::dropIfExists('users'); Schema::create('users', function (\Illuminate\Database\Schema\Blueprint $table) { $table->increments('id'); $table->string('username'); }); Schema::dropIfExists('groups'); Schema::create('groups', function (\Illuminate\Database\Schema\Blueprint $table) { $table->increments('id'); $table->string('name'); $table->boolean('is_admin')->default(false); }); Schema::dropIfExists('group_user'); Schema::create('group_user', function (\Illuminate\Database\Schema\Blueprint $table) { $table->integer('group_id'); $table->integer('user_id'); }); Schema::dropIfExists('permissions'); Schema::create('permissions', function (\Illuminate\Database\Schema\Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('object_type'); $table->string('codename'); }); Schema::dropIfExists('group_object_permission'); Schema::create('group_object_permission', function (\Illuminate\Database\Schema\Blueprint $table) { $table->increments('id'); $table->integer('group_id'); $table->string('object_type'); $table->integer('object_id'); $table->integer('permission_id'); }); Schema::dropIfExists('user_object_permission'); Schema::create('user_object_permission', function (\Illuminate\Database\Schema\Blueprint $table) { $table->increments('id'); $table->integer('user_id'); $table->string('object_type'); $table->integer('object_id'); $table->integer('permission_id'); }); }
public function setUp() { parent::setUp(); $this->app['config']->set('database.default', 'mysql'); $this->app['config']->set('database.connections.mysql.host', 'localhost'); $this->app['config']->set('database.connections.mysql.database', 'laravel_admin'); $this->app['config']->set('database.connections.mysql.username', 'root'); $this->app['config']->set('database.connections.mysql.password', ''); $this->app['config']->set('app.key', 'AckfSECXIvnK5r28GVIWUAxmbBSjTsmF'); $this->app['config']->set('admin', require __DIR__ . '/../config/admin.php'); $this->artisan('vendor:publish'); $this->migrate(); $this->artisan('admin:install'); if (file_exists($routes = admin_path('routes.php'))) { require $routes; $this->app['admin.router']->register(); } }
/** * @throws \Exception */ public function setUp() { parent::setUp(); $this->faker = FakerFactory::create(); if (self::$migrationFailed) { $this->markTestSkipped('Previous migration failed.'); return; } try { $this->setupDatabaseMigrator(); self::$databaseMigrator->run(); } catch (Exception $e) { self::$migrationFailed = true; throw $e; } Route::enableFilters(); self::bootModels(); }
/** * Sets up the application. */ public function setUp() { // Run parent class set up method. parent::setUp(); // Delete default laravel migrations in order to use Sentinel. $this->artisan('dashboard:fresh'); // Publish Vendor Assets + Configs $this->artisan('vendor:publish'); // Refresh application. $this->refreshApplication(); // Setup Configuration to work with Laravel for testing. config(['database.connections.sqlite.database' => env('DB_DATABASE')]); // Run migrations. $this->artisan('migrate'); $this->auth = app()->make('Laraflock\\Dashboard\\Contracts\\AuthRepoInterface'); $this->permission = app()->make('Laraflock\\Dashboard\\Contracts\\PermissionRepoInterface'); $this->role = app()->make('Laraflock\\Dashboard\\Contracts\\RoleRepoInterface'); $this->user = app()->make('Laraflock\\Dashboard\\Contracts\\UserRepoInterface'); }
/** * Creates the application. * * @return \Illuminate\Foundation\Application */ public function setUp() { parent::setUp(); $this->be(User::find(1)); \DB::connection()->enableQueryLog(); }
public function setUp() { parent::setUp(); }
public function setUp() { putenv('RUNNING_TESTS_FRONT=true'); parent::setUp(); }
public function setUp() { parent::setUp(); $this->mock = $this->mock('API\\Resource\\v1\\ResourceAPIInterface'); }
public function setUp() { parent::setUp(); $this->useNullLogger(); }
protected function setUp() { parent::setUp(); Artisan::call('migrate:refresh'); }
public function setUp() { parent::setUp(); $this->initializeDoctrine(); }
/** * @inheritdoc */ protected function setUp() { parent::setUp(); $this->app->make('url')->forceRootUrl('http://website.domain'); $this->provideAssetService('0.0.1'); }
public function setUp() { parent::setUp(); $this->prepareForTests(); }
public function setUp() { parent::setUp(); $this->epay = new Epay(); }