ChangeEmailFormFactoryTest.php 922 Bytes
Newer Older
Bertrand Gauthier's avatar
Bertrand Gauthier committed
1
2
3
<?php
namespace ZfcUserTest\Factory\Form;

Bertrand Gauthier's avatar
Bertrand Gauthier committed
4
5
use Laminas\Form\FormElementManager;
use Laminas\ServiceManager\ServiceManager;
Bertrand Gauthier's avatar
Bertrand Gauthier committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use ZfcUser\Factory\Form\ChangeEmail as ChangeEmailFactory;
use ZfcUser\Options\ModuleOptions;
use ZfcUser\Mapper\User as UserMapper;

class ChangeEmailFormFactoryTest extends \PHPUnit_Framework_TestCase
{
    public function testFactory()
    {
        $serviceManager = new ServiceManager([
            'services' => [
                'zfcuser_module_options' => new ModuleOptions,
                'zfcuser_user_mapper' => new UserMapper
            ]
        ]);

        $formElementManager = new FormElementManager($serviceManager);
        $serviceManager->setService('FormElementManager', $formElementManager);

        $factory = new ChangeEmailFactory();

        $this->assertInstanceOf('ZfcUser\Form\ChangeEmail', $factory->__invoke($serviceManager, 'ZfcUser\Form\ChangeEmail'));
    }
}