• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CakeTestCase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CakeTestCase的典型用法代码示例。如果您正苦于以下问题:PHP CakeTestCase类的具体用法?PHP CakeTestCase怎么用?PHP CakeTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CakeTestCase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: login

 /**
  * Login as given roles
  *
  * @param CakeTestCase $test CakeTestCase instance
  * @param string $role role key
  * @return void
  */
 public static function login(CakeTestCase $test, $role = Role::ROLE_KEY_SYSTEM_ADMINISTRATOR)
 {
     $test->controller->Components->Auth->staticExpects($test->any())->method('user')->will($test->returnCallback(function ($key = null) use($role) {
         CakeSession::write('Auth.User', self::$roles[$role]);
         if (isset(self::$roles[$role][$key])) {
             return self::$roles[$role][$key];
         } else {
             return self::$roles[$role];
         }
     }));
     $test->controller->Components->Auth->login(['username' => self::$roles[$role]['username'], 'password' => self::$roles[$role]['password']]);
 }
开发者ID:Onasusweb,项目名称:Roles,代码行数:19,代码来源:RolesControllerTest.php


示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $Controller = new Controller();
     $View = new View($Controller);
     $this->Progress = new ProgressHelper($View);
 }
开发者ID:himeno,项目名称:cakephp_unittest,代码行数:7,代码来源:ProgressHelperTest.php


示例3: tearDown

 /**
  * End a test
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     unset($this->Article);
     ClassRegistry::flush();
     DebugKitDebugger::clearTimers();
 }
开发者ID:hupla78,项目名称:Nadia,代码行数:12,代码来源:TimedBehaviorTest.php


示例4: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->Time = new CakeTime();
     $this->_systemTimezoneIdentifier = date_default_timezone_get();
     Configure::write('Config.language', 'eng');
 }
开发者ID:terriblyuncreative,项目名称:moviedb,代码行数:12,代码来源:CakeTimeTest.php


示例5: tearDown

 /**
  * Method executed after each test
  *
  */
 public function tearDown()
 {
     unset($this->Article);
     unset($this->User);
     unset($this->Tag);
     parent::tearDown();
 }
开发者ID:manzapanza,项目名称:cakephp-api-utils,代码行数:11,代码来源:ContainableBehaviorTest.php


示例6: tearDown

/**
 * tearDown method
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		Configure::write('Cache.disable', $this->_cacheDisable);
		Cache::drop('xcache');
		Cache::drop('xcache_groups');
		Cache::config('default');
	}
开发者ID:hungnt88,项目名称:5stars-1,代码行数:12,代码来源:XcacheEngineTest.php


示例7: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     $_SESSION = array();
     unset($this->View, $this->Session);
     CakePlugin::unload();
     parent::tearDown();
 }
开发者ID:agashish,项目名称:test_new,代码行数:12,代码来源:SessionHelperTest.php


示例8: tearDown

 /**
  * tearDown()
  *
  * @return void
  */
 public function tearDown()
 {
     if (file_exists($this->Task->bootstrap)) {
         unlink($this->Task->bootstrap);
     }
     parent::tearDown();
 }
开发者ID:4Queen,项目名称:php-buildpack,代码行数:12,代码来源:PluginTaskTest.php


示例9: tearDown

 public function tearDown()
 {
     Cache::delete(UrlCacheManager::$cacheKey, '_cake_core_');
     Cache::delete(UrlCacheManager::$cachePageKey, '_cake_core_');
     Configure::delete('UrlCache');
     parent::tearDown();
 }
开发者ID:Jony01,项目名称:LLD,代码行数:7,代码来源:MyHelperUrlCacheTest.php


示例10: setUp

 /**
  * setUp
  *
  * @retun void
  * @access public
  */
 function setUp()
 {
     parent::setUp();
     $this->Formatacao = new FormatacaoHelper();
     $this->Formatacao->Time = new TimeHelper();
     $this->Formatacao->Number = new NumberHelper();
 }
开发者ID:ricardoard12,项目名称:liber,代码行数:13,代码来源:formatacao.test.php


示例11: setUp

 /**
  * setup test
  *
  * @return void
  */
 public function setUp()
 {
     $this->out = $this->getMock('ConsoleOutput', array(), array(), '', false);
     $this->in = $this->getMock('ConsoleInput', array(), array(), '', false);
     $this->Shell = $this->getMock('TranslationsShell', array('in', 'out', 'hr', 'err', '_stop', '_getModels'), array($this->out, $this->out, $this->in));
     parent::setUp();
 }
开发者ID:nodesagency,项目名称:Platform-Crud-Plugin,代码行数:12,代码来源:TranslationsShellTest.php


示例12: tearDown

 /**
  * endTest
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     unset($this->Article);
     unset($this->Post);
     ClassRegistry::flush();
 }
开发者ID:jxav,项目名称:ratings,代码行数:12,代码来源:RatableBehaviorTest.php


示例13: setUp

 public function setUp()
 {
     parent::setUp();
     $Controller = new Controller();
     $View = new View($Controller);
     $this->Tab = new BootstrapTabHelper($View);
 }
开发者ID:cwbit,项目名称:cakephp-bootstrap-suite,代码行数:7,代码来源:BootstrapTabHelperTest.php


示例14: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->Game);
     // Supprimer le fichier chargé
     @unlink(WWW_ROOT . 'img' . DS . 'uploads' . DS . 'TestFile.png');
     parent::tearDown();
 }
开发者ID:danielhebert,项目名称:tp3DanielHebert,代码行数:12,代码来源:GameTest.php


示例15: setUp

 /**
  * setUp
  *
  * @retun void
  * @access public
  */
 public function setUp()
 {
     parent::setUp();
     $this->Controller = new Controller(null);
     $this->View = new View($this->Controller);
     $this->Locale = new LocaleHelper($this->View, array('locale' => 'pt_BR'));
 }
开发者ID:radig,项目名称:locale,代码行数:13,代码来源:LocaleHelperTest.php


示例16: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     $Folder = new Folder($this->Task->path . 'bake_test_app');
     $Folder->delete();
     unset($this->Task);
 }
开发者ID:SebFav,项目名称:ApplicationInternet2,代码行数:12,代码来源:ProjectTaskTest.php


示例17: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->Task);
     ClassRegistry::flush();
     App::build();
     parent::tearDown();
 }
开发者ID:Chromedian,项目名称:inventory,代码行数:12,代码来源:ControllerTaskTest.php


示例18: tearDown

/**
 * tearDown method
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		Configure::write('log', true);
		if ($this->_restoreError) {
			restore_error_handler();
		}
	}
开发者ID:hungnt88,项目名称:5stars-1,代码行数:12,代码来源:DebuggerTest.php


示例19: setUp

 public function setUp()
 {
     parent::setUp();
     Configure::delete('Ajax');
     $this->Controller = new AjaxComponentTestController(new CakeRequest(), new CakeResponse());
     $this->Controller->constructClasses();
 }
开发者ID:Jony01,项目名称:LLD,代码行数:7,代码来源:AjaxComponentTest.php


示例20: tearDown

/**
 * tearDown
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		if (!empty($this->_case)) {
			$_GET['case'] = $this->_case;
		}
		Configure::write('App', $this->_app);
	}
开发者ID:hungnt88,项目名称:5stars-1,代码行数:12,代码来源:CakeRequestTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CakeTestFixture类代码示例发布时间:2022-05-20
下一篇:
PHP CakeSocket类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap