Completed
Push — master ( e0017c...6b1304 )
by Tom
14s queued 11s
created

Service/Authentication/AdapterFactoryTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineModuleTest\Service\Authentication;
6
7
use DoctrineModule\Service\Authentication\AdapterFactory;
8
use Laminas\ServiceManager\ServiceManager;
9
use PHPUnit\Framework\TestCase as BaseTestCase;
10
11
class AdapterFactoryTest extends BaseTestCase
12
{
13
    public function testWillInstantiateFromFQCN() : void
14
    {
15
        $name           = 'testFactory';
16
        $factory        = new AdapterFactory($name);
17
        $objectManager  = $this->createMock('Doctrine\Persistence\ObjectManager');
18
        $serviceManager = new ServiceManager();
19
        $serviceManager->setService(
20
            'config',
21
            [
22
                'doctrine' => [
23
                    'authentication' => [
24
                        $name => [
25
                            'objectManager' => $objectManager,
26
                            'identityClass' => 'DoctrineModuleTest\Authentication\Adapter\TestAsset\IdentityObject',
27
                            'identityProperty' => 'username',
28
                            'credentialProperty' => 'password',
29
                        ],
30
                    ],
31
                ],
32
            ]
33
        );
34
35
        $adapter = $factory->createService($serviceManager);
36
        $this->assertInstanceOf('DoctrineModule\Authentication\Adapter\ObjectRepository', $adapter);
0 ignored issues
show
The method assertInstanceOf() does not seem to exist on object<DoctrineModuleTes...ion\AdapterFactoryTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
    }
38
}
39