UserCurrentFactoryTest.php 898 Bytes
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 UserCurrentFactoryTest
 *
 * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
 */
class UserCurrentFactoryTest extends BaseServiceFactoryTest
{
    protected $factoryClass = 'UnicaenAuth\View\Helper\UserCurrentFactory';
    protected $serviceClass = 'UnicaenAuth\View\Helper\UserCurrent';
16

17
18
    public function testCanCreateService()
    {
19
        $authService = $this->createMock('Zend\Authentication\AuthenticationService');
20

21
22
23
24
        $this->serviceManager->expects($this->once())
                ->method('get')
                ->with('zfcuser_auth_service')
                ->will($this->returnValue($authService));
25

26
        $service = $this->factory->__invoke($this->serviceManager, '');
27

28
29
30
        $this->assertInstanceOf($this->serviceClass, $service);
    }
}