Update definition validation tests
parent
864a7a8621
commit
59965448f0
|
@ -31,7 +31,7 @@ class ValidationTest extends TestCase
|
||||||
$iterator = new RecursiveDirectoryIterator(__DIR__ . "/../../validation/frameworks/" . $frameworkName);
|
$iterator = new RecursiveDirectoryIterator(__DIR__ . "/../../validation/frameworks/" . $frameworkName);
|
||||||
|
|
||||||
foreach (new RecursiveIteratorIterator($iterator) as $file) {
|
foreach (new RecursiveIteratorIterator($iterator) as $file) {
|
||||||
if (strpos((string)$file, ".php") !== false && strpos((string)$file, "drupal") === false) {
|
if (strpos(\strrev((string)$file), \strrev(".php")) === 0) {
|
||||||
if ($file->getSize() < 100000) {
|
if ($file->getSize() < 100000) {
|
||||||
$testProviderArray[$frameworkName . "::" . $file->getBasename()] = [$file->getPathname(), $frameworkName];
|
$testProviderArray[$frameworkName . "::" . $file->getBasename()] = [$file->getPathname(), $frameworkName];
|
||||||
}
|
}
|
||||||
|
@ -89,6 +89,7 @@ class ValidationTest extends TestCase
|
||||||
$parserKinds = [ParserKind::DIAGNOSTIC_PHP_PARSER, ParserKind::DIAGNOSTIC_TOLERANT_PHP_PARSER];
|
$parserKinds = [ParserKind::DIAGNOSTIC_PHP_PARSER, ParserKind::DIAGNOSTIC_TOLERANT_PHP_PARSER];
|
||||||
$maxRecursion = [];
|
$maxRecursion = [];
|
||||||
$definitions = [];
|
$definitions = [];
|
||||||
|
$types = [];
|
||||||
|
|
||||||
foreach ($parserKinds as $kind) {
|
foreach ($parserKinds as $kind) {
|
||||||
global $parserKind;
|
global $parserKind;
|
||||||
|
@ -106,17 +107,25 @@ class ValidationTest extends TestCase
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($document->getStmts() === null) {
|
||||||
|
$this->markTestSkipped("null AST");
|
||||||
|
}
|
||||||
|
|
||||||
$fqns = [];
|
$fqns = [];
|
||||||
|
$currentTypes = [];
|
||||||
foreach ($document->getDefinitions() as $defn) {
|
foreach ($document->getDefinitions() as $defn) {
|
||||||
$fqns[] = $defn->fqn;
|
$fqns[] = $defn->fqn;
|
||||||
|
$currentTypes[$defn->fqn] = $defn->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($definitions[$testCaseFile])) {
|
if (isset($definitions[$testCaseFile])) {
|
||||||
var_dump($definitions[$testCaseFile]);
|
var_dump($definitions[$testCaseFile]);
|
||||||
$this->assertEquals($definitions[$testCaseFile], $fqns);
|
$this->assertEquals($definitions[$testCaseFile], $fqns);
|
||||||
|
// $this->assertEquals($types[$testCaseFile], $currentTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
$definitions[$testCaseFile] = $fqns;
|
$definitions[$testCaseFile] = $fqns;
|
||||||
|
$types[$testCaseFile] = $currentTypes;
|
||||||
$maxRecursion[$testCaseFile] = $definitionResolver::$maxRecursion;
|
$maxRecursion[$testCaseFile] = $definitionResolver::$maxRecursion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue