Changeset View
Changeset View
Standalone View
Standalone View
src/parser/xhpast/__tests__/PHPASTParserTestCase.php
<?php | <?php | ||||
final class PHPASTParserTestCase extends PhutilTestCase { | final class PHPASTParserTestCase extends PhutilTestCase { | ||||
public function testParser() { | public function testParser() { | ||||
if (!PhutilXHPASTBinary::isAvailable()) { | if (!PhutilXHPASTBinary::isAvailable()) { | ||||
try { | try { | ||||
PhutilXHPASTBinary::build(); | PhutilXHPASTBinary::build(); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
$this->assertSkipped( | $this->assertSkipped( | ||||
pht('%s is not built or not up to date.', 'xhpast')); | pht('%s is not built or not up to date.', 'xhpast')); | ||||
} | } | ||||
} | } | ||||
$dir = dirname(__FILE__).'/data/'; | $dir = __DIR__.'/data/'; | ||||
foreach (Filesystem::listDirectory($dir) as $file) { | foreach (Filesystem::listDirectory($dir) as $file) { | ||||
if (preg_match('/\.test$/', $file)) { | if (preg_match('/\.test$/', $file)) { | ||||
$this->executeParserTest($file, $dir.$file); | $this->executeParserTest($file, $dir.$file); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
private function executeParserTest($name, $file) { | private function executeParserTest($name, $file) { | ||||
▲ Show 20 Lines • Show All 307 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0