Example #1
0
 /**
  * Préparation avant les tests
  */
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     $this->seed();
     Mail::pretend(true);
 }
 public function setUp()
 {
     parent::setUp();
     $this->appPath = app_path();
     $this->collection = Mockery::mock('Illuminate\\Database\\Eloquent\\Collection')->shouldDeferMissing();
     $this->setUpDatabase();
 }
Example #3
0
 public function setUp()
 {
     parent::setUp();
     @unlink(base_path('storage/database.sqlite'));
     @copy(base_path('storage/database.sqlite.blank'), base_path('storage/database.sqlite'));
     Artisan::call('migrate');
 }
 /**
  * Perform test case set up
  *
  * @deprecated use pluginTestSetUp method
  */
 public final function setUp()
 {
     /*
      * Create application instance
      */
     parent::setUp();
     /*
      * Reboot October Singletons' dependencies
      */
     \System\Classes\PluginManager::instance()->bindContainerObjects();
     \System\Classes\UpdateManager::instance()->bindContainerObjects();
     /*
      * If test maker wants to create functional test, migrate october and given plugins
      */
     if (count($this->refreshPlugins) > 0) {
         foreach ($this->refreshPlugins as $pluginCode) {
             $this->refreshPlugin($pluginCode);
         }
     }
     /*
      * If test maker wants october environment for some reason, migrate october
      */
     if (count($this->refreshPlugins) === 0 && $this->requiresOctoberMigration) {
         $this->migrateOctober();
     }
     /*
      * Prevent mailer from actually sending emails
      */
     Mail::pretend(true);
     $this->pluginTestSetUp();
 }
Example #5
0
 public function setUp()
 {
     parent::setUp();
     // Don't forget this!
     $this->prepareForTests();
     $this->resetEvents();
 }
 public function setUp()
 {
     parent::setUp();
     $this->appPath = app_path();
     $this->collection = Mockery::mock('PullAutomaticallyGalleries\\Database\\Eloquent\\Collection')->shouldDeferMissing();
     $this->setUpDatabase();
 }
Example #7
0
 public function setUp()
 {
     parent::setUp();
     if ($this->useDatabase) {
         Artisan::call('migrate');
     }
 }
 public function __construct()
 {
     parent::setUp();
     $this->user = factory(\App\User::class)->create();
     $this->administratorFactory = new \Larapress\Admin\Database\Factories\AdministratorFactory(Faker\Factory::create(), \Carbon\Carbon::create());
     $this->administrator = $this->administratorFactory->administrator($this->user->id)->save();
 }
Example #9
0
 public function setup()
 {
     parent::setUp();
     $this->artisan('migrate:reset');
     $this->artisan('migrate');
     $this->artisan('db:seed');
 }
Example #10
0
 public function setUp()
 {
     parent::setUp();
     $databaseUrl = __DIR__ . '/../tests/studs/testing.sqlite';
     $runMigrate = false;
     $fileSystem = new \Illuminate\Filesystem\Filesystem();
     if (!$this->inMemoryDb && !$fileSystem->exists($databaseUrl)) {
         $fileSystem->put($databaseUrl, '');
         $runMigrate = true;
         fwrite(STDOUT, "\r\n- Migrate \r\n");
     }
     $this->app['config']->set('app.key', 'SomeRandomStringWith32Characters');
     $this->app['config']->set('app.debug', true);
     $this->app['config']->set('database.default', 'sqlite');
     $this->app['config']->set('database.connections.sqlite.database', $this->inMemoryDb ? ':memory:' : $databaseUrl);
     if ($runMigrate || $this->inMemoryDb) {
         $this->migrate();
         $this->createSiteAndAdminUser();
     }
     // generally it is not run during console calls, but it is ok for testing, because
     // system knows that site's url is localhost
     app('veer')->run();
     $admin = \Veer\Models\UserAdmin::where('banned', 0)->first();
     \Auth::loginUsingId($admin->users_id);
 }
Example #11
0
 /**
  * Perform test case set up.
  * @return void
  */
 public function setUp()
 {
     /*
      * Create application instance
      */
     parent::setUp();
     /*
      * Rebind Laravel container in October Singletons
      */
     UpdateManager::instance()->bindContainerObjects();
     PluginManager::instance()->bindContainerObjects();
     /*
      * Ensure system is up to date
      */
     $this->runOctoberUpCommand();
     /*
      * Detect plugin from test and autoload it
      */
     $this->pluginTestCaseLoadedPlugins = [];
     $pluginCode = $this->guessPluginCodeFromTest();
     if ($pluginCode !== false) {
         $this->runPluginRefreshCommand($pluginCode, false);
     }
     /*
      * Disable mailer
      */
     Mail::pretend();
 }
Example #12
0
 public function setUp()
 {
     parent::setUp();
     // Avoid using external service to fetch quotes
     $rate = new \Swap\Model\Rate(1);
     \Swap::shouldReceive('quote')->andReturn($rate);
 }
 public function setup()
 {
     parent::setUp();
     Session::start();
     //enable filters as filters are disabled by default
     Route::enableFilters();
     $this->prepareForTests();
 }
 public function setUp()
 {
     parent::setUp();
     $this->app['config']->set('vjroby-laravel-nonce::database_type', $this->databaseType);
     $this->app['config']->set('vjroby-laravel-nonce::dynamodb_table_name', $this->dynamoDBtableName);
     $this->app['config']->set('vjroby-laravel-nonc::.dynamodb_table_region', $this->dynamoRegion);
     $this->mockAws();
 }
Example #15
0
 public function setUp()
 {
     parent::setUp();
     $user = factory('Tsny\\Models\\User')->create();
     $this->be($user);
     //        Artisan::call('migrate:refresh');
     //        Artisan::call('db:seed', ['--class'=>'TestSeeder']);
 }
Example #16
0
 public function setUp()
 {
     parent::setUp();
     // Don't forget this!
     $this->redis = \RedisLV4::connection();
     $this->redis->flushall();
     $this->prepareForTests();
 }
Example #17
0
 public function setUp()
 {
     parent::setUp();
     $this->app['config']->set('database.default', 'sqlite');
     $this->app['config']->set('database.connections.sqlite.database', ':memory:');
     $this->faker = \Faker\Factory::create();
     $this->migrateDatabase();
 }
 public function setUp()
 {
     parent::setUp();
     if ($this->useDatabase) {
         $this->artisan('migrate');
         $this->artisan('db:seed');
     }
 }
Example #19
0
 public function setUp()
 {
     parent::setUp();
     $this->app['config']->set('database.default', 'testing');
     $a = __DIR__ . '/../src/migrations';
     $this->app['config']->set('database.connections.testing', array('driver' => 'sqlite', 'database' => ':memory:', 'prefix' => ''));
     $this->migrate();
 }
Example #20
0
 public function setUp()
 {
     parent::setUp();
     @unlink(base_path('storage/database.sqlite'));
     @copy(base_path('storage/database.sqlite.blank'), base_path('storage/database.sqlite'));
     Artisan::call('vendor:publish', ['--tag' => ['migrations']]);
     Artisan::call('migrate');
 }
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     Mail::pretend(true);
     Route::enableFilters();
     App::bind('Helpers\\JsonRPCClientInterface', 'Helpers\\DummyJsonRPCClient');
     App::bind('Helpers\\DataParserInterface', 'Helpers\\DummyDataParser');
 }
Example #22
0
 /**
  * Setup the test environment.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     // Ideally we'd like to bypass the middleware when testing, however
     // this breaks Former because of it's hard dependency on sessions. With
     // middleware enabled however, forms check for a valid CSRF token.
     // This replaces the app's CSRF middleware with and override that exempts
     // all routes from CSRF protection.
     $this->app->instance('NeonTsunami\\Http\\Middleware\\VerifyCsrfToken', $this->app->make('VerifyCsrfToken'));
 }
Example #23
0
 /**
  * Set up function for all tests
  *
  */
 public function setUp()
 {
     parent::setUp();
     if ($this->useDatabase) {
         $this->setUpDb();
     }
     // To test auth, we must re-enable filters on the routes
     // By default, filters are disabled in testing
     Route::enableFilters();
 }
Example #24
0
 /**
  *
  */
 public function setUp()
 {
     parent::setUp();
     if (static::$migrated) {
         return;
     }
     /** @var \Illuminate\Contracts\Console\Kernel $artisan */
     $artisan = app(Illuminate\Contracts\Console\Kernel::class);
     $artisan->call('migrate');
     static::$migrated = true;
 }
Example #25
0
 public function setUp()
 {
     parent::setUp();
     if (session_status() == PHP_SESSION_NONE) {
         @session_start();
     }
     $this->createApplication();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     Eloquent::unguard();
 }
 public function setUp()
 {
     Illuminate\Foundation\Testing\TestCase::setUp();
     Artisan::call('migrate', array('--package' => 'cartalyst\\sentry'));
     // 		Artisan::call('migrate');
     Artisan::call('migrate', array('--package' => 'rtconner\\laravel-addresses'));
     Artisan::call('db:seed', array('--class' => 'Conner\\Addresses\\DatabaseSeeder'));
     $user = new \Cartalyst\Sentry\Users\Eloquent\User();
     $user->id = 1;
     \Sentry::setUser($user);
 }
 /**
  * Set Up the Application, it will install it.
  */
 public function setUp()
 {
     parent::setUp();
     if (!file_exists(storage_path('database.sqlite'))) {
         $database = fopen(storage_path('database.sqlite'), "w");
         fclose($database);
     }
     $this->beforeApplicationDestroyed(function () {
         unlink(storage_path('database.sqlite'));
     });
 }
Example #28
0
 public function setUp()
 {
     parent::setUp();
     putenv('DB_CONNECTION=sqlite_testing');
     if (!Schema::hasTable('migrations')) {
         Artisan::call('mage2:migrate');
         Artisan::call('db:seed');
         $this->setupAdminUserAndWebsite();
     }
     //Artisan::call('db:seed');
 }
 public function setUp()
 {
     parent::setUp();
     $this->artisan('migrate');
     $this->beforeApplicationDestroyed(function () {
         $this->artisan('migrate:rollback');
     });
     //Create an empty file for the sqlite db to go into
     //exec('rm ' . storage_path('database.sqlite'));
     //exec('touch ' . storage_path('database.sqlite'));
 }
Example #30
0
 /**
  * Default preparation for each test
  */
 public function setUp()
 {
     parent::setUp();
     // Migrate database
     Artisan::call('migrate');
     // Do not send mails
     Mail::pretend(true);
     // To create test models
     Model::unguard();
     // Logout - just to be sure
     \Sentry::logout();
 }