本文整理汇总了PHP中Cake\TestSuite\TestCase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP TestCase::setUp方法的具体用法?PHP TestCase::setUp怎么用?PHP TestCase::setUp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\TestSuite\TestCase
的用法示例。
在下文中一共展示了TestCase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* 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]);
}
示例2: setUp
public function setUp()
{
parent::setUp();
$this->table = TableRegistry::get('NumberTrees');
$this->table->primaryKey(['id']);
$this->table->addBehavior('Tree');
}
示例3: setUp
/**
* 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');
}
示例4: setUp
/**
* 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']);
}
示例5: setUp
/**
* 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']);
}
示例6: setUp
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();
}
示例7: setUp
/**
* 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;
}
示例8: setUp
/**
* 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();
}
示例9: setUp
/**
* 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);
}
示例10: setUp
/**
* 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();
}
示例11: setUp
/**
* Setup
*
* @return void
*/
public function setUp()
{
parent::setUp();
Cache::clear(false);
$this->apiFolderName = 'NonExistingApiPrefixedFolder';
$this->apiFolderPath = APP . 'Controller' . DS . $this->apiFolderName;
}
示例12: setUp
/**
* 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();
}
示例13: setUp
/**
* 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');
}
示例14: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
Router::reload();
Router::connect('/:controller', ['action' => 'index']);
Router::connect('/:controller/:action/*');
}
示例15: setUp
/**
* 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;
}