Code Duplication    Length = 9-15 lines in 2 locations

tests/Doctrine/Tests/DBAL/Types/ConversionExceptionTest.php 1 location

@@ 42-50 (lines=9) @@
39
        );
40
    }
41
42
    public function testConversionFailedFormatPreservesPreviousException()
43
    {
44
        $previous = new \Exception();
45
46
        $exception = ConversionException::conversionFailedFormat('foo', 'bar', 'baz', $previous);
47
48
        self::assertInstanceOf('Doctrine\DBAL\Types\ConversionException', $exception);
49
        self::assertSame($previous, $exception->getPrevious());
50
    }
51
52
    /**
53
     * @return mixed[][]

tests/Doctrine/Tests/DBAL/DBALExceptionTest.php 1 location

@@ 54-68 (lines=15) @@
51
        self::assertSame($ex, $e);
52
    }
53
54
    public function testDriverRequiredWithUrl()
55
    {
56
        $url = 'mysql://localhost';
57
        $exception = DBALException::driverRequired($url);
58
59
        self::assertInstanceOf(DBALException::class, $exception);
60
        self::assertSame(
61
            sprintf(
62
                "The options 'driver' or 'driverClass' are mandatory if a connection URL without scheme " .
63
                'is given to DriverManager::getConnection(). Given URL: %s',
64
                $url
65
            ),
66
            $exception->getMessage()
67
        );
68
    }
69
70
    /**
71
     * @group #2821