当前位置: 首页>>代码示例>>PHP>>正文


PHP TestCase::setUp方法代码示例

本文整理汇总了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]);
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:CounterCacheBehaviorTest.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $this->table = TableRegistry::get('NumberTrees');
     $this->table->primaryKey(['id']);
     $this->table->addBehavior('Tree');
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:7,代码来源:TreeBehaviorTest.php

示例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');
 }
开发者ID:surjit,项目名称:cakephp-geo,代码行数:12,代码来源:GeocoderBehaviorTest.php

示例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']);
 }
开发者ID:neilan35,项目名称:betterwindow1,代码行数:12,代码来源:BelongsToTest.php

示例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']);
 }
开发者ID:JesseDarellMoore,项目名称:CS499,代码行数:12,代码来源:HasOneTest.php

示例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();
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:7,代码来源:ButtonWidgetTest.php

示例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;
 }
开发者ID:gintonicweb,项目名称:reorder,代码行数:12,代码来源:ReorderBehaviorTest.php

示例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();
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:12,代码来源:ShellDispatcherTest.php

示例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);
 }
开发者ID:KarimaLadhani,项目名称:cakephp,代码行数:12,代码来源:SelectBoxWidgetTest.php

示例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();
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:12,代码来源:AppViewTest.php

示例11: setUp

 /**
  * Setup
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Cache::clear(false);
     $this->apiFolderName = 'NonExistingApiPrefixedFolder';
     $this->apiFolderPath = APP . 'Controller' . DS . $this->apiFolderName;
 }
开发者ID:alt3,项目名称:cakephp-app-configurator,代码行数:12,代码来源:PlusPlusTest.php

示例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();
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:12,代码来源:AssetsTaskTest.php

示例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');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:ConsoleErrorHandlerTest.php

示例14: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Router::reload();
     Router::connect('/:controller', ['action' => 'index']);
     Router::connect('/:controller/:action/*');
 }
开发者ID:jdaosavanh,项目名称:clickerwebapp,代码行数:12,代码来源:RedirectRouteTest.php

示例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;
 }
开发者ID:OrigamiStructures,项目名称:users,代码行数:12,代码来源:LoginTraitTest.php


注:本文中的Cake\TestSuite\TestCase::setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。