mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-05-24 17:32:14 +02:00
[Discovery One] Improve tests
This commit is contained in:
parent
3dc7acf3d4
commit
b4f613067e
38
tests/Task/BuiltIn/Symfony/CachePoolClearTaskTest.php
Normal file
38
tests/Task/BuiltIn/Symfony/CachePoolClearTaskTest.php
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Mage\tests\Task\BuiltIn\Symfony;
|
||||||
|
|
||||||
|
|
||||||
|
use Mage\Task\BuiltIn\Symfony\CachePoolClearTask;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Mage\Tests\Runtime\RuntimeMockup;
|
||||||
|
use Mage\Task\Exception\ErrorException;
|
||||||
|
|
||||||
|
class CachePoolClearTaskTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var RuntimeMockup
|
||||||
|
*/
|
||||||
|
private $runtime;
|
||||||
|
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
$this->runtime = new RuntimeMockup();
|
||||||
|
$this->runtime->setConfiguration(['environments' => ['test' => []]]);
|
||||||
|
$this->runtime->setEnvironment('test');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAsseticDumpTask()
|
||||||
|
{
|
||||||
|
$task = new CachePoolClearTask();
|
||||||
|
$task->setOptions(['env' => 'test']);
|
||||||
|
$task->setRuntime($this->runtime);
|
||||||
|
$this->assertEquals('[Symfony] Cache Pool Clear', $task->getDescription());
|
||||||
|
|
||||||
|
try {
|
||||||
|
$task->execute();
|
||||||
|
} catch (ErrorException $exception) {
|
||||||
|
$this->assertEquals('Parameter "pools" is not defined', $exception->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue