예제 #1
0
 public function setUp()
 {
     parent::setUp();
     $artisan = $this->app->make('artisan');
     $artisan->call('migrate', ['--database' => 'testbench', '--path' => '../tests/migrations']);
     $this->countQueries();
 }
예제 #2
0
 public function setUp()
 {
     parent::setUp();
     \Config::set('database.default', 'sqlite');
     \Config::set('database.connections', ['sqlite' => array('driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '')]);
     $this->createDatabase();
 }
예제 #3
0
 /**
  * Setup the test environment.
  */
 public function setUp()
 {
     parent::setUp();
     // uncomment to enable route filters if your package defines routes with filters
     // $this->app['router']->enableFilters();
     // create an artisan object for calling migrations
     //$artisan = $this->app->make('artisan');
     // call migrations for packages upon which our package depends, e.g. Cartalyst/Sentry
     // not necessary if your package doesn't depend on another package that requires
     // running migrations for proper installation
     /* uncomment as necessary
     	$artisan->call('migrate', [
     	'--database' => 'testbench',
     	'--path' => '../vendor/cartalyst/sentry/src/migrations',
     	]);
     	*/
     // call migrations that will be part of your package, assumes your migrations are in src/migrations
     // not neccessary if your package doesn't require any migrations to be run for
     // proper installation
     /* uncomment as neccesary
     	$artisan->call('migrate', [
     	'--database' => 'testbench',
     	'--path' => 'migrations',
     	]);
     	*/
     // call migrations specific to our tests, e.g. to seed the db
     /*$artisan->call('migrate', array(
           '--database' => 'testbench',
           '--path' => '../tests/migrations',
       ));*/
 }
예제 #4
0
 public function setUp()
 {
     parent::setUp();
     $this->app->instance('path.public', __DIR__ . '/fixture');
     Image::deleteManipulated($this->imagePath);
     $this->imageSize = getimagesize(public_path() . $this->imagePath);
 }
예제 #5
0
 public function setUp()
 {
     parent::setUp();
     $this->artisan('migrate', ['--database' => 'testbench', '--realpath' => realpath(__DIR__ . '/database')]);
     // @TODO refactor fixtures, this schema sucks so much :(
     \DB::table('person')->delete();
     \DB::table('son')->delete();
     \DB::table('roles')->delete();
     \DB::table('person')->insert(['id' => 1, 'name' => 'Homer']);
     \DB::table('person')->insert(['id' => 2, 'name' => 'Marge']);
     \DB::table('person')->insert(['id' => 3, 'name' => 'Apu']);
     \DB::table('son')->insert(['pid' => 1, 'name' => 'Bart']);
     \DB::table('son')->insert(['pid' => 1, 'name' => 'Lisa']);
     \DB::table('son')->insert(['pid' => 1, 'name' => 'Maggie']);
     \DB::table('son')->insert(['pid' => 2, 'name' => 'Lisa']);
     \DB::table('roles')->insert(['id' => 1, 'name' => 'Father']);
     \DB::table('roles')->insert(['id' => 2, 'name' => 'Mother']);
     \DB::table('roles')->insert(['id' => 3, 'name' => 'Vendor']);
     \DB::table('roles')->insert(['id' => 4, 'name' => 'Children']);
     \DB::table('roles')->insert(['id' => 5, 'name' => 'Nuclear Safety Inspector']);
     \DB::table('roles')->insert(['id' => 6, 'name' => 'Ambulance Driver']);
     \DB::table('roles')->insert(['id' => 7, 'name' => 'Food Critic']);
     \DB::table('person_roles')->insert(['pid' => 1, 'rid' => 1]);
     \DB::table('person_roles')->insert(['pid' => 2, 'rid' => 2]);
     \DB::table('person_roles')->insert(['pid' => 3, 'rid' => 3]);
 }
예제 #6
0
 public function setUp()
 {
     parent::setUp();
     $this->queries = new Helpers\SqliteQueries();
     $this->migrateDatabase();
     $this->seedDatabase();
 }
예제 #7
0
 public function setUp()
 {
     parent::setUp();
     if (File::isDirectory('packages')) {
         File::deleteDirectory('packages');
     }
 }
예제 #8
0
 public function setUp()
 {
     parent::setUp();
     if (!file_exists($this->testImage)) {
         copy($this->sample, $this->testImage);
     }
 }
예제 #9
0
 public function setUp()
 {
     parent::setUp();
     Route::any('{anything}', function () {
     })->where('anything', '.*');
     $this->app['router']->enableFilters();
 }
예제 #10
0
 public function setUp()
 {
     parent::setUp();
     $this->app->bindShared('path.base', function () {
         return BASE_PATH;
     });
 }
 public function setUp()
 {
     parent::setUp();
     app('Illuminate\\Database\\DatabaseManager')->beginTransaction();
     $this->artisan = $this->app->make('Illuminate\\Contracts\\Console\\Kernel');
     $this->artisan->call('migrate', ['--realpath' => realpath(__DIR__ . '/../resources/migrations')]);
 }
예제 #12
0
 public function setUp()
 {
     parent::setUp();
     $this->app['path.database'] = __DIR__;
     $migration = new CreateTokensTable();
     $migration->up();
     Schema::create('users', function (\Illuminate\Database\Schema\Blueprint $table) {
         $table->increments('id');
         $table->string('username', 128)->unique();
         $table->timestamps();
     });
     $user = new User();
     $user->username = '******';
     $user->save();
     $user = new User();
     $user->username = '******';
     $user->save();
     $token = App::make('token');
     $token->create(1, 1, 7200);
     // 1 OK
     $token->create(2, 1, 7200);
     // 2 Not loggable by token
     $token->create(1, false, 7200);
     // 3 Expired
     $obj = $token->find(3);
     $obj->expire_at = time() - 3600;
     $token->persist($obj);
     $token->create();
     // 4 token without user
 }
 /**
  * Setup test.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->dilemma = $this->app->make('TradeoffDilemma', $this->getResolution());
     $this->resolution = $this->dilemma->getResolution();
     $this->map = $this->resolution->getMap();
 }
예제 #14
0
 public function setUp()
 {
     parent::setUp();
     $this->bookRepo = m::mock('Bakgat\\Notos\\Domain\\Model\\Resource\\BookRepository');
     $this->org = Organization::register(new Name('VBS De Klimtoren'), new DomainName('klimtoren.be'));
     $this->spec = new IsbnIsUnique($this->bookRepo);
 }
예제 #15
0
 /**
  * Setup the test environment.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->model = Mockery::mock(Model::class)->makePartial();
     $this->repository = Mockery::mock(Repository::class)->makePartial();
     $this->repository->setupRepository($this->model);
 }
 public function setUp()
 {
     parent::setUp();
     require_once __DIR__ . "/../../src/routes.php";
     $this->useMailPretend();
     $this->useNullLogger();
 }
예제 #17
0
 /**
  * @param \Ipunkt\Simpleauth\Repositories\EloquentRepository $repository
  */
 public function setUp()
 {
     parent::setUp();
     $this->repository = new EloquentRepository();
     $artisan = $this->app->make('artisan');
     $artisan->call('migrate', array('--database' => 'testbench', '--path' => '../src/migrations'));
 }
예제 #18
0
 public function setUp()
 {
     parent::setUp();
     // setup Slack API
     $token = getenv('slack_token');
     $this->slackApi = new SlackApi($token);
 }
 public function setUp()
 {
     parent::setUp();
     $this->queueCheckerJob = new QueueCheckerJob();
     $this->taskMock = m::mock();
     $this->taskMock->shouldReceive('delete');
 }
예제 #20
0
 public function setUp()
 {
     parent::setUp();
     $this->groupRepo = m::mock('Bakgat\\Notos\\Domain\\Model\\Identity\\GroupRepository');
     $this->kindRepo = m::mock('Bakgat\\Notos\\Domain\\Model\\KindRepository');
     $this->groupService = new GroupService($this->kindRepo, $this->groupRepo);
 }
예제 #21
0
 public function setUp()
 {
     parent::setUp();
     //$this->app['cache']->clear();
     $this->setUpDatabase($this->app);
     $this->setUpRoutes($this->app);
 }
예제 #22
0
파일: TestCase.php 프로젝트: talv86/easel
 public function setUp()
 {
     parent::setUp();
     $this->artisan('migrate', ['--database' => 'test', '--realpath' => realpath(__DIR__ . '/../database/migrations')]);
     $this->withFactories(realpath(__DIR__ . '/../database/factories'));
     $this->artisan('easel:install');
 }
예제 #23
0
 /**
  * Setup the test environment.
  */
 public function setUp()
 {
     parent::setUp();
     $this->artisan('migrate', ['--database' => 'testbench', '--realpath' => realpath(__DIR__ . '/migrations')]);
     $this->withFactories(__DIR__ . '/factories');
     \Cache::flush();
 }
예제 #24
0
 public function setUp()
 {
     parent::setUp();
     $this->setupMocks();
     $this->bookService = new BookService($this->bookRepo, $this->orgRepo);
     $this->setupTestData();
 }
 /**
  * Setup the test environment.
  */
 public function setUp()
 {
     parent::setUp();
     $artisan = $this->app->make('artisan');
     $artisan->call('migrate', ['--database' => 'testing', '--path' => '../tests/database/migrations']);
     $artisan->call('db:seed', ['--database' => 'testing', '--class' => 'TopicTableSeeder']);
 }
 /**
  * Set up the tests.
  */
 public function setUp()
 {
     parent::setUp();
     $this->translator = $this->app['translator'];
     $this->detector = new LanguageDetector($this->translator);
     $this->translator->setLocale('fr');
 }
예제 #27
0
 public function setUp()
 {
     parent::setUp();
     $artisan = $this->app->make('artisan');
     $output = new BufferedOutput();
     $artisan->call('migrate', ['--database' => 'testbench', '--path' => 'migrations'], $output);
 }
예제 #28
0
 public function setUp()
 {
     parent::setUp();
     $artisan = $this->app->make('artisan');
     $this->resetDatabase($artisan);
     $this->countQueries();
 }
예제 #29
0
 public function setUp()
 {
     parent::setUp();
     $this->setupMocks();
     $this->userService = new UserService($this->userRepo, $this->orgRepo, $this->roleRepo, $this->userRoleRepo, $this->hasher);
     $this->setupTestData();
 }
 /**
  * Setup the test environment.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->app['config']->set('translatable.locales', ['en', 'nl']);
     $this->app['config']->set('translatable-bootforms.label-locale-indicator', '%label (%locale)');
     $this->bootform = $this->app->make('bootform');
     $this->form = $this->app->make('translatable-bootform');
 }