Fixed version constraints, adjusted readme, fixed formatting
This commit is contained in:
parent
c8c49a8146
commit
d7df546502
30
README.md
30
README.md
@ -106,21 +106,32 @@ return [
|
|||||||
TESTING
|
TESTING
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Tests are located in `tests` directory, developed with [Codeception PHP Testing Framework](http://codeception.com/).
|
Tests are located in `tests` directory. They are developed with [Codeception PHP Testing Framework](http://codeception.com/).
|
||||||
By default there are 3 test suites: `unit`, `functional` and `acceptance`. Tests can be executed by running
|
By default there are 3 test suites:
|
||||||
|
|
||||||
```
|
- `unit`
|
||||||
composer exec codecept run
|
- `functional`
|
||||||
```
|
- `acceptance`
|
||||||
|
|
||||||
This will execute unit and functional tests. Unit tests are testing the system components, while functional tests are for testing user interaction.
|
Tests can be executed by running
|
||||||
Acceptance tests are disabled by default as they require additional setup as they perform testing in real browser.
|
|
||||||
|
```
|
||||||
|
composer exec codecept run
|
||||||
|
```
|
||||||
|
|
||||||
|
The command above will execute unit and functional tests. Unit tests are testing the system components, while functional
|
||||||
|
tests are for testing user interaction. Acceptance tests are disabled by default as they require additional setup since
|
||||||
|
they perform testing in real browser.
|
||||||
|
|
||||||
|
|
||||||
|
### Running acceptance tests
|
||||||
|
|
||||||
To execute acceptance tests do the following:
|
To execute acceptance tests do the following:
|
||||||
|
|
||||||
1. Rename `tests/acceptance.suite.yml.example` to `tests/acceptance.suite.yml` to enable suite configuration
|
1. Rename `tests/acceptance.suite.yml.example` to `tests/acceptance.suite.yml` to enable suite configuration
|
||||||
|
|
||||||
2. Replace `codeception/base` package in `composer.json` with `codeception/codeception` to install full featured version of Codeception.
|
2. Replace `codeception/base` package in `composer.json` with `codeception/codeception` to install full featured
|
||||||
|
version of Codeception
|
||||||
|
|
||||||
3. Update dependencies with Composer
|
3. Update dependencies with Composer
|
||||||
|
|
||||||
@ -162,8 +173,7 @@ To execute acceptance tests do the following:
|
|||||||
composer exec codecept run unit,functional
|
composer exec codecept run unit,functional
|
||||||
```
|
```
|
||||||
|
|
||||||
Code coverage support
|
### Code coverage support
|
||||||
---------------------
|
|
||||||
|
|
||||||
By default, code coverage is disabled in `codeception.yml` configuration file, you should uncomment needed rows to be able
|
By default, code coverage is disabled in `codeception.yml` configuration file, you should uncomment needed rows to be able
|
||||||
to collect code coverage. You can run your tests and collect coverage with the following command:
|
to collect code coverage. You can run your tests and collect coverage with the following command:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"irc": "irc://irc.freenode.net/yii",
|
"irc": "irc://irc.freenode.net/yii",
|
||||||
"source": "https://github.com/yiisoft/yii2"
|
"source": "https://github.com/yiisoft/yii2"
|
||||||
},
|
},
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "dev",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.4.0",
|
"php": ">=5.4.0",
|
||||||
"yiisoft/yii2": ">=2.0.5",
|
"yiisoft/yii2": ">=2.0.5",
|
||||||
@ -21,11 +21,11 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"codeception/base": "^2.2.3",
|
"codeception/base": "^2.2.3",
|
||||||
"codeception/verify": "*",
|
"codeception/verify": "~0.3.1",
|
||||||
"yiisoft/yii2-debug": "*",
|
"yiisoft/yii2-debug": "*",
|
||||||
"yiisoft/yii2-gii": "*",
|
"yiisoft/yii2-gii": "*",
|
||||||
"yiisoft/yii2-faker": "*",
|
"yiisoft/yii2-faker": "*",
|
||||||
"codeception/specify": "*"
|
"codeception/specify": "~0.4.3"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"process-timeout": 1800
|
"process-timeout": 1800
|
||||||
|
@ -26,11 +26,11 @@ class ContactFormCest
|
|||||||
public function submitFormWithIncorrectEmail(\FunctionalTester $I)
|
public function submitFormWithIncorrectEmail(\FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->submitForm('#contact-form', [
|
$I->submitForm('#contact-form', [
|
||||||
'ContactForm[name]' => 'tester',
|
'ContactForm[name]' => 'tester',
|
||||||
'ContactForm[email]' => 'tester.email',
|
'ContactForm[email]' => 'tester.email',
|
||||||
'ContactForm[subject]' => 'test subject',
|
'ContactForm[subject]' => 'test subject',
|
||||||
'ContactForm[body]' => 'test content',
|
'ContactForm[body]' => 'test content',
|
||||||
'ContactForm[verifyCode]' => 'testme',
|
'ContactForm[verifyCode]' => 'testme',
|
||||||
]);
|
]);
|
||||||
$I->expectTo('see that email address is wrong');
|
$I->expectTo('see that email address is wrong');
|
||||||
$I->dontSee('Name cannot be blank', '.help-inline');
|
$I->dontSee('Name cannot be blank', '.help-inline');
|
||||||
@ -43,11 +43,11 @@ class ContactFormCest
|
|||||||
public function submitFormSuccessfully(\FunctionalTester $I)
|
public function submitFormSuccessfully(\FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->submitForm('#contact-form', [
|
$I->submitForm('#contact-form', [
|
||||||
'ContactForm[name]' => 'tester',
|
'ContactForm[name]' => 'tester',
|
||||||
'ContactForm[email]' => 'tester@example.com',
|
'ContactForm[email]' => 'tester@example.com',
|
||||||
'ContactForm[subject]' => 'test subject',
|
'ContactForm[subject]' => 'test subject',
|
||||||
'ContactForm[body]' => 'test content',
|
'ContactForm[body]' => 'test content',
|
||||||
'ContactForm[verifyCode]' => 'testme',
|
'ContactForm[verifyCode]' => 'testme',
|
||||||
]);
|
]);
|
||||||
$I->seeEmailIsSent();
|
$I->seeEmailIsSent();
|
||||||
$I->dontSeeElement('#contact-form');
|
$I->dontSeeElement('#contact-form');
|
||||||
|
Loading…
Reference in New Issue
Block a user