Skip to content

Commit

Permalink
Updated variant processor test to handle new copy approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Coen Zimmerman committed May 11, 2018
1 parent 324fb87 commit e3bcc77
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Unit/Variant/VariantProcessorTest.php
Expand Up @@ -9,6 +9,7 @@
use Czim\FileHandling\Exceptions\VariantStrategyShouldNotBeAppliedException;
use Czim\FileHandling\Test\TestCase;
use Czim\FileHandling\Variant\VariantProcessor;
use Hamcrest\Matchers;
use Mockery;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
Expand Down Expand Up @@ -194,6 +195,13 @@ protected function makeMockSourceStorableFile($tmpPath, $mimeType = 'text/plain'
$source->shouldReceive('name')->andReturn(pathinfo($tmpPath, PATHINFO_BASENAME));
$source->shouldReceive('extension')->andReturn(pathinfo($tmpPath, PATHINFO_EXTENSION));

$source->shouldReceive('copy')->once()
->with(Matchers::nonEmptyString())
->andReturnUsing(function ($path) {
file_put_contents($path, 'dummy contents');
return true;
});

return $source;
}

Expand Down

0 comments on commit e3bcc77

Please sign in to comment.