1
0
Fork 0

Merge pull request #5708 from alcohol/issue-5701

test cases for #5701
pull/5688/merge
Jordi Boggiano 2016-09-23 13:33:28 +02:00 committed by GitHub
commit 73a8e2c1ab
3 changed files with 82 additions and 62 deletions

View File

@ -39,22 +39,7 @@ class ClassMapGeneratorTest extends TestCase
$this->markTestSkipped('Test segfaults on travis 5.3.3 due to ClassMap\LongString');
}
$data = array(
array(__DIR__.'/Fixtures/Namespaced', array(
'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.inc',
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
)),
array(__DIR__.'/Fixtures/beta/NamespaceCollision', array(
'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php',
)),
array(__DIR__.'/Fixtures/Pearlike', array(
'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php',
'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php',
'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php',
)),
array(__DIR__.'/Fixtures/classmap', array(
$classmap = array(
'Foo\\Bar\\A' => realpath(__DIR__) . '/Fixtures/classmap/sameNsMultipleClasses.php',
'Foo\\Bar\\B' => realpath(__DIR__) . '/Fixtures/classmap/sameNsMultipleClasses.php',
'Alpha\\A' => realpath(__DIR__) . '/Fixtures/classmap/multipleNs.php',
@ -73,7 +58,34 @@ class ClassMapGeneratorTest extends TestCase
'Foo\\SlashedA' => realpath(__DIR__) . '/Fixtures/classmap/BackslashLineEndingString.php',
'Foo\\SlashedB' => realpath(__DIR__) . '/Fixtures/classmap/BackslashLineEndingString.php',
'Unicode\\↑\\↑' => realpath(__DIR__) . '/Fixtures/classmap/Unicode.php',
'ShortOpenTag' => realpath(__DIR__) . '/Fixtures/classmap/ShortOpenTag.php',
'ShortOpenTagDocblock' => realpath(__DIR__) . '/Fixtures/classmap/ShortOpenTagDocblock.php',
);
/**
* @wontfix If short_open_tag is not enabled, we end up parsing the docblock because
* php_strip_whitespace won't recognize the file. Funky edge-case (does not apply to HHVM).
*/
if (!defined('HHVM_VERSION') && !ini_get('short_open_tag')) {
$classmap['description'] = realpath(__DIR__) . '/Fixtures/classmap/ShortOpenTagDocblock.php';
}
$data = array(
array(__DIR__ . '/Fixtures/Namespaced', array(
'Namespaced\\Bar' => realpath(__DIR__) . '/Fixtures/Namespaced/Bar.inc',
'Namespaced\\Foo' => realpath(__DIR__) . '/Fixtures/Namespaced/Foo.php',
'Namespaced\\Baz' => realpath(__DIR__) . '/Fixtures/Namespaced/Baz.php',
)),
array(__DIR__ . '/Fixtures/beta/NamespaceCollision', array(
'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__) . '/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__) . '/Fixtures/beta/NamespaceCollision/A/B/Foo.php',
)),
array(__DIR__ . '/Fixtures/Pearlike', array(
'Pearlike_Foo' => realpath(__DIR__) . '/Fixtures/Pearlike/Foo.php',
'Pearlike_Bar' => realpath(__DIR__) . '/Fixtures/Pearlike/Bar.php',
'Pearlike_Baz' => realpath(__DIR__) . '/Fixtures/Pearlike/Baz.php',
)),
array(__DIR__ . '/Fixtures/classmap', $classmap),
array(__DIR__ . '/Fixtures/template', array()),
);

View File

@ -0,0 +1,3 @@
<?
class ShortOpenTag {}

View File

@ -0,0 +1,5 @@
<?
/**
* Some class description here.
*/
class ShortOpenTagDocblock {}