PHP Class Contao\CoreBundle\Test\Contao\ImageTest

Inheritance: extends Contao\CoreBundle\Test\TestCase
Afficher le fichier Open project: contao/core-bundle

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
setUp ( )

Method Details

executeResizeHookCallback() public static méthode

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

getCacheName() public méthode

Provides the data for the testGetCacheName() method.
public getCacheName ( ) : array
Résultat array

getComputeResizeDataWithImportantPart() public méthode

Provides the data for the testComputeResizeWithImportantPart() method.

getComputeResizeDataWithoutImportantPart() public méthode

Provides the data for the testComputeResizeWithoutImportantPart() method.

getGetPixelValueData() public méthode

Provides the data for the testGetPixelValue() method.
public getGetPixelValueData ( ) : array
Résultat array

getImageHookCallback() public static méthode

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
Résultat string

getLegacyGet() public méthode

Provides the data for the testLegacyGet() method.
public getLegacyGet ( ) : array
Résultat array

getLegacyResize() public méthode

Provides the data for the testLegacyGet() method.
public getLegacyResize ( ) : array
Résultat array

setUp() protected méthode

protected setUp ( )

setUpBeforeClass() public static méthode

public static setUpBeforeClass ( )

tearDownAfterClass() public static méthode

public static tearDownAfterClass ( )

testComputeResizeWithImportantPart() public méthode

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

testComputeResizeWithoutImportantPart() public méthode

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

testConstruct() public méthode

Tests the object instantiation.
public testConstruct ( )

testConstructWithInvalidExtension() public méthode

Tests the object instantiation with an invalid extension.

testConstructWithNonexistentFile() public méthode

Tests the object instantiation with a non-existent file.

testExecuteResizeHook() public méthode

Tests the executeResize hook.

testExecuteResizeNoResizeNeeded() public méthode

Tests resizing an image which already matches the given dimensions.

testExecuteResizeStandardCropResize() public méthode

Tests resizing an image which has to be cropped.

testExecuteResizeStandardCropResizeAndFileExistsAlready() public méthode

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

testExecuteResizeStandardCropResizeAndTarget() public méthode

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

testExecuteResizeSvg() public méthode

Tests resizing an SVG image.

testExecuteResizeSvgPercentageDimensions() public méthode

Tests resizing an SVG image with percentage based dimensions.

testExecuteResizeSvgWithoutDimensions() public méthode

Tests resizing an SVG image without dimensions.

testExecuteResizeSvgWithoutViewBox() public méthode

Tests resizing an SVG image without a view box.

testExecuteResizeSvgWithoutViewBoxAndDimensions() public méthode

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

testExecuteResizeSvgz() public méthode

Tests resizing an SVGZ image.

testGetCacheName() public méthode

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

testGetDeprecatedInvalidImages() public méthode

Tests the deprecated methods of the Image class.

testGetImageHook() public méthode

Tests the getImage hook.
public testGetImageHook ( )

testGetPixelValue() public méthode

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

testLegacyGet() public méthode

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

testLegacyResize() public méthode

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

testSetZoomOutOfBoundsNegative() public méthode

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

testSetZoomOutOfBoundsPositive() public méthode

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

testSettersAndGetters() public méthode

Tests the setters and getters.