Inheritance: implements mageekguy\atoum\asserter\definition
Beispiel #1
0
 public function setWith($value)
 {
     parent::setWith($value);
     $this->value = $value;
     $this->isSet = true;
     $this->isSetByReference = false;
     return $this;
 }
 protected function fail($reason)
 {
     try {
         parent::fail($reason);
     } catch (asserter\exception $exception) {
         throw new test\exceptions\skip($reason);
     }
 }
Beispiel #3
0
 public function setWithTest(atoum\test $test)
 {
     $this->reset();
     $this->test = $test;
     $this->testedClassName = $test->getTestedClassName();
     $this->phpClass->setWith($this->testedClassName);
     return parent::setWithTest($test);
 }
Beispiel #4
0
 public function __get($property)
 {
     switch ($property) {
         case 'checkPredictions':
             return $this->checkPredictions();
         default:
             return parent::__get($property);
     }
 }
Beispiel #5
0
 public function __get($asserter)
 {
     switch (strtolower($asserter)) {
         case 'isloaded':
             return $this->{$asserter}();
         default:
             return parent::__get($asserter);
     }
 }
Beispiel #6
0
 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);
 }
Beispiel #7
0
 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);
     }
 }
Beispiel #8
0
 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;
 }
 /**
  * @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);
     }
 }
Beispiel #10
0
 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);
 }
Beispiel #11
0
 public function __construct(atoum\asserter\generator $generator)
 {
     parent::__construct($generator);
     $this->setAdapter();
 }
Beispiel #12
0
 public function __construct(Model\Specification $specification = null, atoum\asserter\generator $generator = null)
 {
     $this->setSpecification($specification);
     parent::__construct($generator);
 }
Beispiel #13
0
 public function __construct(atoum\asserter\generator $generator = null, atoum\adapter $adapter = null)
 {
     parent::__construct($generator);
     $this->setAdapter($adapter);
 }
Beispiel #14
0
 public function __construct(atoum\asserter\generator $generator = null, atoum\test\score $score = null)
 {
     parent::__construct($generator);
     $this->setScore($score);
 }
Beispiel #15
0
 public function reset()
 {
     $this->value = null;
     $this->isSet = false;
     return parent::reset();
 }
Beispiel #16
0
 public function setWithTest(test $test)
 {
     $this->setScore($test->getScore());
     return parent::setWithTest($test);
 }
Beispiel #17
0
 public function setWith($stream)
 {
     parent::setWith($stream);
     $this->streamController = atoum\mock\stream::get($stream);
     return $this;
 }
Beispiel #18
0
 public function setWithTest(test $test)
 {
     $this->setManager($test->getAsserterCallManager());
     return parent::setWithTest($test);
 }