-
Notifications
You must be signed in to change notification settings - Fork 164
/
BasicComposerTaskTest.php
36 lines (27 loc) · 955 Bytes
/
BasicComposerTaskTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace Mage\Tests\Task\BuiltIn\Composer;
use Mage\Tests\Runtime\RuntimeMockup;
use PHPUnit\Framework\TestCase;
class BasicComposerTaskTest extends TestCase
{
public function testBasicTask()
{
$runtime = new RuntimeMockup();
$runtime->setConfiguration(['environments' => ['test' => []]]);
$runtime->setEnvironment('test');
$task = new BasicComposerTask();
$task->setRuntime($runtime);
$this->assertEquals('[Composer] Help', $task->getDescription());
$task->execute();
$ranCommands = $runtime->getRanCommands();
$testCase = array(
0 => 'composer help',
);
// Check total of Executed Commands
$this->assertEquals(count($testCase), count($ranCommands));
// Check Generated Commands
foreach ($testCase as $index => $command) {
$this->assertEquals($command, $ranCommands[$index]);
}
}
}