PluginTest::testGetPackages()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * Composer plugin for pluggable extensions
5
 *
6
 * @link      https://github.com/hiqdev/composer-extension-plugin
7
 * @package   composer-extension-plugin
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hiqdev\composerextensionplugin\tests\unit;
13
14
use Composer\Composer;
15
use Composer\Config;
16
use hiqdev\composerextensionplugin\Plugin;
17
18
/**
19
 * Class PluginTest.
20
 */
21
class PluginTest extends \PHPUnit_Framework_TestCase
22
{
23
    private $object;
24
    private $io;
25
    private $composer;
26
    private $event;
27
    private $packages = [];
28
29
    public function setUp()
30
    {
31
        parent::setUp();
32
        $this->composer = new Composer();
33
        $this->composer->setConfig(new Config(true, getcwd()));
34
        $this->io = $this->getMock('Composer\IO\IOInterface');
35
        $this->event = $this->getMock('Composer\Script\Event', [], ['test', $this->composer, $this->io]);
36
37
        $this->object = new Plugin();
38
        $this->object->setPackages($this->packages);
39
        $this->object->activate($this->composer, $this->io);
40
    }
41
42
    public function testGetPackages()
43
    {
44
        $this->assertSame($this->packages, $this->object->getPackages());
45
    }
46
47
    public function testGetSubscribedEvents()
48
    {
49
        $this->assertInternalType('array', $this->object->getSubscribedEvents());
50
    }
51
}
52