File: ExceptionTest.php

package info (click to toggle)
php-doctrine-dbal 4.3.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,092 kB
  • sloc: php: 60,293; xml: 618; makefile: 23
file content (28 lines) | stat: -rw-r--r-- 683 bytes parent folder | download | duplicates (2)
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(),
        );
    }
}