Failed Conditions
Push — ProxyNamingInflector ( 293790 )
by Michael
03:54
created

DefaultProxyNamingInflectorTest::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Doctrine\Tests\Persistence\Proxy;
4
5
use Doctrine\Persistence\Proxy\DefaultProxyNamingInflector;
6
use Doctrine\Tests\DoctrineTestCase;
7
8
final class DefaultProxyNamingInflectorTest extends DoctrineTestCase
9
{
10
    /**
11
     * @dataProvider namesProvider()
12
     */
13
    public function test(string $originalName, $expectedName) : void
14
    {
15
        self::assertSame($expectedName, (new DefaultProxyNamingInflector())->getRealClassName($originalName));
16
    }
17
18
    /**
19
     * @return string[][]
20
     */
21
    public function namesProvider() : iterable
22
    {
23
        yield ['Foo', 'Foo'];
0 ignored issues
show
Bug Best Practice introduced by
The expression yield array('Foo', 'Foo') returns the type Generator which is incompatible with the documented return type array<mixed,string[]>.
Loading history...
24
        yield ['Foo', 'Foo'];
25
        yield ['__CG__\Foo', '__CG__\Foo'];
26
        yield ['Prefix\__CG__\Foo', 'Foo'];
27
        yield ['Prefix\AnotherPrefix\__CG__\Foo', 'Foo'];
28
        yield ['Prefix\__CG__\Middle\__CG__\Foo', 'Foo'];
29
    }
30
}
31