Inheritance: implements mageekguy\atoum\asserter\definition
コード例 #1
0
ファイル: variable.php プロジェクト: andrewolobo/mpTracker
 public function setWith($value)
 {
     parent::setWith($value);
     $this->value = $value;
     $this->isSet = true;
     $this->isSetByReference = false;
     return $this;
 }
コード例 #2
0
 protected function fail($reason)
 {
     try {
         parent::fail($reason);
     } catch (asserter\exception $exception) {
         throw new test\exceptions\skip($reason);
     }
 }
コード例 #3
0
ファイル: invoking.php プロジェクト: atoum/bdd-extension
 public function setWithTest(atoum\test $test)
 {
     $this->reset();
     $this->test = $test;
     $this->testedClassName = $test->getTestedClassName();
     $this->phpClass->setWith($this->testedClassName);
     return parent::setWithTest($test);
 }
コード例 #4
0
ファイル: prophet.php プロジェクト: atoum/prophecy-extension
 public function __get($property)
 {
     switch ($property) {
         case 'checkPredictions':
             return $this->checkPredictions();
         default:
             return parent::__get($property);
     }
 }
コード例 #5
0
ファイル: extension.php プロジェクト: xihewang/atoum
 public function __get($asserter)
 {
     switch (strtolower($asserter)) {
         case 'isloaded':
             return $this->{$asserter}();
         default:
             return parent::__get($asserter);
     }
 }
コード例 #6
0
ファイル: call.php プロジェクト: andrewolobo/mpTracker
 public function __construct(asserter\generator $generator = null)
 {
     parent::__construct($generator);
     $this->call = new test\adapter\call();
     if (self::$instances === null) {
         self::$instances = new \splObjectStorage();
     }
     self::$instances->attach($this);
 }
コード例 #7
0
ファイル: phpClass.php プロジェクト: ronan-gloo/atoum
 public function __call($method, $arguments)
 {
     switch (strtolower($method)) {
         case 'extends':
             return call_user_func_array(array($this, 'isSubClassOf'), $arguments);
         case 'implements':
             return call_user_func_array(array($this, 'hasInterface'), $arguments);
         default:
             return parent::__call($method, $arguments);
     }
 }
コード例 #8
0
ファイル: phpClass.php プロジェクト: xihewang/atoum
 public function setWith($class)
 {
     parent::setWith($class);
     try {
         $this->class = $this->getReflectionClass($class);
     } catch (\exception $exception) {
         $this->fail($this->_('Class \'%s\' does not exist', $class));
     }
     $this->pass();
     return $this;
 }
コード例 #9
0
 /**
  * @param string $method
  * @param array $arguments
  *
  * @return $this|mixed
  */
 public function __call($method, $arguments)
 {
     switch ($method) {
         case 'defineMetric':
         case 'defineLayer':
         case 'assert':
             call_user_func_array(array($this->configuration, $method), $arguments);
             return $this;
         default:
             return parent::__call($method, $arguments);
     }
 }
コード例 #10
0
ファイル: exception.php プロジェクト: xihewang/atoum
 public function __construct(atoum\asserter $asserter, $message)
 {
     $code = 0;
     $test = $asserter->getTest();
     if ($test !== null) {
         $class = $test->getClass();
         $method = $test->getCurrentMethod();
         $file = $test->getPath();
         $line = null;
         $function = null;
         foreach (array_filter(debug_backtrace(false), function ($backtrace) use($file) {
             return isset($backtrace['file']) === true && $backtrace['file'] === $file;
         }) as $backtrace) {
             if ($line === null && isset($backtrace['line']) === true) {
                 $line = $backtrace['line'];
             }
             if ($function === null && isset($backtrace['object']) === true && isset($backtrace['function']) === true && $backtrace['object'] === $asserter && $backtrace['function'] !== '__call') {
                 $function = $backtrace['function'];
             }
         }
         $code = $test->getScore()->addFail($file, $class, $method, $line, get_class($asserter) . ($function ? '::' . $function : '') . '()', $message);
     }
     parent::__construct($message, $code);
 }
コード例 #11
0
ファイル: extension.php プロジェクト: ronan-gloo/atoum
 public function __construct(atoum\asserter\generator $generator)
 {
     parent::__construct($generator);
     $this->setAdapter();
 }
コード例 #12
0
ファイル: Asserter.php プロジェクト: jubianchi/PHPSandbox
 public function __construct(Model\Specification $specification = null, atoum\asserter\generator $generator = null)
 {
     $this->setSpecification($specification);
     parent::__construct($generator);
 }
コード例 #13
0
ファイル: extension.php プロジェクト: andrewolobo/mpTracker
 public function __construct(atoum\asserter\generator $generator = null, atoum\adapter $adapter = null)
 {
     parent::__construct($generator);
     $this->setAdapter($adapter);
 }
コード例 #14
0
ファイル: error.php プロジェクト: andrewolobo/mpTracker
 public function __construct(atoum\asserter\generator $generator = null, atoum\test\score $score = null)
 {
     parent::__construct($generator);
     $this->setScore($score);
 }
コード例 #15
0
ファイル: constant.php プロジェクト: xihewang/atoum
 public function reset()
 {
     $this->value = null;
     $this->isSet = false;
     return parent::reset();
 }
コード例 #16
0
ファイル: error.php プロジェクト: atoum/atoum
 public function setWithTest(test $test)
 {
     $this->setScore($test->getScore());
     return parent::setWithTest($test);
 }
コード例 #17
0
ファイル: stream.php プロジェクト: andrewolobo/mpTracker
 public function setWith($stream)
 {
     parent::setWith($stream);
     $this->streamController = atoum\mock\stream::get($stream);
     return $this;
 }
コード例 #18
0
ファイル: call.php プロジェクト: xihewang/atoum
 public function setWithTest(test $test)
 {
     $this->setManager($test->getAsserterCallManager());
     return parent::setWithTest($test);
 }