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

DefaultProxyNamingInflectorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test() 0 3 1
A namesProvider() 0 8 1
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