ServiceContainerTest::buildMock()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace FwlibTest\Base;
3
4
use Fwlib\Base\ServiceContainer;
5
use Fwolf\Wrapper\PHPUnit\PHPUnitTestCase;
6
use PHPUnit_Framework_MockObject_MockObject as MockObject;
7
8
/**
9
 * @copyright   Copyright 2015 Fwolf
10
 * @license     http://www.gnu.org/licenses/lgpl.html LGPL-3.0+
11
 */
12
class ServiceContainerTest extends PHPUnitTestCase
13
{
14
    /**
15
     * @return MockObject | ServiceContainer
16
     */
17
    protected function buildMock()
18
    {
19
        return ServiceContainer::getInstance();
20
    }
21
22
23
    /**
24
     * Check of returned type is not necessary, service container will always
25
     * return instance, or throw exception.
26
     */
27
    public function testGetMethods()
28
    {
29
        $container = $this->buildMock();
30
31
        // Through class map
32
        $this->assertNotEmpty($container->getCachedCaller());
33
        $this->assertNotEmpty($container->getCurl());
34
        $this->assertNotEmpty($container->getListView());
35
        $this->assertNotEmpty($container->getSmarty());
36
        $this->assertNotEmpty($container->getValidator());
37
38
        // Through create method
39
        /** @noinspection PhpDeprecationInspection */
40
        $this->assertNotEmpty($container->getListTable());
0 ignored issues
show
Deprecated Code introduced by
The method Fwlib\Base\ServiceContainer::getListTable() has been deprecated with message: Use ListView

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...
41
    }
42
}
43