mageekguy\atoum\asserters\object::setWith PHP Метод

setWith() публичный Метод

public setWith ( $value, $checkType = true )
    public function setWith($value, $checkType = true)
    {
        parent::setWith($value);
        if ($checkType === true) {
            if ($this->analyzer->isObject($this->value) === true) {
                $this->pass();
            } else {
                $this->fail($this->_('%s is not an object', $this));
            }
        }
        return $this;
    }

Usage Example

Пример #1
0
 public function setWith($value, $checkType = true)
 {
     $exception = $value;
     if ($exception instanceof \closure) {
         $exception = null;
         if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
             try {
                 $value($this->getTest());
             } catch (\throwable $exception) {
             }
         } else {
             try {
                 $value($this->getTest());
             } catch (\exception $exception) {
             }
         }
     }
     parent::setWith($exception, false);
     if ($checkType === true) {
         if (self::isThrowable($exception) === false) {
             $this->fail($this->_('%s is not an exception', $this));
         } else {
             $this->pass();
             static::$lastValue = $exception;
         }
     }
     return $this;
 }
All Usage Examples Of mageekguy\atoum\asserters\object::setWith