Fixed version constraints, adjusted readme, fixed formatting

This commit is contained in:
Alexander Makarov 2016-07-25 23:41:30 +03:00
parent c8c49a8146
commit d7df546502
3 changed files with 34 additions and 24 deletions

View File

@ -106,21 +106,32 @@ return [
TESTING
-------
Tests are located in `tests` directory, 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
Tests are located in `tests` directory. They are developed with [Codeception PHP Testing Framework](http://codeception.com/).
By default there are 3 test suites:
```
composer exec codecept run
```
- `unit`
- `functional`
- `acceptance`
This 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 as they perform testing in real browser.
Tests can be executed by running
```
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:
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
@ -162,8 +173,7 @@ To execute acceptance tests do the following:
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
to collect code coverage. You can run your tests and collect coverage with the following command:
@ -179,4 +189,4 @@ composer exec codecept run unit --coverage-html --coverage-xml
composer exec codecept run functional,unit --coverage-html --coverage-xml
```
You can see code coverage output under the `tests/_output` directory.
You can see code coverage output under the `tests/_output` directory.

View File

@ -12,7 +12,7 @@
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "stable",
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.5",
@ -21,11 +21,11 @@
},
"require-dev": {
"codeception/base": "^2.2.3",
"codeception/verify": "*",
"codeception/verify": "~0.3.1",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*",
"codeception/specify": "*"
"codeception/specify": "~0.4.3"
},
"config": {
"process-timeout": 1800

View File

@ -26,11 +26,11 @@ class ContactFormCest
public function submitFormWithIncorrectEmail(\FunctionalTester $I)
{
$I->submitForm('#contact-form', [
'ContactForm[name]' => 'tester',
'ContactForm[email]' => 'tester.email',
'ContactForm[subject]' => 'test subject',
'ContactForm[body]' => 'test content',
'ContactForm[verifyCode]' => 'testme',
'ContactForm[name]' => 'tester',
'ContactForm[email]' => 'tester.email',
'ContactForm[subject]' => 'test subject',
'ContactForm[body]' => 'test content',
'ContactForm[verifyCode]' => 'testme',
]);
$I->expectTo('see that email address is wrong');
$I->dontSee('Name cannot be blank', '.help-inline');
@ -43,11 +43,11 @@ class ContactFormCest
public function submitFormSuccessfully(\FunctionalTester $I)
{
$I->submitForm('#contact-form', [
'ContactForm[name]' => 'tester',
'ContactForm[email]' => 'tester@example.com',
'ContactForm[subject]' => 'test subject',
'ContactForm[body]' => 'test content',
'ContactForm[verifyCode]' => 'testme',
'ContactForm[name]' => 'tester',
'ContactForm[email]' => 'tester@example.com',
'ContactForm[subject]' => 'test subject',
'ContactForm[body]' => 'test content',
'ContactForm[verifyCode]' => 'testme',
]);
$I->seeEmailIsSent();
$I->dontSeeElement('#contact-form');