/**
  * Modified testing algorithm that allows a single test method to be
  * prefixed with __only in order to make it the only one run.
  */
 function getTests()
 {
     // __onlytest makes only one test get triggered
     foreach (get_class_methods(get_class($this)) as $method) {
         if (strtolower(substr($method, 0, 10)) == '__onlytest') {
             return array($method);
         }
     }
     return parent::getTests();
 }
예제 #2
0
파일: Harness.php 프로젝트: ajnok/yii2book
 public function getTests()
 {
     // __onlytest makes only one test get triggered
     foreach (get_class_methods(get_class($this)) as $method) {
         if (strtolower(substr($method, 0, 10)) == '__onlytest') {
             $this->reporter->paintSkip('All test methods besides ' . $method);
             return array($method);
         }
     }
     return parent::getTests();
 }
예제 #3
0
 /**
  * Gets a list of test names. Normally that will be all internal methods that start with the
  * name "test". This method should be overridden if you want a different rule.
  *
  * @return array List of test names.
  * @access public
  */
 function getTests()
 {
     return array_merge(array('start', 'startCase'), array_diff(parent::getTests(), array('testAction', 'testaction')), array('endCase', 'end'));
 }
예제 #4
0
 /**
  * Gets a list of test names. Normally that will be all internal methods that start with the
  * name "test". This method should be overridden if you want a different rule.
  *
  * @return array	List of test names.
  *
  * @access public
  */
 function getTests()
 {
     $methods = array_diff(parent::getTests(), array('testAction', 'testaction'));
     $methods = array_merge(array_merge(array('start', 'startCase'), $methods), array('endCase', 'end'));
     return $methods;
 }
예제 #5
0
 /**
  * You can use this to only run one test at a time for debugging.
  *
  * @return array
  */
 public function getTests()
 {
     //return array("testVoid");
     return parent::getTests();
 }