UserInfoFactoryTest.php 1.07 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?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';
16

17
18
    public function testCanCreateService()
    {
Bertrand Gauthier's avatar
Bertrand Gauthier committed
19
        $authService = $this->createMock('Laminas\Authentication\AuthenticationService');
20
        $mapper      = $this->createMock('UnicaenApp\Mapper\Ldap\Structure');
21

22
23
        $this->serviceManager->expects($this->exactly(2))
                ->method('get')
24
25
26
27
                ->will($this->returnValueMap([
                    ['zfcuser_auth_service', $authService],
                    ['ldap_structure_mapper', $mapper]]));

28
        $service = $this->factory->__invoke($this->serviceManager, '');
29

30
31
32
33
        $this->assertInstanceOf($this->serviceClass, $service);
        $this->assertSame($mapper, $service->getMapperStructure());
    }
}