From e3bcc77485efefaa71e3c3d61169b518d81f911b Mon Sep 17 00:00:00 2001 From: Coen Zimmerman Date: Fri, 11 May 2018 23:23:14 +0200 Subject: [PATCH] Updated variant processor test to handle new copy approach --- tests/Unit/Variant/VariantProcessorTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/Unit/Variant/VariantProcessorTest.php b/tests/Unit/Variant/VariantProcessorTest.php index bae2c99..163c560 100644 --- a/tests/Unit/Variant/VariantProcessorTest.php +++ b/tests/Unit/Variant/VariantProcessorTest.php @@ -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; @@ -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; }