1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Tests;
use Doctrine\DBAL\Exception\DriverRequired;
use PHPUnit\Framework\TestCase;
use function sprintf;
class ExceptionTest extends TestCase
{
public function testDriverRequiredWithUrl(): void
{
$url = 'mysql://localhost';
$exception = DriverRequired::new($url);
self::assertSame(
sprintf(
'The options "driver" or "driverClass" are mandatory if a connection URL without scheme ' .
'is given to DriverManager::getConnection(). Given URL "%s".',
$url,
),
$exception->getMessage(),
);
}
}
|