1 | <?php |
||
2 | |||
3 | namespace Doctrine\Tests\DBAL\Driver\DrizzlePDOMySql; |
||
4 | |||
5 | use Doctrine\DBAL\Connection; |
||
6 | use Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver; |
||
7 | use Doctrine\DBAL\Platforms\DrizzlePlatform; |
||
8 | use Doctrine\DBAL\Schema\DrizzleSchemaManager; |
||
9 | use Doctrine\Tests\DBAL\Driver\PDOMySql\DriverTest as PDOMySQLDriverTest; |
||
10 | |||
11 | class DriverTest extends PDOMySQLDriverTest |
||
12 | { |
||
13 | public function testReturnsName() |
||
14 | { |
||
15 | self::assertSame('drizzle_pdo_mysql', $this->driver->getName()); |
||
16 | } |
||
17 | |||
18 | public function testThrowsExceptionOnCreatingDatabasePlatformsForInvalidVersion() |
||
19 | { |
||
20 | $this->markTestSkipped('This test does not work on Drizzle as it is not version aware.'); |
||
21 | } |
||
22 | |||
23 | protected function createDriver() |
||
24 | { |
||
25 | return new Driver(); |
||
26 | } |
||
27 | |||
28 | protected function createPlatform() |
||
29 | { |
||
30 | return new DrizzlePlatform(); |
||
31 | } |
||
32 | |||
33 | protected function createSchemaManager(Connection $connection) |
||
34 | { |
||
35 | return new DrizzleSchemaManager($connection); |
||
36 | } |
||
37 | |||
38 | View Code Duplication | protected function getDatabasePlatformsForVersions() : array |
|
0 ignored issues
–
show
|
|||
39 | { |
||
40 | return [ |
||
41 | ['foo', 'Doctrine\DBAL\Platforms\DrizzlePlatform'], |
||
42 | ['bar', 'Doctrine\DBAL\Platforms\DrizzlePlatform'], |
||
43 | ['baz', 'Doctrine\DBAL\Platforms\DrizzlePlatform'], |
||
44 | ]; |
||
45 | } |
||
46 | } |
||
47 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.