PHP Class Neos\Flow\Tests\FunctionalTestCase

Subclass this base class if you want to take advantage of the framework capabilities, for example are in need of the object manager.
Inheritance: extends BaseTestCase
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$authenticationManager Neos\Flow\Security\Authentication\AuthenticationManagerInterface
$bootstrap Neos\Flow\Core\Bootstrap
$browser Neos\Flow\Http\Client\Browser Contains a virtual, preinitialized browser
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface A functional instance of the Object Manager, for use in concrete test cases.
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$policyService Neos\Flow\Security\Policy\PolicyService
$privilegeManager Neos\Flow\Security\Authorization\PrivilegeManagerInterface
$router Neos\Flow\Mvc\Routing\Router Contains the router instance used in the browser's request engine
$securityContext Neos\Flow\Security\Context
$testablePersistenceEnabled boolean If enabled, this test case will automatically run the compile() method on the Persistence Manager before running a test.
$testableSecurityEnabled boolean Note: this will implicitly enable testable HTTP as well.
$testingProvider Neos\Flow\Security\Authentication\Provider\TestingProvider

Méthodes publiques

Méthode Description
setUp ( ) : void Sets up test requirements depending on the enabled tests.
setUpBeforeClass ( ) : void Initialize Flow
tearDown ( ) : void Tears down test requirements depending on the enabled tests

Méthodes protégées

Méthode Description
authenticateAccount ( Account $account ) : void Prepares the environment for and conducts an account authentication
authenticateRoles ( array $roleNames ) : Account Creates a new account, assigns it the given roles and authenticates it.
cleanupPersistentResourcesDirectory ( ) : void Cleans up the directory for storing persistent resources during testing
disableAuthorization ( ) : void Disables authorization for the current test
emitFunctionalTestTearDown ( ) : void Signals that the functional test case has been executed
registerRoute ( string $name, string $uriPattern, array $defaults, boolean $appendExceedingArguments = false, array $httpMethods = null ) : Route Adds a route that can be used in the functional tests
route ( Request $httpRequest ) : ActionRequest
setupHttp ( ) : void Sets up a virtual browser and web environment for seamless HTTP and MVC related tests.
setupSecurity ( ) : void Sets up security test requirements
setupSuperGlobals ( ) : void Setup super global PHP variables mocking a standard http request.
tearDownSecurity ( ) : void Resets security test requirements

Method Details

authenticateAccount() protected méthode

Prepares the environment for and conducts an account authentication
protected authenticateAccount ( Account $account ) : void
$account Neos\Flow\Security\Account
Résultat void

authenticateRoles() protected méthode

The created account is returned for further modification, for example for attaching a Party object to it.
protected authenticateRoles ( array $roleNames ) : Account
$roleNames array A list of roles the new account should have
Résultat Neos\Flow\Security\Account The created account

cleanupPersistentResourcesDirectory() protected méthode

Cleans up the directory for storing persistent resources during testing
protected cleanupPersistentResourcesDirectory ( ) : void
Résultat void

disableAuthorization() protected méthode

Disables authorization for the current test
protected disableAuthorization ( ) : void
Résultat void

emitFunctionalTestTearDown() protected méthode

Signals that the functional test case has been executed
protected emitFunctionalTestTearDown ( ) : void
Résultat void

registerRoute() protected méthode

Adds a route that can be used in the functional tests
protected registerRoute ( string $name, string $uriPattern, array $defaults, boolean $appendExceedingArguments = false, array $httpMethods = null ) : Route
$name string Name of the route
$uriPattern string The uriPattern property of the route
$defaults array An array of defaults declarations
$appendExceedingArguments boolean If exceeding arguments may be appended
$httpMethods array An array of accepted http methods
Résultat Neos\Flow\Mvc\Routing\Route

route() protected méthode

protected route ( Request $httpRequest ) : ActionRequest
$httpRequest Neos\Flow\Http\Request
Résultat Neos\Flow\Mvc\ActionRequest

setUp() public méthode

If you override this method, don't forget to call parent::setUp() in your own implementation.
public setUp ( ) : void
Résultat void

setUpBeforeClass() public static méthode

Initialize Flow
public static setUpBeforeClass ( ) : void
Résultat void

setupHttp() protected méthode

Sets up a virtual browser and web environment for seamless HTTP and MVC related tests.
protected setupHttp ( ) : void
Résultat void

setupSecurity() protected méthode

Security is based on action requests so we need a working route for the TestingProvider.
protected setupSecurity ( ) : void
Résultat void

setupSuperGlobals() protected static méthode

Setup super global PHP variables mocking a standard http request.
protected static setupSuperGlobals ( ) : void
Résultat void

tearDown() public méthode

Note: tearDown() is also called if an exception occurred in one of the tests. If the problem is caused by some security or persistence related part of Flow, the error might be hard to track because their specialized tearDown() methods might cause fatal errors. In those cases just output the original exception message by adding an echo($this->statusMessage) as the first line of this method.
public tearDown ( ) : void
Résultat void

tearDownSecurity() protected méthode

Resets security test requirements
protected tearDownSecurity ( ) : void
Résultat void

Property Details

$authenticationManager protected_oe property

protected AuthenticationManagerInterface,Neos\Flow\Security\Authentication $authenticationManager
Résultat Neos\Flow\Security\Authentication\AuthenticationManagerInterface

$bootstrap protected_oe static_oe property

protected static Bootstrap,Neos\Flow\Core $bootstrap
Résultat Neos\Flow\Core\Bootstrap

$browser protected_oe property

Contains a virtual, preinitialized browser
protected Browser,Neos\Flow\Http\Client $browser
Résultat Neos\Flow\Http\Client\Browser

$objectManager protected_oe property

A functional instance of the Object Manager, for use in concrete test cases.
protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Résultat Neos\Flow\ObjectManagement\ObjectManagerInterface

$persistenceManager protected_oe property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Résultat Neos\Flow\Persistence\PersistenceManagerInterface

$policyService protected_oe property

protected PolicyService,Neos\Flow\Security\Policy $policyService
Résultat Neos\Flow\Security\Policy\PolicyService

$privilegeManager protected_oe property

protected PrivilegeManagerInterface,Neos\Flow\Security\Authorization $privilegeManager
Résultat Neos\Flow\Security\Authorization\PrivilegeManagerInterface

$router protected_oe property

Contains the router instance used in the browser's request engine
protected Router,Neos\Flow\Mvc\Routing $router
Résultat Neos\Flow\Mvc\Routing\Router

$securityContext protected_oe property

protected Context,Neos\Flow\Security $securityContext
Résultat Neos\Flow\Security\Context

$testablePersistenceEnabled protected_oe static_oe property

If enabled, this test case will automatically run the compile() method on the Persistence Manager before running a test.
protected static bool $testablePersistenceEnabled
Résultat boolean

$testableSecurityEnabled protected_oe property

Note: this will implicitly enable testable HTTP as well.
protected bool $testableSecurityEnabled
Résultat boolean

$testingProvider protected_oe property

protected TestingProvider,Neos\Flow\Security\Authentication\Provider $testingProvider
Résultat Neos\Flow\Security\Authentication\Provider\TestingProvider