add FileEvent constructor, fix formatting
parent
616d74cc3f
commit
fc19640bab
|
@ -20,4 +20,14 @@ class FileEvent
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $type;
|
public $type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $uri
|
||||||
|
* @param int $type
|
||||||
|
*/
|
||||||
|
public function __construct(string $uri, int $type)
|
||||||
|
{
|
||||||
|
$this->uri = $uri;
|
||||||
|
$this->type = $type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,12 +22,10 @@ class DidChangeWatchedFilesTest extends ServerTestCase
|
||||||
$loader = new PhpDocumentLoader(new FileSystemContentRetriever(), $projectIndex, $definitionResolver);
|
$loader = new PhpDocumentLoader(new FileSystemContentRetriever(), $projectIndex, $definitionResolver);
|
||||||
$workspace = new Server\Workspace($client, $projectIndex, $dependenciesIndex, $sourceIndex, null, $loader, null);
|
$workspace = new Server\Workspace($client, $projectIndex, $dependenciesIndex, $sourceIndex, null, $loader, null);
|
||||||
|
|
||||||
$fileEvent = new FileEvent();
|
$fileEvent = new FileEvent('my uri', FileChangeType::DELETED);
|
||||||
$fileEvent->uri = 'my uri';
|
|
||||||
$fileEvent->type = FileChangeType::DELETED;
|
|
||||||
|
|
||||||
$isDiagnosticsCleared = false;
|
$isDiagnosticsCleared = false;
|
||||||
$writer->on('message', function (Message $message) use ($fileEvent, & $isDiagnosticsCleared) {
|
$writer->on('message', function (Message $message) use ($fileEvent, &$isDiagnosticsCleared) {
|
||||||
if ($message->body->method === "textDocument/publishDiagnostics") {
|
if ($message->body->method === "textDocument/publishDiagnostics") {
|
||||||
$this->assertEquals($message->body->params->uri, $fileEvent->uri);
|
$this->assertEquals($message->body->params->uri, $fileEvent->uri);
|
||||||
$this->assertEquals($message->body->params->diagnostics, []);
|
$this->assertEquals($message->body->params->diagnostics, []);
|
||||||
|
|
Loading…
Reference in New Issue