@@ -23,6 +23,26 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb
23
23
*/
24
24
public const MARIADB_MIN_VERSION = '11.4. ' ;
25
25
26
+ /**
27
+ * MariaDB command.
28
+ */
29
+ public const MARIADB_COMMAND = 'mariadb ' ;
30
+
31
+ /**
32
+ * MariaDB Dump command.
33
+ */
34
+ public const MARIADB_DUMP_COMMAND = 'mariadb-dump ' ;
35
+
36
+ /**
37
+ * Mysql command.
38
+ */
39
+ public const MYSQL_COMMAND = 'mysql ' ;
40
+
41
+ /**
42
+ * Mysql Dump command.
43
+ */
44
+ public const MYSQL_DUMP_COMMAND = 'mysqldump ' ;
45
+
26
46
/**
27
47
* Name of configuration file.
28
48
*/
@@ -270,7 +290,7 @@ private function isMariaDB(): bool
270
290
try {
271
291
if (!isset ($ this ->isMariaDB )) {
272
292
$ version = $ this ->_shell ->execute (
273
- ' mariadb-dump --version '
293
+ self :: MARIADB_DUMP_COMMAND . ' --version '
274
294
);
275
295
$ pattern = "/((?:[0-9]+\.?)+)(.*?)(mariadb)/i " ;
276
296
preg_match ($ pattern , $ version !== null ? $ version : '' , $ matches );
@@ -297,7 +317,7 @@ private function isMariaDB(): bool
297
317
*/
298
318
protected function getDbCommand ()
299
319
{
300
- return $ this ->isMariaDB () ? ' mariadb ' : ' mysql ' ;
320
+ return $ this ->isMariaDB () ? self :: MARIADB_COMMAND : self :: MYSQL_COMMAND ;
301
321
}
302
322
303
323
/**
@@ -307,6 +327,6 @@ protected function getDbCommand()
307
327
*/
308
328
protected function getDbDumpCommand ()
309
329
{
310
- return $ this ->isMariaDB () ? ' mariadb-dump ' : ' mysqldump ' ;
330
+ return $ this ->isMariaDB () ? self :: MARIADB_DUMP_COMMAND : self :: MYSQL_DUMP_COMMAND ;
311
331
}
312
332
}
0 commit comments