@ -93,6 +93,8 @@ class GeneratorTest extends \Test\TestCase {
$maxPreview = $this -> createMock ( ISimpleFile :: class );
$maxPreview = $this -> createMock ( ISimpleFile :: class );
$maxPreview -> method ( 'getName' )
$maxPreview -> method ( 'getName' )
-> willReturn ( '1000-1000-max.png' );
-> willReturn ( '1000-1000-max.png' );
$maxPreview -> method ( 'getMimeType' )
-> willReturn ( 'image/png' );
$previewFolder -> method ( 'getDirectoryListing' )
$previewFolder -> method ( 'getDirectoryListing' )
-> willReturn ([ $maxPreview ]);
-> willReturn ([ $maxPreview ]);
@ -170,6 +172,7 @@ class GeneratorTest extends \Test\TestCase {
$image -> method ( 'width' ) -> willReturn ( 2048 );
$image -> method ( 'width' ) -> willReturn ( 2048 );
$image -> method ( 'height' ) -> willReturn ( 2048 );
$image -> method ( 'height' ) -> willReturn ( 2048 );
$image -> method ( 'valid' ) -> willReturn ( true );
$image -> method ( 'valid' ) -> willReturn ( true );
$image -> method ( 'dataMimeType' ) -> willReturn ( 'image/png' );
$this -> helper -> method ( 'getThumbnail' )
$this -> helper -> method ( 'getThumbnail' )
-> will ( $this -> returnCallback ( function ( $provider , $file , $x , $y ) use ( $invalidProvider , $validProvider , $image ) {
-> will ( $this -> returnCallback ( function ( $provider , $file , $x , $y ) use ( $invalidProvider , $validProvider , $image ) {
@ -185,6 +188,7 @@ class GeneratorTest extends \Test\TestCase {
$maxPreview = $this -> createMock ( ISimpleFile :: class );
$maxPreview = $this -> createMock ( ISimpleFile :: class );
$maxPreview -> method ( 'getName' ) -> willReturn ( '2048-2048-max.png' );
$maxPreview -> method ( 'getName' ) -> willReturn ( '2048-2048-max.png' );
$maxPreview -> method ( 'getMimeType' ) -> willReturn ( 'image/png' );
$previewFile = $this -> createMock ( ISimpleFile :: class );
$previewFile = $this -> createMock ( ISimpleFile :: class );
@ -219,6 +223,7 @@ class GeneratorTest extends \Test\TestCase {
$image -> method ( 'data' )
$image -> method ( 'data' )
-> willReturn ( 'my resized data' );
-> willReturn ( 'my resized data' );
$image -> method ( 'valid' ) -> willReturn ( true );
$image -> method ( 'valid' ) -> willReturn ( true );
$image -> method ( 'dataMimeType' ) -> willReturn ( 'image/png' );
$previewFile -> expects ( $this -> once ())
$previewFile -> expects ( $this -> once ())
-> method ( 'putContent' )
-> method ( 'putContent' )
@ -362,6 +367,8 @@ class GeneratorTest extends \Test\TestCase {
$maxPreview = $this -> createMock ( ISimpleFile :: class );
$maxPreview = $this -> createMock ( ISimpleFile :: class );
$maxPreview -> method ( 'getName' )
$maxPreview -> method ( 'getName' )
-> willReturn ( $maxX . '-' . $maxY . '-max.png' );
-> willReturn ( $maxX . '-' . $maxY . '-max.png' );
$maxPreview -> method ( 'getMimeType' )
-> willReturn ( 'image/png' );
$previewFolder -> method ( 'getDirectoryListing' )
$previewFolder -> method ( 'getDirectoryListing' )
-> willReturn ([ $maxPreview ]);
-> willReturn ([ $maxPreview ]);
@ -382,6 +389,7 @@ class GeneratorTest extends \Test\TestCase {
$image -> method ( 'height' ) -> willReturn ( $maxY );
$image -> method ( 'height' ) -> willReturn ( $maxY );
$image -> method ( 'width' ) -> willReturn ( $maxX );
$image -> method ( 'width' ) -> willReturn ( $maxX );
$image -> method ( 'valid' ) -> willReturn ( true );
$image -> method ( 'valid' ) -> willReturn ( true );
$image -> method ( 'dataMimeType' ) -> willReturn ( 'image/png' );
$preview = $this -> createMock ( ISimpleFile :: class );
$preview = $this -> createMock ( ISimpleFile :: class );
$previewFolder -> method ( 'newFile' )
$previewFolder -> method ( 'newFile' )