public function setUp() { if (!isset(self::$dbRefresh[get_class($this)])) { self::$oAuthCredentials = null; } parent::setUp(); }
public function setUp() { parent::setUp(); $this->illuminateDispatcher = m::spy('Illuminate\\Events\\Dispatcher'); $this->logger = m::spy('Illuminate\\Log\\Writer'); $this->dispatcher = new EventDispatcher($this->illuminateDispatcher, $this->logger); }
public function setUp() { parent::setUp(); $this->parser = new EmailParser(); $this->user = m::mock('App\\Services\\Piper\\Pipes\\UserPipe'); $this->org = m::mock('App\\Contracts\\Repositories\\OrgInterface'); }
public function setUp() { parent::setUp(); $this->runDatabaseMigrations(); $this->seed(); config(['modules.path' => base_path('nomodules')]); }
public function setUp() { parent::setUp(); $this->phpmorphyFactory = m::mock('Nqxcode\\Stemming\\PhpmorphyFactory'); $this->phpmorphyFactory->shouldReceive('newInstance')->andReturn($phpmorphy = m::mock('\\phpMorphy')); $this->phpmorphy = $phpmorphy; }
/** * Setup module configuration file. * * @return void */ public function setUp() { parent::setUp(); /* @noinspection PhpIncludeInspection */ $this->modules = (require realpath(__DIR__ . '/../../../stub/tests/modules.php')); config(['modules' => $this->modules]); }
public function setUp() { parent::setUp(); $this->indexPath = sys_get_temp_dir() . '/temp_lucene_index'; $this->analyzerConfig = m::mock('Nqxcode\\LuceneSearch\\Analyzer\\Config'); $this->analyzerConfig->shouldReceive('setDefaultAnalyzer'); }
public function setUp() { parent::setUp(); $this->runner = m::mock('Nqxcode\\LuceneSearch\\Query\\Runner'); $this->filter = m::mock('Nqxcode\\LuceneSearch\\Query\\Filter'); $this->query = m::mock('ZendSearch\\Lucene\\Search\\Query\\Boolean'); $this->rawQueryBuilder = m::mock('Nqxcode\\LuceneSearch\\Query\\RawQueryBuilder'); $this->app->instance('Nqxcode\\LuceneSearch\\Query\\Runner', $this->runner); $this->app->instance('Nqxcode\\LuceneSearch\\Query\\Filter', $this->filter); $this->app->instance('ZendSearch\\Lucene\\Search\\Query\\Boolean', $this->query); $this->app->instance('Nqxcode\\LuceneSearch\\Query\\RawQueryBuilder', $this->rawQueryBuilder); $this->rawQueryBuilder->shouldReceive('build')->with($this->defaultFindOptions())->andReturn(['test', true]); $this->rawQueryBuilder->shouldReceive('parse')->with('test')->andReturn($this->luceneQuery = new Boolean())->byDefault(); $this->query->shouldReceive('addSubquery')->with($this->luceneQuery, true); $lazyCollectionMock = m::mock(LazyCollection::make([1, 2, 3])); $lazyCollectionMock->shouldReceive('reload')->andReturn(Collection::make([1, 2, 3]))->byDefault(); $this->runner->shouldReceive('models')->with($this->query)->andReturn($lazyCollectionMock)->byDefault(); $this->runner->shouldReceive('total')->with($this->query)->andReturn(3)->byDefault(); $this->runner->shouldReceive('models')->with($this->query, [])->andReturn($lazyCollectionMock)->byDefault(); $this->runner->shouldReceive('models')->with($this->query, [])->andReturn($lazyCollectionMock)->byDefault(); $this->runner->shouldReceive('total')->with($this->query, [])->andReturn(3)->byDefault(); $this->runner->shouldReceive('run')->with($this->query)->andReturn([1, 2, 3, 4])->byDefault(); $this->runner->shouldReceive('setCachedTotal')->byDefault(); $this->runner->shouldReceive('setCachedModels')->byDefault(); $this->runner->shouldReceive('getCachedTotal')->andReturn(null)->byDefault(); $this->runner->shouldReceive('getCachedModels')->andReturn(null)->byDefault(); $this->filter->shouldReceive('applyFilters')->with($this->query); $this->constructor = $this->app->make('Nqxcode\\LuceneSearch\\Query\\Builder'); }
public function setUp() { parent::setUp(); $this->ticket = m::mock('App\\Contracts\\Repositories\\TicketInterface'); $this->action = m::mock('App\\Contracts\\Repositories\\TicketActionInterface'); $this->faker = Faker::create(); }
public function setUp() { parent::setUp(); if (file_exists(base_path('bootstrap/cache/compiled.php'))) { unlink(base_path('bootstrap/cache/compiled.php')); } $this->app['path.base'] = realpath('./'); }
public function setUp() { parent::setUp(); $this->search = m::mock('Nqxcode\\LuceneSearch\\Search'); $this->app->instance('Nqxcode\\LuceneSearch\\Search', $this->search); $this->runner = $this->app->make('Nqxcode\\LuceneSearch\\Query\\Runner'); $this->search->shouldReceive('index->find')->with('test')->andReturn([1, 2, 3, 4, 5]); }
public function setUp() { parent::setUp(); $this->stopwordsFilterFactory = m::mock('Nqxcode\\LuceneSearch\\Analyzer\\Stopwords\\FilterFactory'); $this->analyzer = m::mock('ZendSearch\\Lucene\\Analysis\\Analyzer\\Common\\AbstractCommon'); $this->app->instance('ZendSearch\\Lucene\\Analysis\\Analyzer\\Common\\AbstractCommon', $this->analyzer); $this->config = new Config(['filterClass1'], ['stopwordPath1'], $this->stopwordsFilterFactory); }
public function setUp() { parent::setUp(); $this->config = m::mock('Illuminate\\Config\\Repository'); $this->auth = m::mock('Illuminate\\Auth\\AuthManager'); $this->gate = m::mock('Illuminate\\Contracts\\Auth\\Access\\Gate'); $this->menu = m::mock('Caffeinated\\Menus\\Menu'); $this->cfg = ['Reports' => ['permissions' => ['isStaff'], 'url' => 'reports'], 'Home' => ['url' => 'home']]; }
public function setUp() { parent::setUp(); $this->stub_datetime_generator = $this->stub(DateTimeGenerator::class); $this->stub_datetime_generator->generate()->willReturn('2014-10-10 00:00:00.000'); $this->locker = $this->make_locker($this->stub_datetime_generator->reveal()); $this->stream_id = new StreamID("b5c4aca8-95c7-4b2b-8674-ef7c0e3fd16f", "a955d32b-0130-463f-b3ef-23adec9af469"); $this->locker->unlock($this->stream_id); }
public function setUp() { parent::setUp(); $this->configure(); // Call migrations specific to our tests, e.g. to seed the db. Artisan::call('migrate', ['--database' => 'testbench', '--path' => '../tests/migrations']); // Call rebuild search index. Artisan::call('search:rebuild'); }
public function setUp() { parent::setUp(); $this->faker = Faker::create(); $this->user_model = factory(App\User::class)->make(['id' => $this->faker->randomNumber]); $this->be($this->user_model); $this->ticket = m::mock('App\\Contracts\\Repositories\\TicketInterface'); // $this->user = m::mock('App\Contracts\Repositories\UserInterface'); }
/** * Sets up the required database connection and then runs the migrations. */ public function setUp() { parent::setUp(); $migrations = $this->app->make('migration.repository'); $migrations->createRepository(); $migrator = $this->app->make('migrator'); $migrator->run(__DIR__ . '/../../resources/migrations'); $this->setupAccount(); $this->init(); }
public function setUp() { parent::setUp(); $this->product = new Product(); $this->product->id = 1; $this->product->name = 'test name'; $this->dummy = new DummyModel(); $this->dummy->id = 2; $this->dummy->name = 'another test name'; }
/** * Setup module configuration file. * * @return void */ public function setUp() { parent::setUp(); /* @noinspection PhpIncludeInspection */ $this->ferrl = (require realpath(__DIR__ . '/../../../../stub/tests/ferrl.php')); /** @var View $factory */ $factory = app(View::class); $factory->addNamespace('layouts', realpath(__DIR__ . '/../../../../stub/application/resources/layouts')); config(['ferrl' => $this->ferrl]); }
public function setUp() { parent::setUp(); $this->user = new User(); $this->repo = m::mock('Bosnadev\\Repositories\\Contracts\\RepositoryInterface'); $this->config = ['zombies' => ['admin' => true, 'mgr' => true, 'owner' => true, 'dept' => false], 'aliens' => ['admin' => false, 'dept' => true, 'assigned' => true, 'org' => true], 'monsters' => ['admin' => false, 'dept' => false, 'last' => true], 'vampires' => []]; $this->app['config']->set('settings.notify', $this->config); $this->app['config']->set('settings.autorespond.bymail', false); $this->ticket = factory(App\Ticket::class)->make(['id' => 1234]); $this->ticket->dept = factory(App\Dept::class)->make(); }
/** * Setup database */ protected function setUp() { parent::setUp(); \Tester\Helpers::lock('db', dirname(TEMP_DIR)); $this->connection = $this->getConnection(); $this->selectionFactory = $this->getSelectionFactory(); $this->connection->beginTransaction(); $this->emptyDatabase(); $this->createDatabase(); $this->connection->commit(); }
public function setUp() { parent::setUp(); $db = m::mock(); $db->shouldReceive('connection->getSchemaBuilder->hasTable')->andReturn(true); $this->app->instance('db', $db); $result = $this->mockEloquentResults('App\\Config', [['key' => 'system.eyes', 'value' => 'a:1:{i:0;s:4:"blue";}', 'id' => 1], ['key' => 'system.hair', 'value' => 'a:1:{i:0;s:8:"brunette";}', 'id' => 2], ['key' => 'system.hottie', 'value' => 'a:1:{i:0;b:0;}', 'id' => 3], ['key' => 'system.legs', 'value' => 'long', 'id' => 3]]); $this->config = m::mock('App\\Repositories\\Eloquent\\ConfigRepository'); $this->config->shouldReceive('all')->atMost(1)->andReturn($result); $this->app->instance('App\\Repositories\\ConfigInterface', $this->config); }
public function setUp() { parent::setUp(); $this->user = $this->userRepository->create(new \App\User(['username' => $this->faker->userName, 'email' => $this->faker->safeEmail, 'password' => $this->faker->password()])); $this->group = $this->groupRepository->create(new \App\Group(['name' => uniqid()])); $this->role = $this->roleRepository->create(new \App\Role(['name' => uniqid(), 'filter' => 'A'])); $this->roleRevoke = $this->roleRepository->create(new \App\Role(['name' => uniqid(), 'filter' => 'R'])); $this->permissionFirst = $this->permissionRepository->create(new \App\Permission(['area' => uniqid(), 'permission' => uniqid(), 'description' => 'test'])); $this->permissionSecond = $this->permissionRepository->create(new \App\Permission(['area' => uniqid(), 'permission' => uniqid(), 'description' => 'test'])); $this->resolver = new PermissionResolver(); }
public function setUp() { parent::setUp(); $id_generator = new IDGenerator(); $datetime_generator = new DateTimeGenerator(); $this->event_builder = new EventBuilder($id_generator, $datetime_generator); $this->repo = $this->build_event_repository(); $this->stream_event1 = $this->make_event("c91942f1-3c94-4900-a3b0-4497311e3503", "a955d32b-0130-463f-b3ef-23adec9af469"); $this->stream_event2 = $this->make_event("b2527176-edcc-4db9-818a-9a4e5767f350", "a955d32b-0130-463f-b3ef-23adec9af469"); $this->other_event = $this->make_event("11386b92-690e-4e15-8418-ff3c1688bad8", "343d56cf-6c4d-4d5d-9040-c7dd74ab65b9"); $this->repo->store([$this->stream_event1, $this->stream_event2, $this->other_event]); $this->stream_id = new StreamID("b5c4aca8-95c7-4b2b-8674-ef7c0e3fd16f", "a955d32b-0130-463f-b3ef-23adec9af469"); }
public function setUp() { parent::setUp(); static::$userData = ['username' => 'test', 'password' => base64_encode('123'), 'language_id' => 1, 'country_id' => 1]; $user = \App\User::withTrashed()->where('username', '=', 'test')->first(); if (!$user) { $user = factory(\App\User::class)->create(static::$userData); } if ($user->trashed()) { $user->restore(); } static::$idUser = $user->id; }
protected function setUp() { parent::setUp(); $this->client = $this->mockista->create('Drahak\\OAuth2\\Storage\\Clients\\IClientStorage'); $this->clientEntity = $this->mockista->create('Drahak\\OAuth2\\Storage\\Clients\\IClient'); $this->accessTokenEntity = $this->mockista->create('Drahak\\OAuth2\\Storage\\AccessTokens\\IAccessToken'); $this->refreshTokenEntity = $this->mockista->create('Drahak\\OAuth2\\Storage\\RefreshTokens\\IRefreshToken'); $this->accessToken = $this->mockista->create('Drahak\\OAuth2\\Storage\\AccessTokens\\AccessToken'); $this->refreshToken = $this->mockista->create('Drahak\\OAuth2\\Storage\\RefreshTokens\\RefreshToken'); $this->authorizationCode = $this->mockista->create('Drahak\\OAuth2\\Storage\\AuthorizationCodes\\AuthorizationCode'); $this->token = $this->mockista->create('Drahak\\OAuth2\\Storage\\TokenContext'); $this->input = $this->mockista->create('Drahak\\OAuth2\\Http\\IInput'); $this->user = $this->mockista->create('Nette\\Security\\User'); }
public function setUp() { parent::setUp(); $this->model = new DummyModel(); $this->model->id = 1; $this->model->name = 'test name'; $this->connection = m::mock('Nqxcode\\LuceneSearch\\Connection'); $this->connection->shouldReceive('getIndexPath'); $this->config = m::mock('Nqxcode\\LuceneSearch\\Model\\Config'); $this->config->shouldReceive('privateKeyPair')->with($this->model)->andReturn(['private_key', 1]); $this->config->shouldReceive('classUidPair')->with($this->model)->andReturn(['class_uid', '12345']); $this->config->shouldReceive('fields')->with($this->model)->andReturn(['name']); $this->config->shouldReceive('optionalAttributes')->andReturn(['optional_attribute1' => 'optional value']); }
public function setUp() { parent::setUp(); $configs = $this->getValidConfigs(); $modelFactory = m::mock('Nqxcode\\LuceneSearch\\Model\\Factory'); $modelFactory->shouldReceive('newInstance')->with('tests\\models\\Product')->andReturn($this->productRepoMock = m::mock(new Product())); $this->productRepoMock->id = 1; $modelFactory->shouldReceive('newInstance')->with('tests\\models\\DummyModel')->andReturn($this->dummyRepoMock = m::mock(new DummyModel())); $this->dummyRepoMock->pk = 2; $modelFactory->shouldReceive('classUid')->with('tests\\models\\Product')->andReturn('1'); $modelFactory->shouldReceive('classUid')->with('tests\\models\\DummyModel')->andReturn('2'); $this->unknownRepoMock = m::mock('Illuminate\\Database\\Eloquent\\Model'); $modelFactory->shouldReceive('classUid')->with(get_class($this->unknownRepoMock))->andReturn('999'); $this->config = new Config($configs, $modelFactory); }
public function setUp() { parent::setUp(); static::$userData = ['username' => 'test', 'password' => base64_encode('123'), 'language_id' => 1, 'country_id' => 1]; $user = \App\User::withTrashed()->where('username', '=', 'test')->first(); if (!$user) { $user = factory(\App\User::class)->create(static::$userData); } if ($user->trashed()) { $user->restore(); } static::$idUser = $user->id; static::$headers = array('Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . Token::createToken($user)); $this->taskData['user_id'] = $user->id; }
public function setUp() { parent::setUp(); $this->_poll = new Entity\Poll(); }