project = new Project(new LanguageClient(new MockProtocolStream())); } public function testGetDocumentCreatesNewDocument() { $document = $this->project->getDocument('file:///document1.php'); $this->assertNotNull($document); $this->assertInstanceOf(PhpDocument::class, $document); } public function testGetDocumentCreatesDocumentOnce() { $document1 = $this->project->getDocument('file:///document1.php'); $document2 = $this->project->getDocument('file:///document1.php'); $this->assertSame($document1, $document2); } }