1
0
Fork 0

Count runs in tests

pull/206/head
Felix Becker 2016-12-13 02:06:44 +01:00
parent 8ec1217ad7
commit f0c82ff41f
1 changed files with 7 additions and 3 deletions

View File

@ -73,7 +73,8 @@ class LanguageServerTest extends TestCase
$rootPath = realpath(__DIR__ . '/../fixtures'); $rootPath = realpath(__DIR__ . '/../fixtures');
$input = new MockProtocolStream; $input = new MockProtocolStream;
$output = 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') { if ($msg->body->method === 'textDocument/xcontent') {
// Document content requested // Document content requested
$contentCalled = true; $contentCalled = true;
@ -100,10 +101,13 @@ class LanguageServerTest extends TestCase
$promise->reject(new Exception($msg->body->params->message)); $promise->reject(new Exception($msg->body->params->message));
} }
} else if (strpos($msg->body->params->message, 'All 25 PHP files parsed') !== false) { } else if (strpos($msg->body->params->message, 'All 25 PHP files parsed') !== false) {
// Indexing finished if ($run === 1) {
$run++;
} else {
$promise->fulfill(); $promise->fulfill();
} }
} }
}
}); });
$server = new LanguageServer($input, $output); $server = new LanguageServer($input, $output);
$capabilities = new ClientCapabilities; $capabilities = new ClientCapabilities;