Add more tests
parent
ff66548b5d
commit
a5f8e86095
|
@ -186,20 +186,21 @@ class NamespacedTest extends TestCase
|
||||||
|
|
||||||
public function testReferencesForStaticMethods()
|
public function testReferencesForStaticMethods()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
// public static function staticTestMethod()
|
||||||
// TestClass::staticTestMethod();
|
// Get references for staticTestMethod
|
||||||
// Get definition for staticTestMethod
|
$result = $this->textDocument->references(new ReferenceContext, new TextDocumentIdentifier($this->symbolsUri), new Position(12, 35));
|
||||||
$result = $this->textDocument->definition(new TextDocumentIdentifier($this->referencesUri), new Position(7, 20));
|
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
'uri' => $this->symbolsUri,
|
[
|
||||||
|
'uri' => $this->referencesUri,
|
||||||
'range' => [
|
'range' => [
|
||||||
'start' => [
|
'start' => [
|
||||||
'line' => 12,
|
'line' => 7,
|
||||||
'character' => 4
|
'character' => 0
|
||||||
],
|
],
|
||||||
'end' => [
|
'end' => [
|
||||||
'line' => 15,
|
'line' => 7,
|
||||||
'character' => 4
|
'character' => 29
|
||||||
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
], json_decode(json_encode($result), true));
|
], json_decode(json_encode($result), true));
|
||||||
|
@ -207,20 +208,21 @@ class NamespacedTest extends TestCase
|
||||||
|
|
||||||
public function testReferencesForStaticProperties()
|
public function testReferencesForStaticProperties()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
// public static $staticTestProperty;
|
||||||
// echo TestClass::$staticTestProperty;
|
// Get references for $staticTestProperty
|
||||||
// Get definition for staticTestProperty
|
$result = $this->textDocument->references(new ReferenceContext, new TextDocumentIdentifier($this->symbolsUri), new Position(9, 27));
|
||||||
$result = $this->textDocument->definition(new TextDocumentIdentifier($this->referencesUri), new Position(8, 25));
|
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
'uri' => $this->symbolsUri,
|
[
|
||||||
|
'uri' => $this->referencesUri,
|
||||||
'range' => [
|
'range' => [
|
||||||
'start' => [
|
'start' => [
|
||||||
'line' => 9,
|
'line' => 8,
|
||||||
'character' => 18
|
'character' => 5
|
||||||
],
|
],
|
||||||
'end' => [
|
'end' => [
|
||||||
'line' => 9,
|
'line' => 8,
|
||||||
'character' => 36
|
'character' => 35
|
||||||
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
], json_decode(json_encode($result), true));
|
], json_decode(json_encode($result), true));
|
||||||
|
@ -228,20 +230,21 @@ class NamespacedTest extends TestCase
|
||||||
|
|
||||||
public function testReferencesForMethods()
|
public function testReferencesForMethods()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
// public function testMethod($testParameter)
|
||||||
// $obj->testMethod();
|
// Get references for testMethod
|
||||||
// Get definition for testMethod
|
$result = $this->textDocument->references(new ReferenceContext, new TextDocumentIdentifier($this->symbolsUri), new Position(17, 24));
|
||||||
$result = $this->textDocument->definition(new TextDocumentIdentifier($this->referencesUri), new Position(5, 11));
|
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
'uri' => $this->symbolsUri,
|
[
|
||||||
|
'uri' => $this->referencesUri,
|
||||||
'range' => [
|
'range' => [
|
||||||
'start' => [
|
'start' => [
|
||||||
'line' => 17,
|
'line' => 5,
|
||||||
'character' => 4
|
'character' => 0
|
||||||
],
|
],
|
||||||
'end' => [
|
'end' => [
|
||||||
'line' => 20,
|
'line' => 5,
|
||||||
'character' => 4
|
'character' => 18
|
||||||
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
], json_decode(json_encode($result), true));
|
], json_decode(json_encode($result), true));
|
||||||
|
@ -249,41 +252,43 @@ class NamespacedTest extends TestCase
|
||||||
|
|
||||||
public function testReferencesForProperties()
|
public function testReferencesForProperties()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
// public $testProperty;
|
||||||
// echo $obj->testProperty;
|
// Get references for testProperty
|
||||||
// Get definition for testProperty
|
$result = $this->textDocument->references(new ReferenceContext, new TextDocumentIdentifier($this->symbolsUri), new Position(10, 15));
|
||||||
$result = $this->textDocument->definition(new TextDocumentIdentifier($this->referencesUri), new Position(6, 18));
|
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
'uri' => $this->symbolsUri,
|
[
|
||||||
|
'uri' => $this->referencesUri,
|
||||||
'range' => [
|
'range' => [
|
||||||
'start' => [
|
'start' => [
|
||||||
'line' => 10,
|
'line' => 6,
|
||||||
'character' => 11
|
'character' => 5
|
||||||
],
|
],
|
||||||
'end' => [
|
'end' => [
|
||||||
'line' => 10,
|
'line' => 6,
|
||||||
'character' => 23
|
'character' => 23
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
]
|
||||||
], json_decode(json_encode($result), true));
|
], json_decode(json_encode($result), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testReferencesForVariables()
|
public function testReferencesForVariables()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
// $var = 123;
|
||||||
// echo $var;
|
|
||||||
// Get definition for $var
|
// Get definition for $var
|
||||||
$result = $this->textDocument->definition(new TextDocumentIdentifier($this->referencesUri), new Position(13, 7));
|
$result = $this->textDocument->references(new ReferenceContext, new TextDocumentIdentifier($this->referencesUri), new Position(13, 7));
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
|
[
|
||||||
'uri' => $this->referencesUri,
|
'uri' => $this->referencesUri,
|
||||||
'range' => [
|
'range' => [
|
||||||
'start' => [
|
'start' => [
|
||||||
'line' => 12,
|
'line' => 13,
|
||||||
'character' => 0
|
'character' => 5
|
||||||
],
|
],
|
||||||
'end' => [
|
'end' => [
|
||||||
'line' => 12,
|
'line' => 13,
|
||||||
'character' => 9
|
'character' => 8
|
||||||
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
], json_decode(json_encode($result), true));
|
], json_decode(json_encode($result), true));
|
||||||
|
|
Loading…
Reference in New Issue