Completed
Push — develop ( e2b887...c09155 )
by
unknown
12:13
created

ForgotPasswordControllerSLFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 34
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testCreateService() 0 21 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013-2015 Cross Solution (http://cross-solution.de)
7
 * @license       MIT
8
 */
9
10
namespace AuthTest\Factory\Controller;
11
12
use Auth\Factory\Controller\ForgotPasswordControllerFactory;
13
use Test\Bootstrap;
14
use Zend\Mvc\Controller\ControllerManager;
15
16
class ForgotPasswordControllerSLFactoryTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @var ForgotPasswordControllerFactory
20
     */
21
    private $testedObj;
22
23
    public function setUp()
24
    {
25
        $this->testedObj = new ForgotPasswordControllerFactory();
26
    }
27
28
    public function testCreateService()
29
    {
30
        $sm = clone Bootstrap::getServiceManager();
31
        $sm->setAllowOverride(true);
32
33
        $forgotPasswordMock = $this->getMockBuilder('Auth\Service\ForgotPassword')
34
            ->disableOriginalConstructor()
35
            ->getMock();
36
37
        $loggerMock = $this->getMock('Zend\Log\LoggerInterface');
38
39
        $sm->setService('Auth\Service\ForgotPassword', $forgotPasswordMock);
40
        $sm->setService('Core/Log', $loggerMock);
41
42
        $controllerManager = new ControllerManager();
43
        $controllerManager->setServiceLocator($sm);
44
45
        $result = $this->testedObj->createService($controllerManager);
46
47
        $this->assertInstanceOf('Auth\Controller\ForgotPasswordController', $result);
48
    }
49
}