Download the PHP package krajcik/nette-tester-extension without Composer
On this page you can find all versions of the php package krajcik/nette-tester-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download krajcik/nette-tester-extension
More information about krajcik/nette-tester-extension
Files in krajcik/nette-tester-extension
Package nette-tester-extension
Short Description Extension library for nette tester.
License BSD-3-Clause GPL-2.0 GPL-3.0
Informations about the package nette-tester-extension
Nette tester extension
Easy testing of presenters
Library contains class BasePresenterTester which provide following methods:
- checkRequestNoError - expect that some action of presenter is without error
- checkRequestError - expect that some action of presenter throw error
- checkRedirectTo - expect that some action of presenter return redirect
Authenticator
In default ever request are sent as from unlogged user. If we want test behavior of action when is some user logged in, we can use parameters "$userId" etc. which provide all check methods. We do not need to know password of user. Simply say that we want be logged in as user with id "$userId*".
Default role of logged user is 'admin'. For change role use parameter "$userRole"
Example in practice
!!! Important recomended: Before start tests clear cache !!!
For each presenter to test must be created separated class
Multiple presenter tester in one test
All versions of nette-tester-extension with dependencies
nette/nette Version >= 2.3.0
nette/utils Version >= 2.4.0
nette/tester Version >=1.5.6