-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Properly escape options of dump database task
- Loading branch information
Showing
3 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
namespace TYPO3\Surf\Tests\Unit\Task; | ||
|
||
/* * | ||
* This script belongs to the TYPO3 project "TYPO3 Surf". * | ||
* * | ||
* */ | ||
|
||
/** | ||
* Unit test for the DumpDatabaseTaskTest | ||
*/ | ||
class DumpDatabaseTaskTest extends BaseTaskTest | ||
{ | ||
/** | ||
* Set up test dependencies | ||
*/ | ||
protected function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$this->application->setDeploymentPath('/home/jdoe/app'); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function executeProperlyEscapesInputOptions() | ||
{ | ||
$options = array( | ||
'sourceHost' => 'localhost', | ||
'sourceUser' => 'user', | ||
'sourcePassword' => '(pass)', | ||
'sourceDatabase' => 'db', | ||
'targetHost' => 'localhost', | ||
'targetUser' => 'user', | ||
'targetPassword' => '(pass)', | ||
'targetDatabase' => 'db', | ||
); | ||
$this->task->execute($this->node, $this->application, $this->deployment, $options); | ||
|
||
$this->assertCommandExecuted("'mysqldump' '-h' 'localhost' '-u' 'user' '-p(pass)' 'db' | 'ssh' 'hostname' ''\''mysql'\'' '\''-h'\'' '\''localhost'\'' '\''-u'\'' '\''user'\'' '\''-p(pass)'\'' '\''db'\'''"); | ||
} | ||
|
||
/** | ||
* @return \TYPO3\Surf\Domain\Model\Task | ||
*/ | ||
protected function createTask() | ||
{ | ||
return new \TYPO3\Surf\Task\DumpDatabaseTask(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters