4 * @covers ClassCollector
6 class ClassCollectorTest
extends PHPUnit_Framework_TestCase
{
8 public static function provideCases() {
15 "namespace Example;\nclass Foo {}\nclass Bar {}",
16 [ 'Example\Foo', 'Example\Bar' ],
19 "class_alias( 'Foo', 'Bar' );",
23 "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Foo' );",
24 [ 'Example\Foo', 'Foo' ],
27 "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Bar' );",
28 [ 'Example\Foo', 'Bar' ],
31 "class_alias( Foo::class, 'Bar' );",
35 "namespace Example;\nclass Foo {}\nclass_alias( Foo::class, 'Bar' );",
36 [ 'Example\Foo', 'Bar' ],
42 * @dataProvider provideCases
44 public function testGetClasses( $code, array $classes, $message = null ) {
45 $cc = new ClassCollector();
46 $this->assertEquals( $classes, $cc->getClasses( "<?php\n$code" ), $message );