|
@@ -21,20 +21,40 @@ Changed current directory to <directory>
|
|
|
Then add `<directory>/vendor/bin` to you `PATH` environment variable. Now we're able to use `codecept` from command
|
|
Then add `<directory>/vendor/bin` to you `PATH` environment variable. Now we're able to use `codecept` from command
|
|
|
line globally.
|
|
line globally.
|
|
|
|
|
|
|
|
-2. Build the test suites:
|
|
|
|
|
|
|
+2. Install faker extension by running the following from template root directory where `composer.json` is:
|
|
|
|
|
+
|
|
|
|
|
+```
|
|
|
|
|
+composer require --dev yiisoft/yii2-faker:*
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+3. Create three databases that are used in tests:
|
|
|
|
|
+
|
|
|
|
|
+* `yii2_basic_unit` - for unit tests;
|
|
|
|
|
+* `yii2_basic_functional` - for functional tests;
|
|
|
|
|
+* `yii2_basic_acceptance` - for acceptance tests.
|
|
|
|
|
+
|
|
|
|
|
+Then update databases by applying migrations:
|
|
|
|
|
+
|
|
|
|
|
+```
|
|
|
|
|
+codeception/bin/yii_acceptance migrate
|
|
|
|
|
+codeception/bin/yii_functional migrate
|
|
|
|
|
+codeception/bin/yii_unit migrate
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+4. Build the test suites:
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
codecept build
|
|
codecept build
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-3. In order to be able to run acceptance tests you need to start a webserver. The simplest way is to use PHP built in
|
|
|
|
|
|
|
+5. In order to be able to run acceptance tests you need to start a webserver. The simplest way is to use PHP built in
|
|
|
webserver. In the `web` directory execute the following:
|
|
webserver. In the `web` directory execute the following:
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
php -S localhost:8080
|
|
php -S localhost:8080
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-4. Now you can run the tests with the following commands:
|
|
|
|
|
|
|
+6. Now you can run the tests with the following commands:
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
# run all available tests
|
|
# run all available tests
|