ComposerPluginManagerCompatibilityTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPluginManager() 0 10 1
A getV2InvalidPluginException() 0 4 1
A getInstanceOf() 0 4 1
1
<?php
2
/**
3
 * MtMail - e-mail module for Zend Framework
4
 *
5
 * @link      http://github.com/mtymek/MtMail
6
 * @copyright Copyright (c) 2013-2017 Mateusz Tymek
7
 * @license   BSD 2-Clause
8
 */
9
10
namespace MtMailTest\Service;
11
12
use MtMail\ComposerPlugin\PluginInterface;
13
use MtMail\Exception\RuntimeException;
14
use MtMail\Service\ComposerPluginManager;
15
use PHPUnit\Framework\TestCase;
16
use Zend\ServiceManager\Config;
17
use Zend\ServiceManager\ServiceManager;
18
use Zend\ServiceManager\Test\CommonPluginManagerTrait;
19
20
class ComposerPluginManagerCompatibilityTest extends TestCase
21
{
22
    use CommonPluginManagerTrait;
23
24
    protected function getPluginManager()
25
    {
26
        $parent = new ServiceManager();
27
        $manager = new ComposerPluginManager($parent);
28
        $configArray = include __DIR__ . '/../../../config/module.config.php';
29
        $config = new Config($configArray['mt_mail']['composer_plugin_manager']);
30
        $config->configureServiceManager($manager);
31
        $parent->setService('Configuration', $configArray);
32
        return $manager;
33
    }
34
35
    protected function getV2InvalidPluginException()
36
    {
37
        return RuntimeException::class;
38
    }
39
40
    protected function getInstanceOf()
41
    {
42
        return PluginInterface::class;
43
    }
44
}
45