1
0
Fork 0

Update validation tests

- assert non-null ASTs
- additional submodules
pull/357/head
Sara Itani 2017-03-28 13:58:48 -07:00
parent a69c93b28b
commit 42dc2c966d
3 changed files with 8 additions and 3 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "validation/frameworks/drupal"] [submodule "validation/frameworks/drupal"]
path = validation/frameworks/drupal path = validation/frameworks/drupal
url = https://github.com/drupal/drupal url = https://github.com/drupal/drupal
[submodule "validation/frameworks/tolerant-php-parser"]
path = validation/frameworks/tolerant-php-parser
url = https://github.com/microsoft/tolerant-php-parser

View File

@ -229,9 +229,9 @@ class PhpDocument
/** /**
* Returns the AST of the document * Returns the AST of the document
* *
* @return Node[] * @return Node[] | Tolerant\Node | null
*/ */
public function getStmts(): array public function getStmts()
{ {
return $this->stmts; return $this->stmts;
} }

View File

@ -30,7 +30,7 @@ class ValidationTest extends TestCase
foreach (new RecursiveIteratorIterator($iterator) as $file) { foreach (new RecursiveIteratorIterator($iterator) as $file) {
if (strpos((string)$file, ".php") !== false) { if (strpos((string)$file, ".php") !== false) {
if ($file->getSize() < 100000 ) { if ($file->getSize() < 100000) {
$testProviderArray[$frameworkName . "::" . $file->getBasename()] = [$file->getPathname(), $frameworkName]; $testProviderArray[$frameworkName . "::" . $file->getBasename()] = [$file->getPathname(), $frameworkName];
} }
} }
@ -69,6 +69,8 @@ class ValidationTest extends TestCase
$this->fail((string)$e); $this->fail((string)$e);
} }
$this->assertNotNull($document->getStmts());
if (file_exists($outFile)) { if (file_exists($outFile)) {
unlink($outFile); unlink($outFile);
} }