Unverified Commit 9f1c1581 authored by Tomáš Holan's avatar Tomáš Holan Committed by GitHub

Added test case for resource as parameter

Added test case for PHP Resource as parameter in Driver exception
parent a4d7acdf
...@@ -18,6 +18,14 @@ class DBALExceptionTest extends DbalTestCase ...@@ -18,6 +18,14 @@ class DBALExceptionTest extends DbalTestCase
self::assertContains('with params ["ABC", "\x80"]', $e->getMessage()); self::assertContains('with params ["ABC", "\x80"]', $e->getMessage());
} }
public function testDriverExceptionDuringQueryAcceptsResource()
{
/* @var $driver Driver */
$driver = $this->createMock(Driver::class);
$e = \Doctrine\DBAL\DBALException::driverExceptionDuringQuery($driver, new \Exception, "INSERT INTO file (`content`) VALUES (?)", [1 => tmpfile()]);
self::assertContains('Resource', $e->getMessage());
}
public function testAvoidOverWrappingOnDriverException() public function testAvoidOverWrappingOnDriverException()
{ {
/* @var $driver Driver */ /* @var $driver Driver */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment