getInstanceOf()   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
 * 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