/** * File changes are made in memory only, until this methods actually applies * them on the filesystem. * * @param File $file * * @throws \Symfony\Component\Filesystem\Exception\IOException If the file cannot be written to. * * @api */ public function save(File $file, $filename = null) { if ($filename !== null) { $file->setFilename($filename); } $this->filesystem->write($file); }
function it_saves_files(Filesystem $filesystem, File $file) { $filesystem->write($file)->shouldBeCalled(); $this->save($file); }