Completed
Pull Request — master (#494)
by Thomas Mauro
67:40 queued 23:32
created

YumlControllerFactoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B testCreateService() 0 27 1
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license. For more information, see
17
 * <http://www.doctrine-project.org>.
18
 */
19
20
namespace DoctrineORMModuleTest\Yuml;
21
22
use DoctrineORMModule\Yuml\YumlController;
23
use DoctrineORMModule\Yuml\YumlControllerFactory;
24
use Zend\ServiceManager\AbstractPluginManager;
25
use Zend\ServiceManager\ServiceLocatorInterface;
26
27
class YumlControllerFactoryTest extends \PHPUnit_Framework_TestCase
28
{
29
    public function testCreateService()
30
    {
31
        $config = [
32
            'zenddevelopertools' => [
33
                'toolbar' => [
34
                    'enabled' => true
35
                ]
36
            ]
37
        ];
38
39
        $serviceLocator = $this->getMockBuilder(ServiceLocatorInterface::class)
40
            ->getMock();
41
        $pluginManager = $this->getMockBuilder(AbstractPluginManager::class)
42
            ->disableOriginalConstructor()
43
            ->getMock();
44
45
        $serviceLocator->expects(static::any())->method('get')->with('config')->willReturn($config);
46
47
        $pluginManager->expects(static::once())
48
            ->method('getServiceLocator')
49
            ->willReturn($serviceLocator);
50
51
        $factory = new YumlControllerFactory();
52
        $controller = $factory->createService($pluginManager);
53
54
        static::assertInstanceOf(YumlController::class, $controller);
55
    }
56
}
57