Update baselines - failing tests are verified as expected
parent
ede5edc40d
commit
ce548deb9d
|
@ -61,7 +61,7 @@ class ValidationTest extends TestCase
|
|||
|
||||
$fileContents = file_get_contents($testCaseFile);
|
||||
$expectedValues = $this->getExpectedTestValues($testCaseFile, $frameworkName, $fileContents);
|
||||
$actualValues = $this->getActualTestValues($testCaseFile, $fileContents);
|
||||
$actualValues = $this->getActualTestValues($testCaseFile, $frameworkName, $fileContents);
|
||||
|
||||
$this->assertEquals($expectedValues['definitions'], $actualValues['definitions']);
|
||||
|
||||
|
@ -111,14 +111,10 @@ class ValidationTest extends TestCase
|
|||
'definitions' => json_decode(json_encode($expectedDefs))
|
||||
);
|
||||
|
||||
if ($frameworkName === 'broken') {
|
||||
file_put_contents($outputFile, json_encode($refsAndDefs, JSON_PRETTY_PRINT));
|
||||
}
|
||||
|
||||
return $refsAndDefs;
|
||||
}
|
||||
|
||||
private function getActualTestValues($filename, $fileContents): array {
|
||||
private function getActualTestValues($filename, $frameworkName, $fileContents): array {
|
||||
global $parserKind;
|
||||
$parserKind = ParserKind::TOLERANT_PHP_PARSER;
|
||||
|
||||
|
@ -133,12 +129,19 @@ class ValidationTest extends TestCase
|
|||
$this->filterSkippedReferences($actualRefs);
|
||||
$actualDefs = $this->getTestValuesFromDefs($document->getDefinitions());
|
||||
|
||||
// TODO - probably a more PHP-typical way to do this. Need to compare the objects parsed from json files
|
||||
// TODO - there's probably a more PHP-typical way to do this. Need to compare the objects parsed from json files
|
||||
// to the real results. json_decode returns stdClass Objects, not arrays.
|
||||
return array(
|
||||
$refsAndDefs = array(
|
||||
'references' => json_decode(json_encode($actualRefs)),
|
||||
'definitions' => json_decode(json_encode($actualDefs))
|
||||
);
|
||||
|
||||
$outputFile = $filename . '.expected.json';
|
||||
if ($frameworkName === 'broken') {
|
||||
file_put_contents($outputFile, json_encode($refsAndDefs, JSON_PRETTY_PRINT));
|
||||
}
|
||||
|
||||
return $refsAndDefs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
},
|
||||
"containerName": "Fixtures\\Prophecy\\WithReturnTypehints"
|
||||
},
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed",
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Object_",
|
||||
"type": {},
|
||||
"documentation": null
|
||||
},
|
||||
|
@ -94,7 +94,7 @@
|
|||
},
|
||||
"containerName": "Fixtures\\Prophecy\\WithReturnTypehints"
|
||||
},
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed",
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Object_",
|
||||
"type": {},
|
||||
"documentation": null
|
||||
}
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
"references": {
|
||||
"MyNamespace\\PHP_INT_MAX": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/constants5.php"
|
||||
],
|
||||
"PHP_INT_MAX": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/constants5.php"
|
||||
]
|
||||
},
|
||||
"definitions": {
|
||||
|
@ -55,7 +52,7 @@
|
|||
},
|
||||
"containerName": "MyNamespace\\Mbstring"
|
||||
},
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed",
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Object_",
|
||||
"type": {},
|
||||
"documentation": null
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"LanguageServer": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/functionUse2.php"
|
||||
],
|
||||
"LanguageServer\\timeout": [
|
||||
"LanguageServer\\timeout()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/functionUse2.php"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
"MyNamespace\\ClassLoader->prefixesPsr0": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/memberAccess3.php"
|
||||
],
|
||||
"MyNamespace\\ComposerStaticInitIncludePath::$prefixesPsr0": [
|
||||
"MyNamespace\\ComposerStaticInitIncludePath": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/memberAccess3.php"
|
||||
],
|
||||
"MyNamespace\\ComposerStaticInitIncludePath": [
|
||||
"MyNamespace\\ComposerStaticInitIncludePath::$prefixesPsr0": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/memberAccess3.php"
|
||||
],
|
||||
"MyNamespace\\ClassLoader::class": [
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
"MyNamespace2\\MyNamespace1\\B": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/multipleNamespaces.php"
|
||||
],
|
||||
"MyNamespace2\\MyNamespace1": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/multipleNamespaces.php"
|
||||
],
|
||||
"MyNamespace2": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/multipleNamespaces.php"
|
||||
],
|
||||
"MyNamespace2\\A->b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/multipleNamespaces.php"
|
||||
]
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
},
|
||||
"containerName": "Foo"
|
||||
},
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed",
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Object_",
|
||||
"type": {},
|
||||
"documentation": null
|
||||
"documentation": "Foo"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,5 @@
|
|||
{
|
||||
"references": {
|
||||
"static": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/nameToken.php"
|
||||
]
|
||||
},
|
||||
"references": [],
|
||||
"definitions": {
|
||||
"A": {
|
||||
"extends": [],
|
||||
|
|
|
@ -3,17 +3,11 @@
|
|||
"MyNamespace\\B": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/parent3.php"
|
||||
],
|
||||
"MyNamespace\\parent": [
|
||||
"MyNamespace\\B->b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/parent3.php"
|
||||
],
|
||||
"parent": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/parent3.php"
|
||||
],
|
||||
"MyNamespace\\b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/parent3.php"
|
||||
],
|
||||
"b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/parent3.php"
|
||||
]
|
||||
},
|
||||
"definitions": {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"references": {
|
||||
"A::$a": [
|
||||
"A": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/scopedPropertyAccess3.php"
|
||||
],
|
||||
"A": [
|
||||
"A::$a": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/scopedPropertyAccess3.php"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
"TestInterface": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/scopedPropertyAccess5.php"
|
||||
],
|
||||
"TestClass::$testProperty": [
|
||||
"TestClass": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/scopedPropertyAccess5.php"
|
||||
],
|
||||
"TestClass": [
|
||||
"TestClass::$testProperty": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/scopedPropertyAccess5.php"
|
||||
],
|
||||
"TestClass::$staticTestProperty": [
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
"MyNamespace\\B": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/self2.php"
|
||||
],
|
||||
"SELF::b()": [
|
||||
"MyNamespace\\A::b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/self2.php"
|
||||
],
|
||||
"SELF": [
|
||||
"self": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/self2.php"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -3,17 +3,11 @@
|
|||
"MyNamespace\\B": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/self3.php"
|
||||
],
|
||||
"MyNamespace\\self": [
|
||||
"MyNamespace\\A->b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/self3.php"
|
||||
],
|
||||
"self": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/self3.php"
|
||||
],
|
||||
"MyNamespace\\b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/self3.php"
|
||||
],
|
||||
"b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/self3.php"
|
||||
]
|
||||
},
|
||||
"definitions": {
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
"MyNamespace\\B": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/static2.php"
|
||||
],
|
||||
"STATIC::b()": [
|
||||
"MyNamespace\\A::b()": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/static2.php"
|
||||
],
|
||||
"STATIC": [
|
||||
"static": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/static2.php"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{
|
||||
"references": {
|
||||
"B->hi": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/stringVariable.php"
|
||||
]
|
||||
},
|
||||
"references": [],
|
||||
"definitions": {
|
||||
"B": {
|
||||
"extends": [],
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
{
|
||||
"references": {
|
||||
"SomeNamespace\\NameOutsideOfNamespace": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/testQualifiedNameOutsideOfNamespace.php"
|
||||
],
|
||||
"NameOutsideOfNamespace": [
|
||||
"\/Users\/roblou\/code\/php-language-server\/tests\/Validation\/..\/..\/validation\/frameworks\/broken\/testQualifiedNameOutsideOfNamespace.php"
|
||||
]
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"containerName": "Foo"
|
||||
},
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed",
|
||||
"type__class": "phpDocumentor\\Reflection\\Types\\Object_",
|
||||
"type": {},
|
||||
"documentation": null
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue