/** * setup * * @return void */ public function setUp() { parent::setUp(); $this->connection = ConnectionManager::get('test'); $this->user = TableRegistry::get('Users', ['table' => 'counter_cache_users', 'connection' => $this->connection]); $this->post = new PostTable(['alias' => 'Post', 'table' => 'counter_cache_posts', 'connection' => $this->connection]); }
public function setUp() { parent::setUp(); $this->table = TableRegistry::get('NumberTrees'); $this->table->primaryKey(['id']); $this->table->addBehavior('Tree'); }
/** * setUp * * @return void */ public function setUp() { parent::setUp(); $this->Addresses = TableRegistry::get('Geo.Addresses'); $this->Addresses->addBehavior('Geo.Geocoder', array('real' => false)); $this->db = ConnectionManager::get('test'); }
/** * Set up * * @return void */ public function setUp() { parent::setUp(); $this->company = TableRegistry::get('Companies', ['schema' => ['id' => ['type' => 'integer'], 'company_name' => ['type' => 'string'], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]]]); $this->client = TableRegistry::get('Clients', ['schema' => ['id' => ['type' => 'integer'], 'client_name' => ['type' => 'string'], 'company_id' => ['type' => 'integer'], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]]]); $this->companiesTypeMap = new TypeMap(['Companies.id' => 'integer', 'id' => 'integer', 'Companies.company_name' => 'string', 'company_name' => 'string']); }
/** * Set up * * @return void */ public function setUp() { parent::setUp(); $this->user = TableRegistry::get('Users', ['schema' => ['id' => ['type' => 'integer'], 'username' => ['type' => 'string'], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]]]); $this->profile = TableRegistry::get('Profiles', ['schema' => ['id' => ['type' => 'integer'], 'first_name' => ['type' => 'string'], 'user_id' => ['type' => 'integer'], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]]]); $this->profilesTypeMap = new TypeMap(['Profiles.id' => 'integer', 'id' => 'integer', 'Profiles.first_name' => 'string', 'first_name' => 'string', 'Profiles.user_id' => 'integer', 'user_id' => 'integer']); }
public function setUp() { parent::setUp(); $templates = ['button' => '<button{{attrs}}>{{text}}</button>']; $this->templates = new StringTemplate($templates); $this->context = $this->getMockBuilder('Cake\\View\\Form\\ContextInterface')->getMock(); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->Songs = TableRegistry::get('Reorder.Songs'); $this->Songs->addBehavior('Reorder.Reorder', ['play_order' => null, 'play_order_all' => null]); $this->Behavior = $this->Songs->behaviors()->Reorder; }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); Plugin::load('TestPlugin'); Configure::write('App.namespace', 'TestApp'); $this->dispatcher = $this->getMockBuilder('Cake\\Console\\ShellDispatcher')->setMethods(['_stop'])->getMock(); }
/** * setup method. * * @return void */ public function setUp() { parent::setUp(); $templates = ['select' => '<select name="{{name}}"{{attrs}}>{{content}}</select>', 'selectMultiple' => '<select name="{{name}}[]" multiple="multiple"{{attrs}}>{{content}}</select>', 'option' => '<option value="{{value}}"{{attrs}}>{{text}}</option>', 'optgroup' => '<optgroup label="{{label}}"{{attrs}}>{{content}}</optgroup>']; $this->context = $this->getMock('Cake\\View\\Form\\ContextInterface'); $this->templates = new StringTemplate($templates); }
/** * Setup test data. * * @return void */ public function setUp() { parent::setUp(); Plugin::load('TestPlugin', ['autoload' => true]); Plugin::load('Union/Core', ['path' => ROOT, 'routes' => true, 'bootstrap' => true]); $this->View = new AppView(); }
/** * Setup * * @return void */ public function setUp() { parent::setUp(); Cache::clear(false); $this->apiFolderName = 'NonExistingApiPrefixedFolder'; $this->apiFolderPath = APP . 'Controller' . DS . $this->apiFolderName; }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->skipIf(DS === '\\', 'Skip AssetsTask tests on windows to prevent side effects for UrlHelper tests on AppVeyor.'); $this->io = $this->getMockBuilder('Cake\\Console\\ConsoleIo')->disableOriginalConstructor()->getMock(); $this->Task = $this->getMockBuilder('Cake\\Shell\\Task\\AssetsTask')->setMethods(['in', 'out', 'err', '_stop'])->setConstructorArgs([$this->io])->getMock(); }
/** * setup, create mocks * * @return Mock object */ public function setUp() { parent::setUp(); $this->stderr = $this->getMock('Cake\\Console\\ConsoleOutput', [], [], '', false); $this->Error = $this->getMock('Cake\\Console\\ConsoleErrorHandler', ['_stop'], [['stderr' => $this->stderr]]); Log::drop('stderr'); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); Router::reload(); Router::connect('/:controller', ['action' => 'index']); Router::connect('/:controller/:action/*'); }
/** * setup * * @return void */ public function setUp() { parent::setUp(); $request = new Request(); $this->Trait = $this->getMockBuilder('CakeDC\\Users\\Controller\\Traits\\LoginTrait')->setMethods(['dispatchEvent', 'redirect'])->getMockForTrait(); $this->Trait->request = $request; }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->View = new View(null); $this->View->request = $this->getMock('\\Cake\\Network\\Request', ['session']); $this->View->viewVars = array('userData' => new Entity(['id' => 'user-1', 'username' => 'florian', 'role' => 'admin', 'something' => 'some value', 'data' => ['field1' => 'field one']])); }
/** * setUp * * @return void */ public function setUp() { parent::setUp(); Configure::write('Acl.classname', 'DbAcl'); Configure::write('Acl.database', 'test'); $this->Task = $this->getMock('Acl\\AclExtras', ['in', 'out', 'hr', 'createFile', 'error', 'err', 'clear', 'getControllerList']); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->connection = ConnectionManager::get('test'); $schema = ['id' => ['type' => 'integer'], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]]; $schema1 = ['id' => ['type' => 'integer'], 'name' => ['type' => 'string'], 'phone' => ['type' => 'string'], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]]; $schema2 = ['id' => ['type' => 'integer'], 'total' => ['type' => 'string'], 'placed' => ['type' => 'datetime'], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]]; $this->table = $table = TableRegistry::get('foo', ['schema' => $schema]); $clients = TableRegistry::get('clients', ['schema' => $schema1]); $orders = TableRegistry::get('orders', ['schema' => $schema2]); $companies = TableRegistry::get('companies', ['schema' => $schema, 'table' => 'organizations']); $orderTypes = TableRegistry::get('orderTypes', ['schema' => $schema]); $stuff = TableRegistry::get('stuff', ['schema' => $schema, 'table' => 'things']); $stuffTypes = TableRegistry::get('stuffTypes', ['schema' => $schema]); $categories = TableRegistry::get('categories', ['schema' => $schema]); $table->belongsTo('clients'); $clients->hasOne('orders'); $clients->belongsTo('companies'); $orders->belongsTo('orderTypes'); $orders->hasOne('stuff'); $stuff->belongsTo('stuffTypes'); $companies->belongsTo('categories'); $this->clientsTypeMap = new TypeMap(['clients.id' => 'integer', 'id' => 'integer', 'clients.name' => 'string', 'name' => 'string', 'clients.phone' => 'string', 'phone' => 'string']); $this->ordersTypeMap = new TypeMap(['orders.id' => 'integer', 'id' => 'integer', 'orders.total' => 'string', 'total' => 'string', 'orders.placed' => 'datetime', 'placed' => 'datetime']); $this->orderTypesTypeMap = new TypeMap(['orderTypes.id' => 'integer', 'id' => 'integer']); $this->stuffTypeMap = new TypeMap(['stuff.id' => 'integer', 'id' => 'integer']); $this->stuffTypesTypeMap = new TypeMap(['stuffTypes.id' => 'integer', 'id' => 'integer']); $this->companiesTypeMap = new TypeMap(['companies.id' => 'integer', 'id' => 'integer']); $this->categoriesTypeMap = new TypeMap(['categories.id' => 'integer', 'id' => 'integer']); }
/** * setup method. * * @return void */ public function setUp() { parent::setUp(); $templates = ['checkbox' => '<input type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}>']; $this->templates = new StringTemplate($templates); $this->context = $this->getMock('Cake\\View\\Form\\ContextInterface'); }
public function setUp() { parent::setUp(); Configure::write('App.namespace', 'Spekkoek\\Test\\TestApp'); $this->factory = new ControllerFactory(); $this->response = $this->getMock('Cake\\Network\\Response'); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->request = $this->getMock('Cake\\Network\\Request'); $this->response = $this->getMock('Cake\\Network\\Response'); $this->Test = new TestCell($this->request, $this->response); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->stub = new ConsoleOutput(); $this->io = new ConsoleIo($this->stub); $this->helper = new ProgressHelper($this->io); }
public function setUp() { parent::setUp(); $this->table = new Table(['table' => 'articles']); $this->table->primaryKey('id'); $this->behavior = new AuditLogBehavior($this->table, ['whitelist' => ['id', 'title', 'body', 'author_id']]); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); Cache::enable(); $this->_configCache(); Cache::clear(false, 'file_test'); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->now = Time::getTestNow(); $this->locale = Time::$defaultLocale; Time::$defaultLocale = 'en_US'; }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->_appEncoding = Configure::read('App.encoding'); $this->locale = Locale::getDefault(); Locale::setDefault('en_US'); }
public function setUp() { parent::setUp(); $View = new View(); $this->RpgText = new RpgTextHelper($View); // $this->Characters = TableRegistry::get('Characters'); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); $this->View = new View(); $this->_appNamespace = Configure::read('App.namespace'); Configure::write('App.namespace', 'TestApp'); }
/** * setup * * @return void */ public function setUp() { parent::setUp(); $controller = $this->getMock('Cake\\Controller\\Controller', ['redirect']); $this->registry = new ComponentRegistry($controller); $this->component = new CsrfComponent($this->registry); }
/** * setUp method * * @return void */ public function setUp() { parent::setUp(); Configure::write('Acl.classname', __NAMESPACE__ . '\\CachedDbAclTwoTest'); $this->CachedDb = new CachedDbAclTwoTest(); Cache::config('tests', ['engine' => 'File', 'path' => TMP, 'prefix' => 'test_']); }