public function setUp() { parent::setUp(); $this->image = ROOT . DS . APP_DIR . DS . 'Plugin' . DS . 'Media' . DS . 'Test' . DS . 'testHelper.png'; $this->Medias = TableRegistry::get('Medias', ['className' => 'Media\\Model\\Table\\MediasTable']); //$this->Media->expects($this->any())->method('move_uploaded_file')->will($this->returnCallback('test_move_uploaded_file')); }
/** * Setup method. * * @return void */ public function setUp() { parent::setUp(); Router::plugin('DebugKit', function ($routes) { $routes->connect('/toolbar/:action/*', ['controller' => 'Requests']); }); }
/** * TearDown method * * @return void */ public function tearDown() { unset($this->UsersTypeMissions); unset($this->Users); unset($this->Visits); parent::tearDown(); }
/** * Runs after each test. * * @return void */ public function tearDown() { parent::tearDown(); Setting::clear(true); Configure::write('CA.PostTypes', []); Configure::write('CA.Models', []); }
public function tearDown() { parent::tearDown(); unset($this->Medias); unset($this->Posts); TableRegistry::clear(); }
/** * Setup method. * * @return void */ public function setUp() { parent::setUp(); Router::plugin('DebugKit', function ($routes) { $routes->connect('/panels/:action/*', ['controller' => 'Panels']); }); }
/** * Setup method. * * @return void */ public function setUp() { parent::setUp(); Router::plugin('DebugKit', function ($routes) { $routes->connect('/toolbar/clear_cache/*', ['plugin' => 'DebugKit', 'controller' => 'Toolbar', 'action' => 'clearCache']); }); }
/** * setUp method * * It will set the needed Tables. */ public function setUp() { parent::setUp(); $config = TableRegistry::exists('Todos') ? [] : ['className' => 'App\\Model\\Table\\TodosTable']; $this->Todos = TableRegistry::get('Todos', $config); $config = TableRegistry::exists('Users') ? [] : ['className' => 'App\\Model\\Table\\UsersTable']; $this->Users = TableRegistry::get('Users', $config); }
public function controllerSpy($event, $controller = null) { parent::controllerSpy($event, $controller); if (isset($this->_controller)) { $this->_controller->PaypalIpnRequest = $this->createMock('PaypalIpn\\Controller\\Component\\PaypalIpnRequestComponent'); $this->_controller->PaypalIpnRequest->expects($this->any())->method('validate')->will($this->returnValue(true)); } }
/** * {@inheritDoc} */ public function setUp() { $eventManagerInstance = EventManager::instance(); parent::setUp(); EventManager::instance($eventManagerInstance); $this->session(mockUserSession()); include QUICKAPPS_CORE . '/config/routes_site.php'; }
/** * Setup * * @return void */ public function setUp() { parent::setUp(); $this->Logs = TableRegistry::get('DatabaseLog.DatabaseLogs'); if (!$this->Logs->find()->count()) { $this->Logs->log('warning', 'Foo Warning', ['x' => 'y']); } }
/** * tearDown method executed after every test method. */ public function tearDown() { parent::tearDown(); unlink($this->tempConfig); $testDoc = CACHE . 'cakephp_swagger_testdoc.json'; if (file_exists($testDoc)) { unlink($testDoc); } }
/** * [setUp description] * * @return void */ public function setUp() { parent::setUp(); $this->resetReflectionCache(); $this->_eventManager = EventManager::instance(); $existing = Configure::read('App.paths.templates'); $existing[] = Plugin::path('Crud') . 'tests/App/Template/'; Configure::write('App.paths.templates', $existing); }
/** * Setup method * * @return void */ public function setUp() { parent::setUp(); Configure::write('App.namespace', 'TestApp'); Router::connect('/:controller/:action/*', [], ['routeClass' => 'InflectedRoute']); DispatcherFactory::clear(); DispatcherFactory::add('Routing'); DispatcherFactory::add('ControllerFactory'); }
public function setUp() { parent::setUp(); $this->session(['Auth' => ['User' => ['id' => 1, 'username' => 'Phil']]]); $this->configRequest(['headers' => ['Accept' => 'application/json']]); $this->Threads = TableRegistry::get('Threads'); $this->Threads->hasMany('Messages'); $this->Threads->Messages->hasMany('MessageReadStatuses'); }
public function setUp() { parent::setUp(); $this->Medias = TableRegistry::get('TestPictures'); $this->image = ROOT . DS . 'plugins' . DS . 'Media' . DS . 'tests' . DS . 'testHelper.png'; $Medias = $this->getMock('MediasController', array('canUploadMedias')); $Medias->expects($this->any())->method('move_uploaded_file')->will($this->returnCallback('test_move_uploaded_file')); $Medias->expects($this->any())->method('canUploadMedias')->will($this->returnValue(true)); $this->controller = $this->getMock('App\\Controller\\MediasController'); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->Users = TableRegistry::get('CakeManager.Users'); $user = $this->Users->newEntity(); $user->email = '*****@*****.**'; $user->active = 1; $user->role_id = 1; $user->password = '******'; $this->Users->save($user); }
/** * [setUp description] * * @return void */ public function setUp() { parent::setUp(); $this->resetReflectionCache(); $this->_eventManager = EventManager::instance(); $existing = Configure::read('App.paths.templates'); $existing[] = Plugin::path('Crud') . 'tests/App/Template/'; Configure::write('App.paths.templates', $existing); Configure::write('App.namespace', 'Crud\\Test\\App'); Router::extensions('json'); Router::connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']); Router::connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']); $this->useHttpServer(false); }
/** * Setup the test case, backup the static object values so they can be restored. * Specifically backs up the contents of Configure and paths in App if they have * not already been backed up. * * @return void */ public function setUp() { parent::setUp(); $this->Ips = TableRegistry::get('TestApp.Ips'); $this->Ips->schema()->columnType('ip', 'ip'); Router::scope('/', function ($routes) { $routes->connect('/ips', ['controller' => 'Ips']); $routes->connect('/ips/add', ['controller' => 'Ips', 'action' => 'add']); $routes->connect('/ips/edit/:id', ['controller' => 'Ips', 'action' => 'edit'], ['pass' => ['id']]); $routes->connect('/ips/edit_when_always/:id', ['controller' => 'Ips', 'action' => 'editWhenAlways'], ['pass' => ['id']]); $routes->connect('/ips/edit_when_bad_value/:id', ['controller' => 'Ips', 'action' => 'editWhenBadValue'], ['pass' => ['id']]); $routes->connect('/ips/add_other_field', ['controller' => 'Ips', 'action' => 'addOtherField']); $routes->connect('/ips/edit_other_field/:id', ['controller' => 'Ips', 'action' => 'editOtherField'], ['pass' => ['id']]); $routes->connect('/ips/edit_other_field_when_always/:id', ['controller' => 'Ips', 'action' => 'editOtherFieldWhenAlways'], ['pass' => ['id']]); $routes->connect('/ips/edit_other_field_when_bad_value/:id', ['controller' => 'Ips', 'action' => 'editOtherFieldWhenBadValue'], ['pass' => ['id']]); $routes->connect('/ips/add_two_fields', ['controller' => 'Ips', 'action' => 'addTwoFields']); $routes->connect('/ips/edit_two_fields/:id', ['controller' => 'Ips', 'action' => 'editTwoFields'], ['pass' => ['id']]); }); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->Users = TableRegistry::get('CakeManager.Users'); }
public function tearDown() { parent::tearDown(); TableRegistry::clear(); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->Users = TableRegistry::get('Users'); $this->Threads = TableRegistry::get('Threads'); }
/** * TearDown method * * @return void */ public function tearDown() { unset($this->Notifications); parent::tearDown(); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); }
/** * tearDown method. */ public function tearDown() { parent::tearDown(); unlink($this->tempConfig); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->session(['Auth' => ['User' => ['id' => 100]]]); }
/** * TearDown method * * @return void */ public function tearDown() { unset($this->Missions); parent::tearDown(); }
public function setUp() { parent::setUp(); $this->usersFixture = new UsersFixture(); }
/** * Test index method * * @return void */ public function tearDown() { parent::tearDown(); }
/** * Tear Down * * @return void */ public function tearDown() { unset($this->Users); parent::tearDown(); }