/** * @covers Veles\DataBase\Exceptions\DbException::__construct * * @param string $message * @param string $ansi_code * @param int $code * @param \PDOException $exception * * @dataProvider constructProvider */ public function testConstruct($message, $ansi_code, $code, $exception) { $obj = new DbException($exception->getMessage(), (int) $exception->getCode(), $exception); $result = $obj->getMessage(); $msg = 'Wrong DbException::__construct() behavior!'; $this->assertSame($message, $result, $msg); $result = $obj->getAnsiCode(); $msg = 'Wrong DbException::__construct() behavior!'; $this->assertSame($ansi_code, $result, $msg); $result = $obj->getCode(); $msg = 'Wrong DbException::__construct() behavior!'; $this->assertSame($code, $result, $msg); }