2013-11-15 00:05:09 +08:00
|
|
|
This folder contains various tests for the basic application.
|
|
|
|
These tests are developed with [Codeception PHP Testing Framework](http://codeception.com/).
|
|
|
|
|
2013-12-29 04:04:08 +08:00
|
|
|
After creating the basic application, follow these steps to prepare for the tests:
|
2013-11-15 00:05:09 +08:00
|
|
|
|
2014-02-07 23:58:17 +08:00
|
|
|
1. Install additional composer packages:
|
2014-02-07 23:36:20 +08:00
|
|
|
|
2014-02-07 23:44:28 +08:00
|
|
|
```
|
2014-07-02 19:44:31 +08:00
|
|
|
php composer.phar require --dev "codeception/codeception: 2.0.*" "codeception/specify: *" "codeception/verify: *"
|
2014-02-07 23:44:28 +08:00
|
|
|
```
|
2014-02-07 23:58:17 +08:00
|
|
|
2. In the file `_bootstrap.php`, modify the definition of the constant `TEST_ENTRY_URL` so
|
|
|
|
that it points to the correct entry script URL.
|
2014-02-07 23:44:28 +08:00
|
|
|
3. Go to the application base directory and build the test suites:
|
2013-12-18 00:24:23 +08:00
|
|
|
|
2013-12-17 07:27:33 +08:00
|
|
|
```
|
2013-12-29 04:04:08 +08:00
|
|
|
vendor/bin/codecept build
|
2013-12-17 07:27:33 +08:00
|
|
|
```
|
2013-11-15 00:11:51 +08:00
|
|
|
|
2013-12-29 04:04:08 +08:00
|
|
|
Now you can run the tests with the following commands:
|
|
|
|
|
|
|
|
```
|
|
|
|
# run all available tests
|
|
|
|
vendor/bin/codecept run
|
|
|
|
# run acceptance tests
|
|
|
|
vendor/bin/codecept run acceptance
|
|
|
|
# run functional tests
|
|
|
|
vendor/bin/codecept run functional
|
|
|
|
# run unit tests
|
|
|
|
vendor/bin/codecept run unit
|
|
|
|
```
|
|
|
|
|
2013-11-15 00:11:51 +08:00
|
|
|
Please refer to [Codeception tutorial](http://codeception.com/docs/01-Introduction) for
|
2013-12-29 04:04:08 +08:00
|
|
|
more details about writing and running acceptance, functional and unit tests.
|