UserInfoFactoryTest.php 1.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

namespace UnicaenAppTest\View\Helper;

use UnicaenAppTest\View\Helper\BaseServiceFactoryTest;

/**
 * Description of UserInfoFactoryTest
 *
 * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
 */
class UserInfoFactoryTest extends BaseServiceFactoryTest
{
    protected $factoryClass = 'UnicaenAuth\View\Helper\UserInfoFactory';
    protected $serviceClass = 'UnicaenAuth\View\Helper\UserInfo';
    
    public function testCanCreateService()
    {
        $authService = $this->getMock('Zend\Authentication\AuthenticationService', array());
        $mapper      = $this->getMock('UnicaenApp\Mapper\Ldap\Structure', array());
        
        $this->serviceManager->expects($this->exactly(2))
                ->method('get')
                ->will($this->returnValueMap(array(
                    array('zfcuser_auth_service', $authService),
                    array('ldap_structure_mapper', $mapper))));
       
        $service = $this->factory->createService($this->pluginManager);
        
        $this->assertInstanceOf($this->serviceClass, $service);
        $this->assertSame($mapper, $service->getMapperStructure());
    }
}