tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php 1 location
|
@@ 43-51 (lines=9) @@
|
40 |
|
); |
41 |
|
} |
42 |
|
|
43 |
|
public function testConversionFailedFormatPreservesPreviousException() |
44 |
|
{ |
45 |
|
$previous = new \Exception(); |
46 |
|
|
47 |
|
$exception = ConversionException::conversionFailedFormat('foo', 'bar', 'baz', $previous); |
48 |
|
|
49 |
|
$this->assertInstanceOf('Doctrine\DBAL\Types\ConversionException', $exception); |
50 |
|
$this->assertSame($previous, $exception->getPrevious()); |
51 |
|
} |
52 |
|
|
53 |
|
/** |
54 |
|
* @return mixed[][] |
tests/Doctrine/Tests/DBAL/DBALExceptionTest.php 1 location
|
@@ 46-60 (lines=15) @@
|
43 |
|
$this->assertSame($ex, $e); |
44 |
|
} |
45 |
|
|
46 |
|
public function testDriverRequiredWithUrl() |
47 |
|
{ |
48 |
|
$url = 'mysql://localhost'; |
49 |
|
$exception = DBALException::driverRequired($url); |
50 |
|
|
51 |
|
$this->assertInstanceOf(DBALException::class, $exception); |
52 |
|
$this->assertSame( |
53 |
|
sprintf( |
54 |
|
"The options 'driver' or 'driverClass' are mandatory if a connection URL without scheme " . |
55 |
|
'is given to DriverManager::getConnection(). Given URL: %s', |
56 |
|
$url |
57 |
|
), |
58 |
|
$exception->getMessage() |
59 |
|
); |
60 |
|
} |
61 |
|
} |
62 |
|
|