AbstractControllerTestCase

extends PHPUnit\Framework\TestCase

Known subclasses

Omeka\Test\AbstractHttpControllerTestCase, Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase
Abstract
Open source code
Methods Summary
protected
# setUp( )
Reset the application for isolation

Overrides

protected
protected
# createFailureMessage( string $message )
Create a failure message. If $traceError is true, appends exception details, if any.
public
# getTraceError( )
Get the trace error flag
public
# setTraceError( bool $traceError )
Set the trace error flag
public
# getUseConsoleRequest( )
Get the usage of the console router or not
public
# setUseConsoleRequest( bool $boolean )
Set the usage of the console router or not
public
# getApplicationConfig( )
Get the application config
public
# setApplicationConfig( array $applicationConfig )
Set the application config
public
# getApplication( )
Get the application object
public
# getApplicationServiceLocator( )
Get the service manager of the application object
public
# getRequest( )
Get the application request object
public
# getResponse( )
Get the application response object
public
# url( string $url , string|null $method = 'GET', array|null $params = array ( ) )
Set the request URL
public
# dispatch( string $url , string|null $method = NULL, array|null $params = array ( ), $isXmlHttpRequest = false )
Dispatch the MVC with a URL Accept a HTTP (simulate a customer action) or console route. The URL provided set the request URI in the request object.
public
# reset( $keepPersistence = false )
Reset the request
public
# triggerApplicationEvent( string $eventName )
Trigger an application event
public
# assertModulesLoaded( array $modules )
Assert modules were loaded with the module manager
public
# assertNotModulesLoaded( array $modules )
Assert modules were not loaded with the module manager
protected
# getResponseStatusCode( )
Retrieve the response status code
public
# assertResponseStatusCode( int $code )
Assert response status code
public
# assertNotResponseStatusCode( int $code )
Assert not response status code
public
# assertApplicationException( $type , $message = NULL )
Assert the application exception and message
protected
# getControllerFullClassName( )
Get the full current controller class name
public
# assertModuleName( string $module )
Assert that the application route match used the given module
public
# assertNotModuleName( string $module )
Assert that the application route match used NOT the given module
public
# assertControllerClass( string $controller )
Assert that the application route match used the given controller class
public
# assertNotControllerClass( string $controller )
Assert that the application route match used NOT the given controller class
public
# assertControllerName( string $controller )
Assert that the application route match used the given controller name
public
# assertNotControllerName( string $controller )
Assert that the application route match used NOT the given controller name
public
# assertActionName( string $action )
Assert that the application route match used the given action
public
# assertNotActionName( string $action )
Assert that the application route match used NOT the given action
public
# assertMatchedRouteName( string $route )
Assert that the application route match used the given route name
public
# assertNotMatchedRouteName( string $route )
Assert that the application route match used NOT the given route name
public
# assertNoMatchedRoute( )
Assert that the application did not match any route
public
# assertTemplateName( string $templateName )
Assert template name Assert that a template was used somewhere in the view model tree
public
# assertNotTemplateName( string $templateName )
Assert not template name Assert that a template was not used somewhere in the view model tree
protected
# searchTemplates( \Zend\View\Model\ModelInterface $viewModel , string $templateName )
Recursively search a view model and it's children for the given templateName
Methods inherited from PHPUnit\Framework\TestCase
Methods inherited from PHPUnit_Framework_TestCase
__construct(), toString(), count(), getAnnotations(), getName(), getSize(), getActualOutput(), hasOutput(), expectOutputRegex(), expectOutputString(), hasPerformedExpectationsOnOutput(), hasExpectationOnOutput(), getExpectedException(), setExpectedException(), setExpectedExceptionRegExp(), setExpectedExceptionFromAnnotation(), setUseErrorHandler(), setUseErrorHandlerFromAnnotation(), checkRequirements(), getStatus(), getStatusMessage(), hasFailed(), run(), runBare(), runTest(), verifyMockObjects(), setName(), setDependencies(), hasDependencies(), setDependencyInput(), setDisallowChangesToGlobalState(), setBackupGlobals(), setBackupStaticAttributes(), setRunTestInSeparateProcess(), setPreserveGlobalState(), setInIsolation(), isInIsolation(), getResult(), setResult(), setOutputCallback(), getTestResultObject(), setTestResultObject(), iniSet(), setLocale(), getMock(), getMockBuilder(), getMockClass(), getMockForAbstractClass(), getMockFromWsdl(), getMockForTrait(), getObjectForTrait(), prophesize(), addToAssertionCount(), getNumAssertions(), any(), never(), atLeast(), atLeastOnce(), once(), exactly(), atMost(), at(), returnValue(), returnValueMap(), returnArgument(), returnCallback(), returnSelf(), throwException(), onConsecutiveCalls(), getDataSetAsString(), createResult(), handleDependencies(), setUpBeforeClass(), setUp(), assertPreConditions(), assertPostConditions(), tearDown(), tearDownAfterClass(), onNotSuccessfulTest(), prepareTemplate(), getMockObjectGenerator()
Methods inherited from PHPUnit_Framework_Assert
assertArrayHasKey(), assertArraySubset(), assertArrayNotHasKey(), assertContains(), assertAttributeContains(), assertNotContains(), assertAttributeNotContains(), assertContainsOnly(), assertContainsOnlyInstancesOf(), assertAttributeContainsOnly(), assertNotContainsOnly(), assertAttributeNotContainsOnly(), assertCount(), assertAttributeCount(), assertNotCount(), assertAttributeNotCount(), assertEquals(), assertAttributeEquals(), assertNotEquals(), assertAttributeNotEquals(), assertEmpty(), assertAttributeEmpty(), assertNotEmpty(), assertAttributeNotEmpty(), assertGreaterThan(), assertAttributeGreaterThan(), assertGreaterThanOrEqual(), assertAttributeGreaterThanOrEqual(), assertLessThan(), assertAttributeLessThan(), assertLessThanOrEqual(), assertAttributeLessThanOrEqual(), assertFileEquals(), assertFileNotEquals(), assertStringEqualsFile(), assertStringNotEqualsFile(), assertFileExists(), assertFileNotExists(), assertTrue(), assertNotTrue(), assertFalse(), assertNotFalse(), assertNotNull(), assertNull(), assertClassHasAttribute(), assertClassNotHasAttribute(), assertClassHasStaticAttribute(), assertClassNotHasStaticAttribute(), assertObjectHasAttribute(), assertObjectNotHasAttribute(), assertSame(), assertAttributeSame(), assertNotSame(), assertAttributeNotSame(), assertInstanceOf(), assertAttributeInstanceOf(), assertNotInstanceOf(), assertAttributeNotInstanceOf(), assertInternalType(), assertAttributeInternalType(), assertNotInternalType(), assertAttributeNotInternalType(), assertRegExp(), assertNotRegExp(), assertSameSize(), assertNotSameSize(), assertStringMatchesFormat(), assertStringNotMatchesFormat(), assertStringMatchesFormatFile(), assertStringNotMatchesFormatFile(), assertStringStartsWith(), assertStringStartsNotWith(), assertStringEndsWith(), assertStringEndsNotWith(), assertXmlFileEqualsXmlFile(), assertXmlFileNotEqualsXmlFile(), assertXmlStringEqualsXmlFile(), assertXmlStringNotEqualsXmlFile(), assertXmlStringEqualsXmlString(), assertXmlStringNotEqualsXmlString(), assertEqualXMLStructure(), assertSelectCount(), assertSelectRegExp(), assertSelectEquals(), assertTag(), assertNotTag(), assertThat(), assertJson(), assertJsonStringEqualsJsonString(), assertJsonStringNotEqualsJsonString(), assertJsonStringEqualsJsonFile(), assertJsonStringNotEqualsJsonFile(), assertJsonFileNotEqualsJsonFile(), assertJsonFileEqualsJsonFile(), logicalAnd(), logicalOr(), logicalNot(), logicalXor(), anything(), isTrue(), callback(), isFalse(), isJson(), isNull(), attribute(), contains(), containsOnly(), containsOnlyInstancesOf(), arrayHasKey(), equalTo(), attributeEqualTo(), isEmpty(), fileExists(), greaterThan(), greaterThanOrEqual(), classHasAttribute(), classHasStaticAttribute(), objectHasAttribute(), identicalTo(), isInstanceOf(), isType(), lessThan(), lessThanOrEqual(), matchesRegularExpression(), matches(), stringStartsWith(), stringContains(), stringEndsWith(), countOf(), fail(), readAttribute(), getStaticAttribute(), getObjectAttribute(), markTestIncomplete(), markTestSkipped(), getCount(), resetCount()
Properties Summary
protected Zend\Mvc\ApplicationInterface $application
# NULL
protected array $applicationConfig
# NULL
protected bool $useConsoleRequest
Flag to use console router or not
# false
protected bool $usedConsoleBackup
Flag console used before tests
# NULL
protected bool $traceError
Trace error when exception is throwed in application
# true
Properties inherited from PHPUnit_Framework_TestCase
$backupGlobals, $backupGlobalsBlacklist, $backupStaticAttributes, $backupStaticAttributesBlacklist, $runTestInSeparateProcess, $preserveGlobalState