PHP Class Contao\CoreBundle\Test\Contao\ImageTest

Inheritance: extends Contao\CoreBundle\Test\TestCase
Datei anzeigen Open project: contao/core-bundle

Public Methods

Method Description
executeResizeHookCallback ( object $imageObj ) : string Returns a custom image path.
getCacheName ( ) : array Provides the data for the testGetCacheName() method.
getComputeResizeDataWithImportantPart ( ) : array Provides the data for the testComputeResizeWithImportantPart() method.
getComputeResizeDataWithoutImportantPart ( ) : array Provides the data for the testComputeResizeWithoutImportantPart() method.
getGetPixelValueData ( ) : array Provides the data for the testGetPixelValue() method.
getImageHookCallback ( string $originalPath, integer $targetWidth, integer $targetHeight, string $resizeMode, string $cacheName, object $fileObj, string $targetPath, object $imageObj ) : string Returns a custom image path.
getLegacyGet ( ) : array Provides the data for the testLegacyGet() method.
getLegacyResize ( ) : array Provides the data for the testLegacyGet() method.
setUpBeforeClass ( )
tearDownAfterClass ( )
testComputeResizeWithImportantPart ( array $arguments, array $expectedResult ) Tests resizing with an important part.
testComputeResizeWithoutImportantPart ( array $arguments, array $expectedResult ) Tests resizing without an important part.
testConstruct ( ) Tests the object instantiation.
testConstructWithInvalidExtension ( ) Tests the object instantiation with an invalid extension.
testConstructWithNonexistentFile ( ) Tests the object instantiation with a non-existent file.
testExecuteResizeHook ( ) Tests the executeResize hook.
testExecuteResizeNoResizeNeeded ( ) Tests resizing an image which already matches the given dimensions.
testExecuteResizeStandardCropResize ( ) Tests resizing an image which has to be cropped.
testExecuteResizeStandardCropResizeAndFileExistsAlready ( ) Tests resizing an image which has to be cropped and has an existing target defined.
testExecuteResizeStandardCropResizeAndTarget ( ) Tests resizing an image which has to be cropped and has a target defined.
testExecuteResizeSvg ( ) Tests resizing an SVG image.
testExecuteResizeSvgPercentageDimensions ( ) Tests resizing an SVG image with percentage based dimensions.
testExecuteResizeSvgWithoutDimensions ( ) Tests resizing an SVG image without dimensions.
testExecuteResizeSvgWithoutViewBox ( ) Tests resizing an SVG image without a view box.
testExecuteResizeSvgWithoutViewBoxAndDimensions ( ) Tests resizing an SVG image without a view box and dimensions.
testExecuteResizeSvgz ( ) Tests resizing an SVGZ image.
testGetCacheName ( array $arguments, string $expectedCacheName ) Tests the getCacheName() method.
testGetDeprecatedInvalidImages ( ) Tests the deprecated methods of the Image class.
testGetImageHook ( ) Tests the getImage hook.
testGetPixelValue ( string $value, integer $expected ) Tests the getPixelValue() method.
testLegacyGet ( array $arguments, array $expectedResult ) Tests the legacy get() method.
testLegacyResize ( array $arguments, array $expectedResult ) Tests the legacy resize() method.
testSetZoomOutOfBoundsNegative ( ) Tests the setZoomLevel() with a negative out of bounds value.
testSetZoomOutOfBoundsPositive ( ) Tests the setZoomLevel() method with a positive out of bounds value.
testSettersAndGetters ( ) Tests the setters and getters.

Protected Methods

Method Description
setUp ( )

Method Details

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

getCacheName() public method

Provides the data for the testGetCacheName() method.
public getCacheName ( ) : array
return array

getComputeResizeDataWithImportantPart() public method

Provides the data for the testComputeResizeWithImportantPart() method.

getComputeResizeDataWithoutImportantPart() public method

Provides the data for the testComputeResizeWithoutImportantPart() method.

getGetPixelValueData() public method

Provides the data for the testGetPixelValue() method.
public getGetPixelValueData ( ) : 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
$targetWidth integer
$targetHeight integer
$resizeMode string
$cacheName string
$fileObj object
$targetPath string
$imageObj object
return string

getLegacyGet() public method

Provides the data for the testLegacyGet() method.
public getLegacyGet ( ) : array
return array

getLegacyResize() public method

Provides the data for the testLegacyGet() method.
public getLegacyResize ( ) : array
return array

setUp() protected method

protected setUp ( )

setUpBeforeClass() public static method

public static setUpBeforeClass ( )

tearDownAfterClass() public static method

public static tearDownAfterClass ( )

testComputeResizeWithImportantPart() public method

Tests resizing with an important part.
public testComputeResizeWithImportantPart ( array $arguments, array $expectedResult )
$arguments array
$expectedResult array

testComputeResizeWithoutImportantPart() public method

Tests resizing without an important part.
public testComputeResizeWithoutImportantPart ( array $arguments, array $expectedResult )
$arguments array
$expectedResult array

testConstruct() public method

Tests the object instantiation.
public testConstruct ( )

testConstructWithInvalidExtension() public method

Tests the object instantiation with an invalid extension.

testConstructWithNonexistentFile() public method

Tests the object instantiation with a non-existent file.

testExecuteResizeHook() public method

Tests the executeResize hook.

testExecuteResizeNoResizeNeeded() public method

Tests resizing an image which already matches the given dimensions.

testExecuteResizeStandardCropResize() public method

Tests resizing an image which has to be cropped.

testExecuteResizeStandardCropResizeAndFileExistsAlready() public method

Tests resizing an image which has to be cropped and has an existing target defined.

testExecuteResizeStandardCropResizeAndTarget() public method

Tests resizing an image which has to be cropped and has a target defined.

testExecuteResizeSvg() public method

Tests resizing an SVG image.

testExecuteResizeSvgPercentageDimensions() public method

Tests resizing an SVG image with percentage based dimensions.

testExecuteResizeSvgWithoutDimensions() public method

Tests resizing an SVG image without dimensions.

testExecuteResizeSvgWithoutViewBox() public method

Tests resizing an SVG image without a view box.

testExecuteResizeSvgWithoutViewBoxAndDimensions() public method

Tests resizing an SVG image without a view box and dimensions.

testExecuteResizeSvgz() public method

Tests resizing an SVGZ image.

testGetCacheName() public method

Tests the getCacheName() method.
public testGetCacheName ( array $arguments, string $expectedCacheName )
$arguments array
$expectedCacheName string

testGetDeprecatedInvalidImages() public method

Tests the deprecated methods of the Image class.

testGetImageHook() public method

Tests the getImage hook.
public testGetImageHook ( )

testGetPixelValue() public method

Tests the getPixelValue() method.
public testGetPixelValue ( string $value, integer $expected )
$value string
$expected integer

testLegacyGet() public method

Tests the legacy get() method.
public testLegacyGet ( array $arguments, array $expectedResult )
$arguments array
$expectedResult array

testLegacyResize() public method

Tests the legacy resize() method.
public testLegacyResize ( array $arguments, array $expectedResult )
$arguments array
$expectedResult array

testSetZoomOutOfBoundsNegative() public method

Tests the setZoomLevel() with a negative out of bounds value.

testSetZoomOutOfBoundsPositive() public method

Tests the setZoomLevel() method with a positive out of bounds value.

testSettersAndGetters() public method

Tests the setters and getters.