1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Doctrine\DBAL\Tests\Driver; |
||
6 | |||
7 | use Doctrine\DBAL\Connection; |
||
8 | use Doctrine\DBAL\Driver; |
||
9 | use Doctrine\DBAL\Driver\AbstractMySQLDriver; |
||
10 | use Doctrine\DBAL\Platforms\AbstractPlatform; |
||
11 | use Doctrine\DBAL\Platforms\MariaDb1027Platform; |
||
12 | use Doctrine\DBAL\Platforms\MySQL57Platform; |
||
13 | use Doctrine\DBAL\Platforms\MySQL80Platform; |
||
14 | use Doctrine\DBAL\Platforms\MySqlPlatform; |
||
15 | use Doctrine\DBAL\Schema\AbstractSchemaManager; |
||
16 | use Doctrine\DBAL\Schema\MySqlSchemaManager; |
||
17 | |||
18 | class AbstractMySQLDriverTest extends AbstractDriverTest |
||
19 | { |
||
20 | protected function createDriver() : Driver |
||
21 | { |
||
22 | return $this->getMockForAbstractClass(AbstractMySQLDriver::class); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
23 | } |
||
24 | |||
25 | protected function createPlatform() : AbstractPlatform |
||
26 | { |
||
27 | return new MySqlPlatform(); |
||
28 | } |
||
29 | |||
30 | protected function createSchemaManager(Connection $connection) : AbstractSchemaManager |
||
31 | { |
||
32 | return new MySqlSchemaManager($connection); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * {@inheritDoc} |
||
37 | */ |
||
38 | protected function getDatabasePlatformsForVersions() : array |
||
39 | { |
||
40 | return [ |
||
41 | ['5.6.9', MySqlPlatform::class], |
||
42 | ['5.7', MySQL57Platform::class], |
||
43 | ['5.7.0', MySqlPlatform::class], |
||
44 | ['5.7.8', MySqlPlatform::class], |
||
45 | ['5.7.9', MySQL57Platform::class], |
||
46 | ['5.7.10', MySQL57Platform::class], |
||
47 | ['8', MySQL80Platform::class], |
||
48 | ['8.0', MySQL80Platform::class], |
||
49 | ['8.0.11', MySQL80Platform::class], |
||
50 | ['6', MySQL57Platform::class], |
||
51 | ['10.0.15-MariaDB-1~wheezy', MySqlPlatform::class], |
||
52 | ['5.5.5-10.1.25-MariaDB', MySqlPlatform::class], |
||
53 | ['10.1.2a-MariaDB-a1~lenny-log', MySqlPlatform::class], |
||
54 | ['5.5.40-MariaDB-1~wheezy', MySqlPlatform::class], |
||
55 | ['5.5.5-MariaDB-10.2.8+maria~xenial-log', MariaDb1027Platform::class], |
||
56 | ['10.2.8-MariaDB-10.2.8+maria~xenial-log', MariaDb1027Platform::class], |
||
57 | ['10.2.8-MariaDB-1~lenny-log', MariaDb1027Platform::class], |
||
58 | ]; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritDoc} |
||
63 | */ |
||
64 | protected static function getExceptionConversionData() : array |
||
65 | { |
||
66 | return [ |
||
67 | self::EXCEPTION_CONNECTION => [ |
||
68 | [1044], |
||
69 | [1045], |
||
70 | [1046], |
||
71 | [1049], |
||
72 | [1095], |
||
73 | [1142], |
||
74 | [1143], |
||
75 | [1227], |
||
76 | [1370], |
||
77 | [2002], |
||
78 | [2005], |
||
79 | ], |
||
80 | self::EXCEPTION_FOREIGN_KEY_CONSTRAINT_VIOLATION => [ |
||
81 | [1216], |
||
82 | [1217], |
||
83 | [1451], |
||
84 | [1452], |
||
85 | ], |
||
86 | self::EXCEPTION_INVALID_FIELD_NAME => [ |
||
87 | [1054], |
||
88 | [1166], |
||
89 | [1611], |
||
90 | ], |
||
91 | self::EXCEPTION_NON_UNIQUE_FIELD_NAME => [ |
||
92 | [1052], |
||
93 | [1060], |
||
94 | [1110], |
||
95 | ], |
||
96 | self::EXCEPTION_NOT_NULL_CONSTRAINT_VIOLATION => [ |
||
97 | [1048], |
||
98 | [1121], |
||
99 | [1138], |
||
100 | [1171], |
||
101 | [1252], |
||
102 | [1263], |
||
103 | [1364], |
||
104 | [1566], |
||
105 | ], |
||
106 | self::EXCEPTION_SYNTAX_ERROR => [ |
||
107 | [1064], |
||
108 | [1149], |
||
109 | [1287], |
||
110 | [1341], |
||
111 | [1342], |
||
112 | [1343], |
||
113 | [1344], |
||
114 | [1382], |
||
115 | [1479], |
||
116 | [1541], |
||
117 | [1554], |
||
118 | [1626], |
||
119 | ], |
||
120 | self::EXCEPTION_TABLE_EXISTS => [ |
||
121 | [1050], |
||
122 | ], |
||
123 | self::EXCEPTION_TABLE_NOT_FOUND => [ |
||
124 | [1051], |
||
125 | [1146], |
||
126 | ], |
||
127 | self::EXCEPTION_UNIQUE_CONSTRAINT_VIOLATION => [ |
||
128 | [1062], |
||
129 | [1557], |
||
130 | [1569], |
||
131 | [1586], |
||
132 | ], |
||
133 | self::EXCEPTION_DEADLOCK => [ |
||
134 | [1213], |
||
135 | ], |
||
136 | self::EXCEPTION_LOCK_WAIT_TIMEOUT => [ |
||
137 | [1205], |
||
138 | ], |
||
139 | ]; |
||
140 | } |
||
141 | } |
||
142 |