EnginePluginManagerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testValidatePluginWithInvalidArgument() 0 5 1
A testValidatePlugin() 0 5 1
1
<?php
2
/**
3
 * @author Jonas Rosenlind <[email protected]>
4
 *
5
 * @copyright LokalByg APS
6
 */
7
8
namespace EmailTemplatesTest\Service\Template;
9
10
use PHPUnit_Framework_TestCase;
11
use Roave\EmailTemplates\Service\Template\Engine\EngineInterface;
12
use Roave\EmailTemplates\Service\Template\EnginePluginManager;
13
use Roave\EmailTemplates\Service\Template\Exception\InvalidEngineException;
14
use stdClass;
15
16
/**
17
 * Class EnginePluginManagerTest
18
 *
19
 * @coversDefaultClass \Roave\EmailTemplates\Service\Template\EnginePluginManager
20
 * @covers ::<!public>
21
 *
22
 * @group service
23
 */
24
class EnginePluginManagerTest extends PHPUnit_Framework_TestCase
25
{
26
    /**
27
     * @var EnginePluginManager
28
     */
29
    protected $manager;
30
31
    public function setUp()
32
    {
33
        $this->manager = new EnginePluginManager();
34
    }
35
36
    /**
37
     * @covers ::validatePlugin
38
     */
39
    public function testValidatePluginWithInvalidArgument()
40
    {
41
        $this->setExpectedException(InvalidEngineException::class);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0; use expectException() instead

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

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

Loading history...
42
        $this->manager->validatePlugin(new stdClass());
43
    }
44
45
    /**
46
     * @covers ::validatePlugin
47
     */
48
    public function testValidatePlugin()
49
    {
50
        $plugin = $this->createMock(EngineInterface::class);
51
        $this->manager->validatePlugin($plugin);
52
    }
53
}
54