Completed
Push — dev ( 7bfb1f...f543b6 )
by Antonio
05:11
created

PluginTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 5
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testActivateSuccess() 0 9 1
1
<?php
2
3
namespace Ams\Composer\GitHooks\Test;
4
5
use Ams\Composer\GitHooks\Plugin;
6
use Composer\Composer;
7
use Composer\Config;
8
use Composer\Installer\InstallationManager;
9
use Composer\TestCase;
10
11
class PluginTest extends TestCase
12
{
13
    /**
14
     * @var Composer
15
     */
16
    private $composer;
17
18
    private $io;
19
20
    public function setUp()
21
    {
22
        $this->composer = new Composer();
23
        $this->composer->setConfig(new Config());
24
        $this->composer->setInstallationManager(new InstallationManager());
25
        $this->io = $this->createMock('Composer\IO\IOInterface');
26
    }
27
28
    public function testActivateSuccess()
29
    {
30
        $plugin = new Plugin();
31
        $plugin->activate($this->composer, $this->io);
32
        $installer = $this->composer->getInstallationManager()->getInstaller('git-hook');
33
34
        // Check right installer instance is given
35
        $this->assertInstanceOf('Ams\Composer\GitHooks\Installer\GitHooksInstaller', $installer);
36
    }
37
}
38