Download the PHP package stepapo/url-tester without Composer
On this page you can find all versions of the php package stepapo/url-tester. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package url-tester
Request Tester
Request Tester is an extension for Nette Framework used for testing web applications. It validates rendered content based on what path is requested, which user is logged in or what data was submitted through a form. The docs show basic example and explain ways of configurating tests.
Example
Let's define a test for submiting an authorization form on url //example.com/auth
.
Definition
Use tests/config/authorization.neon
to define a test:
Data provider
Use tests/config.php
to collect all test definitions and include them in data provider for Nette Tester:
Test case
Create tests/PresenterTest.php
test case:
Runner setup
Specific URL Tester printer can be used for outputing results instead of basic Nette Tester printer. To do that, create tests/runner-setup.php
:
Run
To run tests use standard Nette Tester command. Make sure testing database is prepared and temp folder is cleared.
Basic command:
$ tester tests
Command with setup:
$ tester --setup tests/runner-setup.php -o none -c tests/php.ini --coverage tests/coverage.html --coverage-src app -j 8 --cider tests
Configuration
NEON files are used to configure test scenarios. They can be separated in following parts.
Test
Test is defined by name
and list of requests
.
Request
Request configuration requires path
and asserts
. Use identity
to specify which user should be logged. Use form
if you want to submit a form. requests
can be used to specify subrequests that inherit parent request configuration and override some of it with their own if needed.
Identity
id
of logged user is required.
Form
Assert
Validating bad request:
Validating what is rendered in browser or not:
Validating result of API call:
All versions of url-tester with dependencies
nette/http Version ^3.2
nette/routing Version ^3.0
nette/tester Version ^2.5
php Version >=8.1