-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Remove option --force for FlushCachesTask
- Loading branch information
1 parent
c9edc12
commit 7988327
Showing
7 changed files
with
89 additions
and
57 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
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
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
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,53 @@ | ||
<?php | ||
|
||
namespace TYPO3\Surf\Tests\Unit\Task\TYPO3\CMS; | ||
|
||
/* | ||
* This file is part of TYPO3 Surf. | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Prophecy\Argument; | ||
use TYPO3\Surf\Application\TYPO3\CMS; | ||
use TYPO3\Surf\Task\TYPO3\CMS\FlushCachesTask; | ||
use TYPO3\Surf\Tests\Unit\Task\BaseTaskTest; | ||
|
||
class FlushCachesTaskTest extends BaseTaskTest | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function wrongApplicationTypeGivenThrowsException(): void | ||
{ | ||
$this->expectException(\InvalidArgumentException::class); | ||
$this->task->execute($this->node, $this->application, $this->deployment, []); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function noSuitableCliArgumentsGiven(): void | ||
{ | ||
$application = new CMS(); | ||
$this->task->execute($this->node, $application, $this->deployment, []); | ||
$this->mockLogger->warning(Argument::any())->shouldBeCalledOnce(); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function executeFlushCacheCommandSuccessfully(): void | ||
{ | ||
$application = new CMS(); | ||
$options = ['scriptFileName' => 'typo3cms']; | ||
$this->task->execute($this->node, $application, $this->deployment, $options); | ||
$this->assertCommandExecuted('/php \'typo3cms\' \'cache:flush\'$/'); | ||
} | ||
|
||
protected function createTask() | ||
{ | ||
return new FlushCachesTask(); | ||
} | ||
} |