當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CakeTestCase類代碼示例

本文整理匯總了PHP中CakeTestCase的典型用法代碼示例。如果您正苦於以下問題:PHP CakeTestCase類的具體用法?PHP CakeTestCase怎麽用?PHP CakeTestCase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CakeTestCase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的CakeTestCase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。