Skip to content

Instantly share code, notes, and snippets.

@crmpicco
Created March 3, 2016 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crmpicco/125eceda1adf91d9448f to your computer and use it in GitHub Desktop.
Save crmpicco/125eceda1adf91d9448f to your computer and use it in GitHub Desktop.
it_imports_image_assets
function it_imports_image_assets(
Filesystem $filesystem,
EntityManager $entityManager,
Finder $finder,
SplFileInfo $file1,
SplFileInfo $file2
) {
$imageImportPath = '/var/www/crmpicco/app/files/images/rfc-1872/';
$filesystem->exists($imageImportPath)->willReturn(true);
$finder->files()->shouldBeCalled()->willReturn($finder);
$finder->in($imageImportPath)->willReturn($finder);
$finder->getIterator()->willReturn(new \ArrayIterator([
$file1->getWrappedObject(),
$file2->getWrappedObject(),
]));
$file1->getPathname()->willReturn($imageImportPath.'file1.txt');
$file2->getPathname()->willReturn($imageImportPath.'file1.txt');
$this->importImageAssets($imageImportPath)->shouldReturn([]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment