Exemplo n.º 1
0
 /**
  * Open files
  */
 function it_open_files(Filesystem $filesystem, FileFactoryContract $fileFactory, File $file)
 {
     $filesystem->read($path = 'MyFile.php')->willReturn($contents = 'Foo contents')->shouldBeCalled();
     $fileFactory->build($contents)->willReturn($file)->shouldBeCalled();
     $this->open($path)->shouldReturn($file);
 }
Exemplo n.º 2
0
 /**
  * @param string $path
  *
  * @return File
  */
 public function open($path)
 {
     $contents = $this->filesystem->read($path);
     return $this->fileFactory->build($contents);
 }