-
-
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.
Merge pull request #26 from netlogix/bugfix/create-directories
[BUGFIX] Fix creating shared/Data directories in Flow application
- Loading branch information
Showing
4 changed files
with
118 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
namespace TYPO3\Surf\Tests\Unit\Task\Generic; | ||
|
||
/* * | ||
* This script belongs to the TYPO3 project "TYPO3 Surf". * | ||
* * | ||
* */ | ||
|
||
use TYPO3\Surf\Task\Generic\CreateDirectoriesTask; | ||
use TYPO3\Surf\Tests\Unit\Task\BaseTaskTest; | ||
|
||
/** | ||
* Class CreateDirectoriesTaskTest | ||
*/ | ||
class CreateDirectoriesTaskTest extends BaseTaskTest | ||
{ | ||
|
||
/** | ||
* @var CreateDirectoriesTask | ||
*/ | ||
protected $task; | ||
|
||
protected function setUp() | ||
{ | ||
parent::setUp(); | ||
$this->application = new \TYPO3\Surf\Application\TYPO3\CMS('TestApplication'); | ||
$this->application->setDeploymentPath('/home/jdoe/app'); | ||
} | ||
|
||
/** | ||
* @return CreateDirectoriesTask | ||
*/ | ||
protected function createTask() | ||
{ | ||
return new CreateDirectoriesTask(); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function createsDirectoriesInReleasePath() | ||
{ | ||
$options = array('directories' => array('media')); | ||
$this->task->execute($this->node, $this->application, $this->deployment, $options); | ||
|
||
$this->assertCommandExecuted("cd {$this->deployment->getApplicationReleasePath($this->application)}"); | ||
$this->assertCommandExecuted('mkdir -p media'); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function createsDirectoriesInCustomPath() | ||
{ | ||
$options = array('directories' => array('media'), 'baseDirectory' => '/foo/bar'); | ||
$this->task->execute($this->node, $this->application, $this->deployment, $options); | ||
|
||
$this->assertCommandExecuted('cd /foo/bar'); | ||
$this->assertCommandExecuted('mkdir -p media'); | ||
} | ||
} |
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,52 @@ | ||
<?php | ||
namespace TYPO3\Surf\Tests\Unit\Task\TYPO3\Flow; | ||
|
||
/* * | ||
* This script belongs to the TYPO3 project "TYPO3 Surf". * | ||
* * | ||
* */ | ||
|
||
use TYPO3\Surf\Task\TYPO3\Flow\CreateDirectoriesTask; | ||
use TYPO3\Surf\Tests\Unit\Task\BaseTaskTest; | ||
|
||
/** | ||
* Class CreateDirectoriesTaskTest | ||
*/ | ||
class CreateDirectoriesTaskTest extends BaseTaskTest | ||
{ | ||
|
||
/** | ||
* @var CreateDirectoriesTask | ||
*/ | ||
protected $task; | ||
|
||
protected function setUp() | ||
{ | ||
parent::setUp(); | ||
$this->application = new \TYPO3\Surf\Application\TYPO3\CMS('TestApplication'); | ||
$this->application->setDeploymentPath('/home/jdoe/app'); | ||
} | ||
|
||
/** | ||
* @return CreateDirectoriesTask | ||
*/ | ||
protected function createTask() | ||
{ | ||
return new CreateDirectoriesTask(); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function createsDirectoriesInDeploymentRoot() | ||
{ | ||
$options = array(); | ||
$this->task->execute($this->node, $this->application, $this->deployment, $options); | ||
|
||
$this->assertCommandExecuted("cd {$this->application->getDeploymentPath()}"); | ||
$this->assertCommandExecuted('mkdir -p shared/Data/Logs'); | ||
$this->assertCommandExecuted('mkdir -p shared/Data/Persistent'); | ||
$this->assertCommandExecuted('mkdir -p shared/Configuration'); | ||
} | ||
|
||
} |
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