public function testCopyLocalFileToStorage() { $localFilePath = __DIR__ . '/../Fixtures/testFile/test.txt'; $newFileName = 'test2.txt'; $resultStream = new InMemoryBuffer($this->filesystem, $newFileName); $this->filesystem->expects($this->once())->method('createStream')->with($newFileName)->will($this->returnValue($resultStream)); $this->attachmentManager->copyLocalFileToStorage($localFilePath, $newFileName); $resultStream->open(new StreamMode('rb+')); $resultStream->seek(0); $this->assertEquals('Test data', $resultStream->read(100)); }