diff --git a/tests/Server/ServerTestCase.php b/tests/Server/ServerTestCase.php index bd8e7d8..011fa33 100644 --- a/tests/Server/ServerTestCase.php +++ b/tests/Server/ServerTestCase.php @@ -107,7 +107,7 @@ abstract class ServerTestCase extends TestCase 0 => new Location($symbolsUri, new Range(new Position( 6, 27), new Position( 6, 40))) // class TestClass implements TestInterface ], 'TestNamespace\\TestClass::TEST_CLASS_CONST' => [ - 0 => new Location($referencesUri, new Range(new Position( 9, 16), new Position( 9, 32))) + 0 => new Location($referencesUri, new Range(new Position( 9, 5), new Position( 9, 32))) ], 'TestNamespace\\TestClass::testProperty' => [ 0 => new Location($referencesUri, new Range(new Position( 6, 5), new Position( 6, 23))) @@ -142,7 +142,7 @@ abstract class ServerTestCase extends TestCase 0 => new Location($globalSymbolsUri, new Range(new Position( 6, 27), new Position( 6, 40))) // class TestClass implements TestInterface ], 'TestClass::TEST_CLASS_CONST' => [ - 0 => new Location($globalReferencesUri, new Range(new Position( 9, 16), new Position( 9, 32))) + 0 => new Location($globalReferencesUri, new Range(new Position( 9, 5), new Position( 9, 32))) ], 'TestClass::testProperty' => [ 0 => new Location($globalReferencesUri, new Range(new Position( 6, 5), new Position( 6, 23))) diff --git a/tests/Server/TextDocument/Definition/GlobalTest.php b/tests/Server/TextDocument/Definition/GlobalTest.php index 94f677a..8b80abe 100644 --- a/tests/Server/TextDocument/Definition/GlobalTest.php +++ b/tests/Server/TextDocument/Definition/GlobalTest.php @@ -71,7 +71,7 @@ class GlobalTest extends ServerTestCase // echo TestClass::TEST_CLASS_CONST; // Get definition for TEST_CLASS_CONST $reference = $this->getReferenceLocations('TestClass::TEST_CLASS_CONST')[0]; - $result = $this->textDocument->definition(new TextDocumentIdentifier($reference->uri), $reference->range->start); + $result = $this->textDocument->definition(new TextDocumentIdentifier($reference->uri), $reference->range->end); $this->assertEquals($this->getDefinitionLocation('TestClass::TEST_CLASS_CONST'), $result); } diff --git a/tests/Server/TextDocument/References/GlobalTest.php b/tests/Server/TextDocument/References/GlobalTest.php index 563d17e..ab074e3 100644 --- a/tests/Server/TextDocument/References/GlobalTest.php +++ b/tests/Server/TextDocument/References/GlobalTest.php @@ -22,9 +22,9 @@ class GlobalTest extends ServerTestCase { // const TEST_CLASS_CONST = 123; // Get references for TEST_CLASS_CONST - $definition = $this->getDefinitionLocation('TestClass'); + $definition = $this->getDefinitionLocation('TestClass::TEST_CLASS_CONST'); $result = $this->textDocument->references(new ReferenceContext, new TextDocumentIdentifier($definition->uri), $definition->range->start); - $this->assertEquals($this->getReferenceLocations('TestClass'), $result); + $this->assertEquals($this->getReferenceLocations('TestClass::TEST_CLASS_CONST'), $result); } public function testReferencesForConstants()