@@ -53,19 +53,27 @@ public function testIndexingWithDirectFileAccess()
5353 $ promise = new Promise ;
5454 $ input = new MockProtocolStream ;
5555 $ output = new MockProtocolStream ;
56- $ output ->on ('message ' , function (Message $ msg ) use ($ promise ) {
56+ $ cacheVersionCalled = false ;
57+ $ cacheReferenceCalled = false ;
58+ $ output ->on ('message ' , function (Message $ msg ) use ($ promise , &$ cacheVersionCalled , &$ cacheReferenceCalled ) {
5759 if ($ msg ->body ->method === 'window/logMessage ' && $ promise ->state === Promise::PENDING ) {
5860 if ($ msg ->body ->params ->type === MessageType::ERROR ) {
5961 $ promise ->reject (new Exception ($ msg ->body ->params ->message ));
6062 } else if (preg_match ('/All [0-9]+ PHP files parsed/ ' , $ msg ->body ->params ->message )) {
6163 $ promise ->fulfill ();
64+ } else if (preg_match ('#(Storing|Restored) example/example-version:.* (in|from) cache# ' , $ msg ->body ->params ->message )) {
65+ $ cacheVersionCalled = true ;
66+ } else if (preg_match ('#(Storing|Restored) example/example-reference:.* (in|from) cache# ' , $ msg ->body ->params ->message )) {
67+ $ cacheReferenceCalled = true ;
6268 }
6369 }
6470 });
6571 $ server = new LanguageServer ($ input , $ output );
6672 $ capabilities = new ClientCapabilities ;
6773 $ server ->initialize ($ capabilities , realpath (__DIR__ . '/../fixtures ' ), getmypid ());
6874 $ promise ->wait ();
75+ $ this ->assertTrue ($ cacheVersionCalled );
76+ $ this ->assertTrue ($ cacheReferenceCalled );
6977 }
7078
7179 public function testIndexingWithFilesAndContentRequests ()
0 commit comments