From 1d5ee25939c61792d8d3754d42b5b6aed4780baf Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Mon, 10 Oct 2016 14:12:11 +0200 Subject: [PATCH] Add test for didClose --- tests/Server/TextDocument/DidCloseTest.php | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/Server/TextDocument/DidCloseTest.php diff --git a/tests/Server/TextDocument/DidCloseTest.php b/tests/Server/TextDocument/DidCloseTest.php new file mode 100644 index 0000000..f473ace --- /dev/null +++ b/tests/Server/TextDocument/DidCloseTest.php @@ -0,0 +1,34 @@ +getDocument('whatever'); + $phpDocument->updateContent('hello world'); + + $textDocumentItem = new TextDocumentItem(); + $textDocumentItem->uri = 'whatever'; + $textDocumentItem->languageId = 'php'; + $textDocumentItem->version = 1; + $textDocumentItem->text = 'hello world'; + $textDocument->didOpen($textDocumentItem); + + $textDocument->didClose(new TextDocumentIdentifier($textDocumentItem->uri)); + + $this->expectException(Exception::class); + $phpDocument->getContent(); + } +}