shouldCreatedPHPMappingDriver()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
/**
3
 * Copyright (C) 2018 Gerrit Addiks.
4
 * This package (including this file) was released under the terms of the GPL-3.0.
5
 * You should have received a copy of the GNU General Public License along with this program.
6
 * If not, see <http://www.gnu.org/licenses/> or send me a mail so i can send you a copy.
7
 * @license GPL-3.0
8
 * @author Gerrit Addiks <[email protected]>
9
 */
10
11
namespace Addiks\RDMBundle\Tests\Mapping\DriverFactories;
12
13
use PHPUnit\Framework\TestCase;
14
use Addiks\RDMBundle\Mapping\DriverFactories\MappingPHPDriverFactory;
15
use Doctrine\ORM\Mapping\Driver\PHPDriver;
16
use Addiks\RDMBundle\Mapping\Drivers\MappingPHPDriver;
17
use Doctrine\Persistence\Mapping\Driver\FileLocator;
18
19
final class MappingPHPDriverFactoryTest extends TestCase
20
{
21
22
    /**
23
     * @var MappingPHPDriverFactory
24
     */
25
    private $driverFactory;
26
27
    public function setUp(): void
28
    {
29
        $this->driverFactory = new MappingPHPDriverFactory();
30
    }
31
32
    /**
33
     * @test
34
     */
35
    public function shouldCreatedPHPMappingDriver()
36
    {
37
        /** @var PHPDriver $mappingDriver */
38
        $mappingDriver = $this->createMock(PHPDriver::class);
39
40
        $mappingDriver->method('getLocator')->willReturn($this->createMock(FileLocator::class));
0 ignored issues
show
Bug introduced by
The method method() does not exist on Doctrine\ORM\Mapping\Driver\PHPDriver. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        $mappingDriver->/** @scrutinizer ignore-call */ 
41
                        method('getLocator')->willReturn($this->createMock(FileLocator::class));

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...
41
42
        /** @var MappingPHPDriver $rdmMappingDriver */
43
        $rdmMappingDriver = $this->driverFactory->createRDMMappingDriver($mappingDriver);
44
45
        $this->assertInstanceOf(MappingPHPDriver::class, $rdmMappingDriver);
46
    }
47
48
}
49