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


PHP CakeTestCase::getTests方法代码示例

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


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

示例1: getTests

 /**
  * @brief allow running only some of the tests in the test case
  *
  * Overrides parent method to allow selecting tests to run in the current test case
  * It is useful when working on one particular test
  *
  * @link https://github.com/CakeDC/templates
  * @author Cake Development Corporation
  * @copyright 2005-2011, Cake Development Corporation (http://cakedc.com)
  *
  * @access public
  *
  * @return array List of tests to run
  */
 public function getTests()
 {
     if (!empty($this->tests)) {
         debug('Only the following tests will be executed: ' . join(', ', (array) $this->tests), false, false);
         return array_merge(array('start', 'startCase'), (array) $this->tests, array('endCase', 'end'));
     }
     return parent::getTests();
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:22,代码来源:AppControllerTestCase.php

示例2: getTests

 /**
  * Overrides parent method to allow selecting tests to run in the current test case
  * It is useful when working on one particular test
  *
  * @return array List of tests to run
  */
 public function getTests()
 {
     if (!empty($this->_testsToRun)) {
         debug('Only the following tests will be executed: ' . join(', ', (array) $this->_testsToRun), false, false);
         $result = array_merge(array('start', 'startCase'), (array) $this->_testsToRun, array('endCase', 'end'));
         return $result;
     } else {
         return parent::getTests();
     }
 }
开发者ID:pmoraes,项目名称:templates,代码行数:16,代码来源:AppTestCase.php

示例3: getTests

 /**
  * Overrides `CakeTestCase::getTests()` to allow running a subset of tests within
  * the test case
  *
  * @return array Array of tests to run
  */
 public function getTests()
 {
     $tests = parent::getTests();
     $testMethods = array_udiff($tests, $this->methods, 'strcasecmp');
     if (!isset($this->testMethods) || empty($this->testMethods)) {
         $this->testMethods = $testMethods;
     }
     if (!is_array($this->testMethods)) {
         $this->testMethods = array($this->testMethods);
     }
     if (isset($this->skipSetup) && $this->skipSetup) {
         $tests = array_udiff($tests, array('start', 'end'), 'strcasecmp');
     }
     if (empty($this->testMethods)) {
         return $tests;
     }
     $removeMethods = array_udiff($testMethods, $this->testMethods, 'strcasecmp');
     $tests = array_udiff($tests, $removeMethods, 'strcasecmp');
     $skipped = array_udiff($testMethods, $this->testMethods, 'strcasecmp');
     foreach ($skipped as $skip) {
         $this->_reporter->paintSkip(sprintf(__('Skipped entire test method: %s', true), $skip));
     }
     return $tests;
 }
开发者ID:styfle,项目名称:core,代码行数:30,代码来源:core_test_case.php

示例4: getTests

 /**
  * @brief allow running only some of the tests in the test case
  * 
  * Overrides parent method to allow selecting tests to run in the current test case
  * It is useful when working on one particular test
  *
  * @link https://github.com/CakeDC/templates
  * @author Cake Development Corporation
  * @copyright 2005-2011, Cake Development Corporation (http://cakedc.com)
  *
  * @access public
  *
  * @return array List of tests to run
  */
 public function getTests()
 {
     if (!empty($this->tests)) {
         echo '<pre class="cake-debug">Only the following tests will be executed: ' . join(', ', (array) $this->tests) . '</pre>';
         return array_merge(array('start', 'startCase'), (array) $this->tests, array('endCase', 'end'));
     }
     return parent::getTests();
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:22,代码来源:AppHelperTestCase.php


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