Skip to content

Commit 891c407

Browse files
Fix xtrabackup 8 tests
1 parent 0b01cbc commit 891c407

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

tests/phpbu/Backup/Source/XtraBackup8Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testDefault()
3333
$xtrabackup->setup(['pathToXtraBackup' => PHPBU_TEST_BIN]);
3434

3535
$executable = $xtrabackup->getExecutable($target);
36-
$expectedDump = 'xtrabackup" --backup \'./dump\'';
36+
$expectedDump = 'xtrabackup" --backup --target-dir=\'./dump\'';
3737
$expected = '"' . PHPBU_TEST_BIN . '/' . $expectedDump;
3838

3939
$this->assertEquals($expected, $executable->getCommand());
@@ -50,7 +50,7 @@ public function testDataDir()
5050
$xtrabackup->setup(['pathToXtraBackup' => PHPBU_TEST_BIN, 'dataDir' => '/x/mysql']);
5151

5252
$executable = $xtrabackup->getExecutable($target);
53-
$expectedDump = 'xtrabackup" --backup --datadir=\'/x/mysql\' \'./dump\'';
53+
$expectedDump = 'xtrabackup" --backup --datadir=\'/x/mysql\' --target-dir=\'./dump\'';
5454
$expected = '"' . PHPBU_TEST_BIN . '/' . $expectedDump;
5555

5656
$this->assertEquals($expected, $executable->getCommand());
@@ -67,7 +67,7 @@ public function testDatabases()
6767
$xtrabackup->setup(['pathToXtraBackup' => PHPBU_TEST_BIN, 'databases' => 'db1,db2,db3.table1']);
6868

6969
$executable = $xtrabackup->getExecutable($target);
70-
$expectedDump = 'xtrabackup" --backup --databases=\'db1 db2 db3.table1\' \'./dump\'';
70+
$expectedDump = 'xtrabackup" --backup --databases=\'db1 db2 db3.table1\' --target-dir=\'./dump\'';
7171
$expected = '"' . PHPBU_TEST_BIN . '/' . $expectedDump;
7272

7373
$this->assertEquals($expected, $executable->getCommand());

tests/phpbu/Cli/Executable/Xtrabackup8Test.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Xtrabackup8Test extends TestCase
2121
*/
2222
public function testDefault()
2323
{
24-
$expectedDump = 'xtrabackup" --backup \'./dump\'';
24+
$expectedDump = 'xtrabackup" --backup --target-dir=\'./dump\'';
2525
$expected = '"' . PHPBU_TEST_BIN . '/' . $expectedDump;
2626
$xtra = new Xtrabackup8(PHPBU_TEST_BIN);
2727
$xtra->dumpTo('./dump');
@@ -34,7 +34,7 @@ public function testDefault()
3434
*/
3535
public function testDataDir()
3636
{
37-
$expectedDump = 'xtrabackup" --backup --datadir=\'/foo/bar\' \'./dump\'';
37+
$expectedDump = 'xtrabackup" --backup --datadir=\'/foo/bar\' --target-dir=\'./dump\'';
3838
$expected = '"' . PHPBU_TEST_BIN . '/' . $expectedDump;
3939
$xtra = new Xtrabackup8(PHPBU_TEST_BIN);
4040
$xtra->dumpFrom('/foo/bar')->dumpTo('./dump');
@@ -57,7 +57,7 @@ public function testFailNoDumpDir()
5757
*/
5858
public function testUser()
5959
{
60-
$expectedDump = 'xtrabackup" --backup --user=\'root\' \'./dump\'';
60+
$expectedDump = 'xtrabackup" --backup --user=\'root\' --target-dir=\'./dump\'';
6161
$expected = '"' . PHPBU_TEST_BIN . '/' . $expectedDump;
6262
$xtra = new Xtrabackup8(PHPBU_TEST_BIN);
6363
$xtra->credentials('root')->dumpTo('./dump');
@@ -70,7 +70,7 @@ public function testUser()
7070
*/
7171
public function testPassword()
7272
{
73-
$expectedDump = 'xtrabackup" --backup --password=\'secret\' \'./dump\'';
73+
$expectedDump = 'xtrabackup" --backup --password=\'secret\' --target-dir=\'./dump\'';
7474
$expected = '"' . PHPBU_TEST_BIN . '/' . $expectedDump;
7575
$xtra = new Xtrabackup8(PHPBU_TEST_BIN);
7676
$xtra->credentials('', 'secret')->dumpTo('./dump');
@@ -83,7 +83,7 @@ public function testPassword()
8383
*/
8484
public function testHost()
8585
{
86-
$expectedDump = '"' . PHPBU_TEST_BIN . '/xtrabackup" --backup --host=\'example.com\' \'./dump\'';
86+
$expectedDump = '"' . PHPBU_TEST_BIN . '/xtrabackup" --backup --host=\'example.com\' --target-dir=\'./dump\'';
8787
$expected = $expectedDump;
8888
$xtra = new Xtrabackup8(PHPBU_TEST_BIN);
8989
$xtra->useHost('example.com')->dumpTo('./dump');
@@ -96,7 +96,8 @@ public function testHost()
9696
*/
9797
public function testDatabases()
9898
{
99-
$expectedDump = '"' . PHPBU_TEST_BIN . '/xtrabackup" --backup --databases=\'db1 db2 db3.table1\' \'./dump\'';
99+
$expectedDump = '"' . PHPBU_TEST_BIN . '/xtrabackup" --backup '
100+
. '--databases=\'db1 db2 db3.table1\' --target-dir=\'./dump\'';
100101
$expected = $expectedDump;
101102
$xtra = new Xtrabackup8(PHPBU_TEST_BIN);
102103
$xtra->dumpDatabases(['db1', 'db2', 'db3.table1'])->dumpTo('./dump');

0 commit comments

Comments
 (0)