You are here

class MockPdo in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\MockPdo

Hierarchy

  • class \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\MockPdo extends \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\PDO

Expanded class hierarchy of MockPdo

File

vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php, line 324

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler
View source
class MockPdo extends \PDO {
  public $prepareResult;
  private $driverName;
  private $errorMode;
  public function __construct($driverName = null, $errorMode = null) {
    $this->driverName = $driverName;
    $this->errorMode = null !== $errorMode ?: \PDO::ERRMODE_EXCEPTION;
  }
  public function getAttribute($attribute) {
    if (\PDO::ATTR_ERRMODE === $attribute) {
      return $this->errorMode;
    }
    if (\PDO::ATTR_DRIVER_NAME === $attribute) {
      return $this->driverName;
    }
    return parent::getAttribute($attribute);
  }
  public function prepare($statement, $driverOptions = array()) {
    return is_callable($this->prepareResult) ? call_user_func($this->prepareResult, $statement, $driverOptions) : $this->prepareResult;
  }
  public function beginTransaction() {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MockPdo::$driverName private property
MockPdo::$errorMode private property
MockPdo::$prepareResult public property
MockPdo::beginTransaction public function
MockPdo::getAttribute public function
MockPdo::prepare public function
MockPdo::__construct public function