Passed
Push — v3_compat ( af37b8...c7ae23 )
by Mateusz
03:38
created

getPluginManager()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
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