PHPUnit_Framework_ExceptionWrapper::__construct PHP Method

__construct() public method

public __construct ( Throwable $t )
$t Throwable
    public function __construct(Throwable $t)
    {
        // PDOException::getCode() is a string.
        // @see http://php.net/manual/en/class.pdoexception.php#95812
        parent::__construct($t->getMessage(), (int) $t->getCode());
        $this->classname = get_class($t);
        $this->file = $t->getFile();
        $this->line = $t->getLine();
        $this->serializableTrace = $t->getTrace();
        foreach ($this->serializableTrace as $i => $call) {
            unset($this->serializableTrace[$i]['args']);
        }
        if ($t->getPrevious()) {
            $this->previous = new self($t->getPrevious());
        }
    }

Usage Example

Example #1
0
 public function __construct(CM_Exception $e)
 {
     parent::__construct($e);
     $formatter = new CM_ExceptionHandling_Formatter_Plain();
     $serializedException = new CM_ExceptionHandling_SerializableException($e);
     $this->message = get_class($e) . ': ' . $e->getMessage() . PHP_EOL . $formatter->getMetaInfo($serializedException);
 }
All Usage Examples Of PHPUnit_Framework_ExceptionWrapper::__construct