-
Notifications
You must be signed in to change notification settings - Fork 2
/
ComposerCommandsTest.php
64 lines (48 loc) · 2.08 KB
/
ComposerCommandsTest.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace Dex\Composer\PlugAndPlay\Tests\Unit;
use Dex\Composer\PlugAndPlay\Tests\Application;
use Dex\Composer\PlugAndPlay\Tests\TestCase;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\BufferedOutput;
class ComposerCommandsTest extends TestCase
{
/**
* @var string
*/
protected $directory = __DIR__ . '/../Fixtures/Plugin/';
public function testPlugAndPlayInstallCommand()
{
$application = new Application();
$input = new StringInput("plug-and-play:install --plug-and-play-pretend -d {$this->directory}");
$output = new BufferedOutput();
$application->doRun($input, $output);
$this->assertStringContainsString('You are using Composer Plug and Play Plugin.', $output->fetch());
}
public function testPlugAndPlayUpdateCommand()
{
$application = new Application();
$input = new StringInput("plug-and-play:update --plug-and-play-pretend -d {$this->directory}");
$output = new BufferedOutput();
$application->doRun($input, $output);
$this->assertStringContainsString('You are using Composer Plug and Play Plugin.', $output->fetch());
}
public function testPlugAndPlayDumpCommand()
{
$application = new Application();
$input = new StringInput("plug-and-play:dump --plug-and-play-pretend -d {$this->directory}");
$output = new BufferedOutput();
$application->doRun($input, $output);
$this->assertStringContainsString('You are using Composer Plug and Play Plugin.', $output->fetch());
}
public function testListCommand()
{
$application = new Application();
$input = new StringInput("list -d {$this->directory}");
$output = new BufferedOutput();
$application->doRun($input, $output);
$content = $output->fetch();
$this->assertStringContainsString('plug-and-play:dump', $content);
$this->assertStringContainsString('plug-and-play:install', $content);
$this->assertStringContainsString('plug-and-play:update', $content);
}
}