PHP Class ImboUnitTest\Http\Response\ResponseFormatterTest

Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: imbo/imbo

Public Methods

Method Description
getImageResources ( )
getJsonpTriggers ( ) : array[] Get different jsonp triggers
getOriginalMimeTypes ( ) : array[] Get mime types and the expected formatter
setUp ( ) Set up the response formatter
tearDown ( ) Tear down the response
testCanSetAndGetTheFormatter ( )
testCanWrapJsonDataInSpecifiedCallback ( $param, $callback, $contentType, $valid = true )
testDoesNotDoContentNegotiationWhenTheRequestedPathIncludesAnExtension ( )
testDoesNotForceContentNegotiationOnErrorModelsWhenResourceIsNotAnImage ( )
testDoesNotSetResponseContentWhenHttpMethodIsHead ( )
testDoesNotTriggerAnImageConversionWhenTheImageHasTheCorrectMimeType ( )
testForcesContentNegotiationOnErrorModelsWhenResourceIsAnImage ( $routeName )
testPicksThePrioritizedMediaTypeIfMoreThanOneWithSameQualityAreSupportedByTheUserAgent ( )
testReturnWhenStatusCodeIs204 ( )
testReturnWhenThereIsNoModel ( )
testReturnsACorrectEventSubscription ( )
testThrowsAnExceptionInStrictModeWhenTheUserAgentDoesNotSupportAnyOfImbosMediaTypes ( )
testTriggersAConversionTransformationIfNeededWhenTheModelIsAnImage ( )
testUsesDefaultMediaTypeInNonStrictModeWhenTheUserAgentDoesNotSupportAnyMediaTypes ( )
testUsesTheOriginalMimeTypeOfTheImageIfConfigDisablesContentNegotiationForImages ( $originalMimeType, $expectedFormatter )
testUsesTheOriginalMimeTypeOfTheImageIfTheClientHasNoPreference ( $originalMimeType, $expectedFormatter )

Method Details

getImageResources() public method

public getImageResources ( )

getJsonpTriggers() public method

Get different jsonp triggers
public getJsonpTriggers ( ) : array[]
return array[]

getOriginalMimeTypes() public method

Get mime types and the expected formatter
public getOriginalMimeTypes ( ) : array[]
return array[]

setUp() public method

Set up the response formatter
public setUp ( )

tearDown() public method

Tear down the response
public tearDown ( )

testCanSetAndGetTheFormatter() public method

testCanWrapJsonDataInSpecifiedCallback() public method

public testCanWrapJsonDataInSpecifiedCallback ( $param, $callback, $contentType, $valid = true )

testDoesNotDoContentNegotiationWhenTheRequestedPathIncludesAnExtension() public method

testDoesNotForceContentNegotiationOnErrorModelsWhenResourceIsNotAnImage() public method

testDoesNotSetResponseContentWhenHttpMethodIsHead() public method

testDoesNotTriggerAnImageConversionWhenTheImageHasTheCorrectMimeType() public method

testForcesContentNegotiationOnErrorModelsWhenResourceIsAnImage() public method

testPicksThePrioritizedMediaTypeIfMoreThanOneWithSameQualityAreSupportedByTheUserAgent() public method

testReturnWhenStatusCodeIs204() public method

testReturnWhenThereIsNoModel() public method

testReturnsACorrectEventSubscription() public method

testThrowsAnExceptionInStrictModeWhenTheUserAgentDoesNotSupportAnyOfImbosMediaTypes() public method

testTriggersAConversionTransformationIfNeededWhenTheModelIsAnImage() public method

testUsesDefaultMediaTypeInNonStrictModeWhenTheUserAgentDoesNotSupportAnyMediaTypes() public method

testUsesTheOriginalMimeTypeOfTheImageIfConfigDisablesContentNegotiationForImages() public method

testUsesTheOriginalMimeTypeOfTheImageIfTheClientHasNoPreference() public method

public testUsesTheOriginalMimeTypeOfTheImageIfTheClientHasNoPreference ( $originalMimeType, $expectedFormatter )