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