|
@@ 13-19 (lines=7) @@
|
| 10 |
|
|
| 11 |
|
class DBALExceptionTest extends DbalTestCase |
| 12 |
|
{ |
| 13 |
|
public function testDriverExceptionDuringQueryAcceptsBinaryData() |
| 14 |
|
{ |
| 15 |
|
/* @var $driver Driver */ |
| 16 |
|
$driver = $this->createMock(Driver::class); |
| 17 |
|
$e = DBALException::driverExceptionDuringQuery($driver, new \Exception, '', array('ABC', chr(128))); |
| 18 |
|
self::assertContains('with params ["ABC", "\x80"]', $e->getMessage()); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function testDriverExceptionDuringQueryAcceptsResource() |
| 22 |
|
{ |
|
@@ 21-27 (lines=7) @@
|
| 18 |
|
self::assertContains('with params ["ABC", "\x80"]', $e->getMessage()); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function testDriverExceptionDuringQueryAcceptsResource() |
| 22 |
|
{ |
| 23 |
|
/* @var $driver Driver */ |
| 24 |
|
$driver = $this->createMock(Driver::class); |
| 25 |
|
$e = \Doctrine\DBAL\DBALException::driverExceptionDuringQuery($driver, new \Exception, "INSERT INTO file (`content`) VALUES (?)", [1 => fopen(__FILE__, 'r')]); |
| 26 |
|
self::assertContains('Resource', $e->getMessage()); |
| 27 |
|
} |
| 28 |
|
|
| 29 |
|
public function testAvoidOverWrappingOnDriverException() |
| 30 |
|
{ |