From f0c82ff41fdef9a11221800c8e2295502eed6fc7 Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Tue, 13 Dec 2016 02:06:44 +0100 Subject: [PATCH] Count runs in tests --- tests/LanguageServerTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/LanguageServerTest.php b/tests/LanguageServerTest.php index d9f0d81..6f8e705 100644 --- a/tests/LanguageServerTest.php +++ b/tests/LanguageServerTest.php @@ -73,7 +73,8 @@ class LanguageServerTest extends TestCase $rootPath = realpath(__DIR__ . '/../fixtures'); $input = new MockProtocolStream; $output = new MockProtocolStream; - $output->on('message', function (Message $msg) use ($promise, $input, $rootPath, &$filesCalled, &$contentCalled) { + $run = 1; + $output->on('message', function (Message $msg) use ($promise, $input, $rootPath, &$filesCalled, &$contentCalled, &$run) { if ($msg->body->method === 'textDocument/xcontent') { // Document content requested $contentCalled = true; @@ -100,8 +101,11 @@ class LanguageServerTest extends TestCase $promise->reject(new Exception($msg->body->params->message)); } } else if (strpos($msg->body->params->message, 'All 25 PHP files parsed') !== false) { - // Indexing finished - $promise->fulfill(); + if ($run === 1) { + $run++; + } else { + $promise->fulfill(); + } } } });