UserCurrentFactoryTest.php 931 Bytes
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
<?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';
    
    public function testCanCreateService()
    {
        $authService = $this->getMock('Zend\Authentication\AuthenticationService', array());
        
        $this->serviceManager->expects($this->once())
                ->method('get')
                ->with('zfcuser_auth_service')
                ->will($this->returnValue($authService));
       
        $service = $this->factory->createService($this->pluginManager);
        
        $this->assertInstanceOf($this->serviceClass, $service);
    }
}