1
0
Fork 0

Add more tests

pull/52/head
Felix Becker 2016-10-11 19:13:29 +02:00
parent ff66548b5d
commit a5f8e86095
1 changed files with 69 additions and 64 deletions

View File

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