You are here

public function PHPUnit_Framework_ExceptionWrapper::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php \PHPUnit_Framework_ExceptionWrapper::__construct()

Parameters

Throwable|Exception $e:

Overrides PHPUnit_Framework_Exception::__construct

File

vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php, line 37

Class

PHPUnit_Framework_ExceptionWrapper
Wraps Exceptions thrown by code under test.

Code

public function __construct($e) {

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