-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPathPluginTest.php
57 lines (48 loc) · 1.13 KB
/
PathPluginTest.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
<?php
namespace TypedPHP\Composer\Tests;
use Composer\Composer;
use Composer\IO\IOInterface;
use Mockery;
use TypedPHP\Composer\PathPlugin;
use TypedPHP\Composer\PathPluginInstaller;
class PathPluginTest extends TestCase
{
/**
* @test
*
* @return void
*/
public function pluginActivatesInstaller()
{
$composer = $this->getNewComposerMock();
$composer
->shouldReceive("getInstallationManager")
->atLeast()->once()
->andReturn($composer);
$composer
->shouldReceive("addInstaller")
->atLeast()->once()
->with(
Mockery::type(PathPluginInstaller::class)
);
$plugin = new PathPlugin();
$plugin->activate(
$composer,
$this->getNewInterfaceMock()
);
}
/**
* @return Composer
*/
protected function getNewComposerMock()
{
return Mockery::mock(Composer::class);
}
/**
* @return IOInterface
*/
protected function getNewInterfaceMock()
{
return Mockery::mock(IOInterface::class);
}
}