/** * Save files */ function it_save_files(File $file, Filesystem $filesystem, GeneratorContract $generator) { $generator->generate($file)->willReturn($code = 'foo')->shouldBeCalled(); $filesystem->put('MyFile.php', $code); $this->save($file, 'MyFile.php'); }
/** * @param File $file * @param string $path */ public function save(File $file, $path) { $code = $this->generator->generate($file); $this->filesystem->put($path, $code); }