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

AuthFactoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5
Metric Value
wmc 1
lcom 1
cbo 5
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFactoryReturnsProperConfiguredInstanceOfAuthViewHelperAuth() 0 16 1
1
<?php
2
/**
3
 * YAWIK - Unit Tests
4
 *
5
 * @copyright (c) 2013-2015 Cross Solution (http://cross-solution.de)
6
 * @license   MIT
7
 */
8
9
10
namespace AuthTest\Factory\View\Helper;
11
12
use Auth\Factory\View\Helper\AuthFactory;
13
use Zend\ServiceManager\ServiceManager;
14
use Zend\View\HelperPluginManager;
15
16
class AuthFactoryTest extends \PHPUnit_Framework_TestCase
17
{
18
    
19
    public function testFactoryReturnsProperConfiguredInstanceOfAuthViewHelperAuth()
20
    {
21
        $f = new AuthFactory();
22
        $sm = new ServiceManager();
23
        $auth = $this->getMock('\Zend\Authentication\AuthenticationService');
24
        $sm->setService('AuthenticationService', $auth);
25
        
26
        $hm = new HelperPluginManager();
27
        $hm->setServicelocator($sm);
28
        
29
        
30
        $helper = $f->createService($hm);
31
        
32
        $this->assertInstanceOf('\Auth\View\Helper\Auth', $helper);
33
        $this->assertSame($auth, $helper->getService());
34
    }
35
}