Completed
Push — master ( dd1c3d...bd2aeb )
by Mateusz
40s
created

testValidateThrowsExceptionWhenClassIsInvalid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
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 2
4
 *
5
 * @link      http://github.com/mtymek/MtMail
6
 * @copyright Copyright (c) 2013-2014 Mateusz Tymek
7
 * @license   BSD 2-Clause
8
 */
9
10
namespace MtMailTest\Template;
11
12
use MtMail\Exception\RuntimeException;
13
use MtMail\Service\TemplateManager;
14
use Zend\ServiceManager\ServiceManager;
15
16
class ManagerTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @var TemplateManager
20
     */
21
    protected $manager;
22
23
    public function setUp()
24
    {
25
        $this->manager = new TemplateManager(new ServiceManager());
26
    }
27
28
    /**
29
     * @expectedException RuntimeException
30
     */
31
    public function testValidatePluginThrowsExceptionWhenClassIsInvalid()
32
    {
33
        $this->manager->validatePlugin(new \stdClass());
34
    }
35
36
    public function testValidatePluginDoesNothingIfPluginIsValid()
37
    {
38
        $mock = $this->getMock('MtMail\Template\TemplateInterface');
39
        $this->manager->validatePlugin($mock);
40
    }
41
42
    /**
43
     * @expectedException RuntimeException
44
     */
45
    public function testValidateThrowsExceptionWhenClassIsInvalid()
46
    {
47
        $this->manager->validate(new \stdClass());
48
    }
49
50
    public function testValidateDoesNothingIfPluginIsValid()
51
    {
52
        $mock = $this->getMock('MtMail\Template\TemplateInterface');
53
        $this->manager->validate($mock);
54
    }
55
}
56