PHP Class Contao\CoreBundle\Test\Image\ImageFactoryTest

Author: Martin Auswöger ([email protected])
Inheritance: extends Contao\CoreBundle\Test\TestCase
Datei anzeigen Open project: contao/core-bundle

Public Methods

Method Description
emptyHookCallback ( ) Returns null.
executeResizeHookCallback ( object $imageObj ) : string Returns a custom image path.
getCreateWithLegacyMode ( ) : array Provides the data for the testCreateWithLegacyMode() method.
getImageHookCallback ( string $originalPath, integer $targetWidth, integer $targetHeight, string $resizeMode, string $cacheName, object $fileObj, string $targetPath, object $imageObj ) : string Returns a custom image path.
tearDown ( )
testCreate ( ) Tests the create() method.
testCreateInvalidExtension ( ) Tests the create() method.
testCreateWithImageObjectAndEmptyResizeConfiguration ( ) Tests the create() method.
testCreateWithImageObjectAndResizeConfiguration ( ) Tests the create() method.
testCreateWithImageSize ( ) Tests the create() method.
testCreateWithLegacyMode ( string $mode, array $expected ) Tests the create() method.
testCreateWithMissingImageSize ( ) Tests the create() method.
testCreateWithoutResize ( ) Tests the create() method.
testEmptyHooks ( ) Tests empty getImage and executeResize hooks.
testExecuteResizeHook ( ) Tests the executeResize hook.
testGetImageHook ( ) Tests the getImage hook.
testGetImportantPartFromLegacyMode ( string $mode, string $expected ) Tests the getImportantPartFromLegacyMode() method.
testGetImportantPartFromLegacyModeInvalidMode ( ) Tests the getImportantPartFromLegacyMode() method throws an exception for invalid resize modes.
testInstantiation ( ) Tests the object instantiation.

Private Methods

Method Description
createImageFactory ( LegacyResizer | null $resizer = null, Imagine\Image\ImagineInterface | null $imagine = null, Imagine\Image\ImagineInterface | null $imagineSvg = null, Symfony\Component\Filesystem\Filesystem | null $filesystem = null, Contao\CoreBundle\Framework\ContaoFrameworkInterface | null $framework = null, boolean $bypassCache = null, array $imagineOptions = null, string $validExtensions = null ) : ImageFactory Create an ImageFactory instance helper.

Method Details

emptyHookCallback() public static method

Returns null.
public static emptyHookCallback ( )

executeResizeHookCallback() public static method

Returns a custom image path.
public static executeResizeHookCallback ( object $imageObj ) : string
$imageObj object The image object
return string The image path

getCreateWithLegacyMode() public method

Provides the data for the testCreateWithLegacyMode() method.
public getCreateWithLegacyMode ( ) : array
return array

getImageHookCallback() public static method

Returns a custom image path.
public static getImageHookCallback ( string $originalPath, integer $targetWidth, integer $targetHeight, string $resizeMode, string $cacheName, object $fileObj, string $targetPath, object $imageObj ) : string
$originalPath string The original path
$targetWidth integer The target width
$targetHeight integer The target height
$resizeMode string The resize mode
$cacheName string The cache name
$fileObj object The file object
$targetPath string The target path
$imageObj object The image object
return string The image path

tearDown() public method

public tearDown ( )

testCreate() public method

Tests the create() method.
public testCreate ( )

testCreateInvalidExtension() public method

Tests the create() method.

testCreateWithImageObjectAndEmptyResizeConfiguration() public method

Tests the create() method.

testCreateWithImageObjectAndResizeConfiguration() public method

Tests the create() method.

testCreateWithImageSize() public method

Tests the create() method.

testCreateWithLegacyMode() public method

Tests the create() method.
public testCreateWithLegacyMode ( string $mode, array $expected )
$mode string
$expected array

testCreateWithMissingImageSize() public method

Tests the create() method.

testCreateWithoutResize() public method

Tests the create() method.

testEmptyHooks() public method

Tests empty getImage and executeResize hooks.
public testEmptyHooks ( )

testExecuteResizeHook() public method

Tests the executeResize hook.

testGetImageHook() public method

Tests the getImage hook.
public testGetImageHook ( )

testGetImportantPartFromLegacyMode() public method

Tests the getImportantPartFromLegacyMode() method.
public testGetImportantPartFromLegacyMode ( string $mode, string $expected )
$mode string
$expected string

testGetImportantPartFromLegacyModeInvalidMode() public method

Tests the getImportantPartFromLegacyMode() method throws an exception for invalid resize modes.

testInstantiation() public method

Tests the object instantiation.
public testInstantiation ( )