Count runs in tests
parent
8ec1217ad7
commit
f0c82ff41f
|
@ -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,8 +101,11 @@ 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) {
|
||||||
$promise->fulfill();
|
$run++;
|
||||||
|
} else {
|
||||||
|
$promise->fulfill();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue