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;
}