use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
class AddAnnotatedClassesToCachePassTest extends TestCase
{ public function testExpandClasses() { $r =
new \
ReflectionClass(AddAnnotatedClassesToCachePass::
class);
$pass =
$r->
newInstanceWithoutConstructor();
$r =
new \
ReflectionMethod(AddAnnotatedClassesToCachePass::
class, 'expandClasses'
);
$expand =
$r->
getClosure($pass);
$this->
assertSame('Foo',
$expand(['Foo'
],
[])[0
]);
$this->
assertSame('Foo',
$expand(['\\Foo'
],
[])[0
]);
$this->
assertSame('Foo',
$expand(['Foo'
],
['\\Foo'
])[0
]);
$this->
assertSame('Foo',
$expand(['Foo'
],
['Foo'
])[0
]);
$this->
assertSame('Foo',
$expand(['\\Foo'
],
['\\Foo\\Bar'
])[0
]);
$this->
assertSame('Foo',
$expand(['Foo'
],
['\\Foo\\Bar'
])[0
]);
$this->
assertSame('Foo',
$expand(['\\Foo'
],
['\\Foo\\Bar\\Acme'
])[0
]);
$this->
assertSame('Foo\\Bar',
$expand(['Foo\\'
],
['\\Foo\\Bar'
])[0
]);
$this->
assertSame('Foo\\Bar\\Acme',
$expand(['Foo\\'
],
['\\Foo\\Bar\\Acme'
])[0
]);