From ac891344ddbf7648e89416899dd8a69df6a91e7c Mon Sep 17 00:00:00 2001 From: Cameron Eagans Date: Wed, 1 Feb 2017 18:33:31 -0700 Subject: [PATCH] Add test for #211 --- fixtures/completion/bare_php.php | 5 ++++ tests/Server/TextDocument/CompletionTest.php | 31 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 fixtures/completion/bare_php.php diff --git a/fixtures/completion/bare_php.php b/fixtures/completion/bare_php.php new file mode 100644 index 0000000..36b5ad9 --- /dev/null +++ b/fixtures/completion/bare_php.php @@ -0,0 +1,5 @@ +loader->open($completionUri, file_get_contents($completionUri)); + $items = $this->textDocument->completion( + new TextDocumentIdentifier($completionUri), + new Position(5, 8) + )->wait(); + $this->assertEquals(new CompletionList([ + new CompletionItem( + '$abc', + CompletionItemKind::VARIABLE, + null, + null, + null, + null, + '$abc' + ), + new CompletionItem( + '$abc2', + CompletionItemKind::VARIABLE, + null, + null, + null, + null, + '$abc2' + ), + ], true), $items); + } + }