1
0
Fork 0

Assert that references array is equal, not a subset, and update expected.json files (#395)

pull/393/head^2
Rob Lourens 2017-06-10 01:55:41 -07:00 committed by Felix Becker
parent 42d0c7b714
commit 7b72b38fd9
9 changed files with 45 additions and 10 deletions

View File

@ -64,12 +64,7 @@ class ValidationTest extends TestCase
try {
$this->assertEquals($expectedValues['definitions'], $actualValues['definitions']);
try {
$this->assertArraySubset((array)$expectedValues['references'], (array)$actualValues['references'], false, 'references don\'t match.');
} catch (\Throwable $e) {
$this->assertEquals((array)$expectedValues['references'], (array)$actualValues['references'], 'references don\'t match.');
}
$this->assertEquals((array)$expectedValues['references'], (array)$actualValues['references'], 'references don\'t match.');
} catch (\Throwable $e) {
$outputFile = getExpectedValuesFile($testCaseFile);
file_put_contents($outputFile, json_encode($actualValues, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));

View File

@ -6,6 +6,12 @@
"self": [
"./WithReturnTypehints.php"
],
"Fixtures\\Prophecy\\__CLASS__": [
"./WithReturnTypehints.php"
],
"__CLASS__": [
"./WithReturnTypehints.php"
],
"parent": [
"./WithReturnTypehints.php"
]

View File

@ -1,5 +1,9 @@
{
"references": [],
"references": {
"MyNamespace\\Exception": [
"./exceptions1.php"
]
},
"definitions": {
"MyNamespace": {
"fqn": "MyNamespace",

View File

@ -3,6 +3,9 @@
"LanguageServer": [
"./functionUse2.php"
],
"LanguageServer\\pathToUri()": [
"./functionUse2.php"
],
"LanguageServer\\timeout()": [
"./functionUse2.php"
]

View File

@ -1,5 +1,12 @@
{
"references": [],
"references": {
"B\\__FILE__": [
"./magicConstantsShouldBeGlobal.php"
],
"__FILE__": [
"./magicConstantsShouldBeGlobal.php"
]
},
"definitions": {
"B": {
"fqn": "B",

View File

@ -1,5 +1,9 @@
{
"references": [],
"references": {
"__CLASS__": [
"./magicConsts.php"
]
},
"definitions": {
"A": {
"fqn": "A",

View File

@ -1,5 +1,9 @@
{
"references": [],
"references": {
"MyNamespace\\ParseErrorsTest->args": [
"./memberAccess5.php"
]
},
"definitions": {
"MyNamespace": {
"fqn": "MyNamespace",

View File

@ -2,6 +2,12 @@
"references": {
"LanguageServer": [
"./namespaces8.php"
],
"LanguageServer\\pathToUri()": [
"./namespaces8.php"
],
"LanguageServer\\uriToPath()": [
"./namespaces8.php"
]
},
"definitions": {

View File

@ -6,6 +6,12 @@
"MyNamespace\\A->addTestFile()": [
"./self4.php"
],
"MyNamespace\\__DIR__": [
"./self4.php"
],
"__DIR__": [
"./self4.php"
],
"MyNamespace\\DS": [
"./self4.php"
],