PluginTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 18
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetPackages() 0 3 1
A setUp() 0 13 1
A testGetSubscribedEvents() 0 3 1
1
<?php
2
/**
3
 * Composer plugin for config assembling
4
 *
5
 * @link      https://github.com/hiqdev/composer-config-plugin
6
 * @package   composer-config-plugin
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\composer\config\tests\unit;
12
13
use Composer\Composer;
14
use Composer\Config;
15
use hiqdev\composer\config\Plugin;
16
17
/**
18
 * Class PluginTest.
19
 */
20
class PluginTest extends \PHPUnit\Framework\TestCase
21
{
22
    private $object;
23
    private $io;
24
    private $composer;
25
    private $event;
26
    private $packages = [];
27
28
    public function setUp()
29
    {
30
        parent::setUp();
31
        $this->composer = new Composer();
32
        $this->composer->setConfig(new Config(true, getcwd()));
33
        $this->io = $this->createMock('Composer\IO\IOInterface');
34
        $this->event = $this->getMockBuilder('Composer\Script\Event')
35
            ->setConstructorArgs(['test', $this->composer, $this->io])
36
            ->getMock();
37
38
        $this->object = new Plugin();
39
        $this->object->setPackages($this->packages);
40
        $this->object->activate($this->composer, $this->io);
41
    }
42
43
    public function testGetPackages()
44
    {
45
        $this->assertSame($this->packages, $this->object->getPackages());
46
    }
47
48
    public function testGetSubscribedEvents()
49
    {
50
        $this->assertInternalType('array', $this->object->getSubscribedEvents());
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertInternalType() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/3369 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

50
        /** @scrutinizer ignore-deprecated */ $this->assertInternalType('array', $this->object->getSubscribedEvents());

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
51
    }
52
}
53