Completed
Push — master ( d22c3a...dd1c3d )
by Mateusz
19:21 queued 16:01
created

ComposerPluginManagerCompatibilityTest   A

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
namespace MtMailTest\Service;
4
5
use MtMail\ComposerPlugin\PluginInterface;
6
use MtMail\Exception\RuntimeException;
7
use MtMail\Service\ComposerPluginManager;
8
use PHPUnit_Framework_TestCase as TestCase;
9
use Zend\ServiceManager\Config;
10
use Zend\ServiceManager\ServiceManager;
11
use Zend\ServiceManager\Test\CommonPluginManagerTrait;
12
13
class ComposerPluginManagerCompatibilityTest extends TestCase
14
{
15
    use CommonPluginManagerTrait;
16
17
    protected function getPluginManager()
18
    {
19
        $parent = new ServiceManager();
20
        $manager = new ComposerPluginManager($parent);
21
        $configArray = include __DIR__ . '/../../../config/module.config.php';
22
        $config = new Config($configArray['mt_mail']['composer_plugin_manager']);
23
        $config->configureServiceManager($manager);
24
        $parent->setService('Configuration', $configArray);
25
        return $manager;
26
    }
27
28
    protected function getV2InvalidPluginException()
29
    {
30
        return RuntimeException::class;
31
    }
32
33
    protected function getInstanceOf()
34
    {
35
        return PluginInterface::class;
36
    }
37
}
38