PHP Class ZendTest\Stratigility\MiddlewarePipeTest

Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: zendframework/zend-stratigility

Public Properties

Property Type Description
$deprecationsSuppressed
$errorHandler

Public Methods

Method Description
createFinalHandler ( ) : NoopFinalHandler
errorMiddleware ( )
invalidHandlers ( )
nestedPaths ( )
restoreErrorHandler ( )
rootPaths ( )
sampleMiddleware ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Used to test that array callables are decorated correctly.
setUp ( )
suppressDeprecationNotice ( )
tearDown ( )
testCanComposeResponsePrototype ( )
testCanEnableRaiseThrowablesFlag ( )
testCanPipeInteropMiddleware ( )
testCanUseDecoratedRequestAndResponseDirectly ( )
testEnablingRaiseThrowablesCausesInvocationToThrowExceptions ( )
testEnablingRaiseThrowablesCausesProcessToThrowExceptions ( )
testHandleInvokesFirstErrorHandlerOnErrorInChain ( )
testHandleInvokesOutHandlerIfQueueIsExhausted ( )
testHandleInvokesUntilFirstHandlerThatDoesNotCallNext ( )
testMiddlewareRequestPathMustBeTrimmedOffWithPipeRoutePath ( )
testMiddlewareTreatsBothSlashAndEmptyPathAsTheRootPath ( $path )
testNestedMiddlewareMatchesOnlyAtPathBoundaries ( $topPath, $nestedPath, $fullPath, $assertion )
testNestedMiddlewareMayInvokeDoneToInvokeNextOfParent ( )
testNoResponsePrototypeComposeByDefault ( )
testOmittingFinalHandlerDuringInvocationRaisesDeprecationNotice ( )
testPassesOriginalResponseToFinalHandler ( ) Test that FinalHandler is passed the original response.
testPipeThrowsExceptionForInvalidHandler ( $handler )
testRaiseThrowablesFlagIsFalseByDefault ( )
testReturnsOrigionalResponseIfQueueDoesNotReturnAResponseAndNoFinalHandlerRegistered ( )
testReturnsResponseReturnedByQueue ( )
testSlashShouldBeAppendedInChildMiddlewareWhenRequestUriIncludesIt ( )
testSlashShouldNotBeAppendedInChildMiddlewareWhenLayerDoesNotIncludeIt ( )
testWillDecorateACallableDefiningADelegateArgumentUsingAlternateDecorator ( )
testWillDecorateCallableArrayMiddlewareWithoutErrors ( )
testWillDecorateCallableMiddlewareAsInteropMiddlewareIfResponsePrototypePresent ( )
testWillNotDecorateCallableErrorMiddlewareDuringPipingEvenWithResponsePrototypePresent ( $middleware )
testWillNotDecorateCallableMiddlewareAsInteropMiddlewareIfResponsePrototypeIsNotPresent ( )

Method Details

createFinalHandler() public method

public createFinalHandler ( ) : NoopFinalHandler
return Zend\Stratigility\NoopFinalHandler

errorMiddleware() public method

public errorMiddleware ( )

invalidHandlers() public method

public invalidHandlers ( )

nestedPaths() public method

public nestedPaths ( )

restoreErrorHandler() public method

public restoreErrorHandler ( )

rootPaths() public method

public rootPaths ( )

sampleMiddleware() public method

Used to test that array callables are decorated correctly.
public sampleMiddleware ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
$next callable
return Psr\Http\Message\ResponseInterface

setUp() public method

public setUp ( )

suppressDeprecationNotice() public method

tearDown() public method

public tearDown ( )

testCanComposeResponsePrototype() public method

testCanEnableRaiseThrowablesFlag() public method

testCanPipeInteropMiddleware() public method

testCanUseDecoratedRequestAndResponseDirectly() public method

testEnablingRaiseThrowablesCausesInvocationToThrowExceptions() public method

testEnablingRaiseThrowablesCausesProcessToThrowExceptions() public method

testHandleInvokesFirstErrorHandlerOnErrorInChain() public method

testHandleInvokesOutHandlerIfQueueIsExhausted() public method

testHandleInvokesUntilFirstHandlerThatDoesNotCallNext() public method

testMiddlewareRequestPathMustBeTrimmedOffWithPipeRoutePath() public method

testMiddlewareTreatsBothSlashAndEmptyPathAsTheRootPath() public method

testNestedMiddlewareMatchesOnlyAtPathBoundaries() public method

public testNestedMiddlewareMatchesOnlyAtPathBoundaries ( $topPath, $nestedPath, $fullPath, $assertion )

testNestedMiddlewareMayInvokeDoneToInvokeNextOfParent() public method

testNoResponsePrototypeComposeByDefault() public method

testOmittingFinalHandlerDuringInvocationRaisesDeprecationNotice() public method

testPassesOriginalResponseToFinalHandler() public method

Tests that MiddlewarePipe passes the original response passed to it when creating the FinalHandler instance, and that FinalHandler compares the response passed to it on invocation to its original response. If the two differ, the response passed during invocation should be returned unmodified; this is an indication that a middleware has provided a response, and is simply passing further up the chain to allow further processing (e.g., to allow an application-wide logger at the end of the request).

testPipeThrowsExceptionForInvalidHandler() public method

testRaiseThrowablesFlagIsFalseByDefault() public method

testReturnsOrigionalResponseIfQueueDoesNotReturnAResponseAndNoFinalHandlerRegistered() public method

testReturnsResponseReturnedByQueue() public method

testSlashShouldBeAppendedInChildMiddlewareWhenRequestUriIncludesIt() public method

testSlashShouldNotBeAppendedInChildMiddlewareWhenLayerDoesNotIncludeIt() public method

testWillDecorateACallableDefiningADelegateArgumentUsingAlternateDecorator() public method

testWillDecorateCallableArrayMiddlewareWithoutErrors() public method

testWillDecorateCallableMiddlewareAsInteropMiddlewareIfResponsePrototypePresent() public method

testWillNotDecorateCallableErrorMiddlewareDuringPipingEvenWithResponsePrototypePresent() public method

testWillNotDecorateCallableMiddlewareAsInteropMiddlewareIfResponsePrototypeIsNotPresent() public method

Property Details

$deprecationsSuppressed public property

public $deprecationsSuppressed

$errorHandler public property

public $errorHandler