PHP Класс 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.
Наследование: extends BaseTestCase
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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

Описание методов

authenticateAccount() защищенный Метод

Prepares the environment for and conducts an account authentication
protected authenticateAccount ( Account $account ) : void
$account Neos\Flow\Security\Account
Результат void

authenticateRoles() защищенный Метод

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
Результат Neos\Flow\Security\Account The created account

cleanupPersistentResourcesDirectory() защищенный Метод

Cleans up the directory for storing persistent resources during testing
protected cleanupPersistentResourcesDirectory ( ) : void
Результат void

disableAuthorization() защищенный Метод

Disables authorization for the current test
protected disableAuthorization ( ) : void
Результат void

emitFunctionalTestTearDown() защищенный Метод

Signals that the functional test case has been executed
protected emitFunctionalTestTearDown ( ) : void
Результат void

registerRoute() защищенный Метод

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
Результат Neos\Flow\Mvc\Routing\Route

route() защищенный Метод

protected route ( Request $httpRequest ) : ActionRequest
$httpRequest Neos\Flow\Http\Request
Результат Neos\Flow\Mvc\ActionRequest

setUp() публичный Метод

If you override this method, don't forget to call parent::setUp() in your own implementation.
public setUp ( ) : void
Результат void

setUpBeforeClass() публичный статический Метод

Initialize Flow
public static setUpBeforeClass ( ) : void
Результат void

setupHttp() защищенный Метод

Sets up a virtual browser and web environment for seamless HTTP and MVC related tests.
protected setupHttp ( ) : void
Результат void

setupSecurity() защищенный Метод

Security is based on action requests so we need a working route for the TestingProvider.
protected setupSecurity ( ) : void
Результат void

setupSuperGlobals() защищенный статический Метод

Setup super global PHP variables mocking a standard http request.
protected static setupSuperGlobals ( ) : void
Результат void

tearDown() публичный Метод

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
Результат void

tearDownSecurity() защищенный Метод

Resets security test requirements
protected tearDownSecurity ( ) : void
Результат void

Описание свойств

$authenticationManager защищенное свойство

protected AuthenticationManagerInterface,Neos\Flow\Security\Authentication $authenticationManager
Результат Neos\Flow\Security\Authentication\AuthenticationManagerInterface

$bootstrap защищенное статическое свойство

protected static Bootstrap,Neos\Flow\Core $bootstrap
Результат Neos\Flow\Core\Bootstrap

$browser защищенное свойство

Contains a virtual, preinitialized browser
protected Browser,Neos\Flow\Http\Client $browser
Результат Neos\Flow\Http\Client\Browser

$objectManager защищенное свойство

A functional instance of the Object Manager, for use in concrete test cases.
protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Результат Neos\Flow\ObjectManagement\ObjectManagerInterface

$persistenceManager защищенное свойство

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Результат Neos\Flow\Persistence\PersistenceManagerInterface

$policyService защищенное свойство

protected PolicyService,Neos\Flow\Security\Policy $policyService
Результат Neos\Flow\Security\Policy\PolicyService

$privilegeManager защищенное свойство

protected PrivilegeManagerInterface,Neos\Flow\Security\Authorization $privilegeManager
Результат Neos\Flow\Security\Authorization\PrivilegeManagerInterface

$router защищенное свойство

Contains the router instance used in the browser's request engine
protected Router,Neos\Flow\Mvc\Routing $router
Результат Neos\Flow\Mvc\Routing\Router

$securityContext защищенное свойство

protected Context,Neos\Flow\Security $securityContext
Результат Neos\Flow\Security\Context

$testablePersistenceEnabled защищенное статическое свойство

If enabled, this test case will automatically run the compile() method on the Persistence Manager before running a test.
protected static bool $testablePersistenceEnabled
Результат boolean

$testableSecurityEnabled защищенное свойство

Note: this will implicitly enable testable HTTP as well.
protected bool $testableSecurityEnabled
Результат boolean

$testingProvider защищенное свойство

protected TestingProvider,Neos\Flow\Security\Authentication\Provider $testingProvider
Результат Neos\Flow\Security\Authentication\Provider\TestingProvider