Skip to content

Commit 78b8064

Browse files
committed
updated
1 parent 12863b3 commit 78b8064

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

_includes/for.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</div>
77
<div class="col-sm-12 col-lg-6">
88
<a href="/for/joomla" class="btn btn-default btn-lg btn-block">Joomla</a>
9+
<a href="/for/yii" class="btn btn-default btn-lg btn-block">Yii2</a>
910
<a href="#" class="btn btn-default btn-lg btn-block disabled">Zend Framework 2</a>
10-
<a href="#" class="btn btn-default btn-lg btn-block disabled">Yii2</a>
1111

1212
</div>

_layouts/bootstrap.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,16 @@ <h4>Modules</h4>
101101
</a>
102102
<ul class="dropdown-menu">
103103

104-
<li><a href="/for/symfony">Symfony</a></li>
104+
<li><a href="/for/symfony">Symfony</a></li>
105105
<li><a href="/for/laravel">Laravel</a></li>
106+
<li><a href="/for/yii">Yii Framework</a></li>
106107
<li><a href="/for/wordpress">WordPress</a></li>
107108
<li><a href="/for/joomla">Joomla</a></li>
108109
</ul>
109110
</li>
110111

111112
<li class="dropdown">
112-
<a class="dropdown-toggle" data-toggle="dropdown" href="http://phptest.club/category/codeception">
113+
<a class="dropdown-toggle" data-toggle="dropdown" href="http://phptest.club">
113114
Community
114115
<b class="caret"></b>
115116
</a>

for/yii.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,37 @@ Tests also include namespaces for testcase classes and testers to avoid conflict
207207
Learn more about <a href="http://codeception.com/docs/08-Customization#One-Runner-for-Multiple-Applications">testing multiple applications &raquo;</a>
208208
</div>
209209

210-
## Configuration
210+
## Manual Setup && Configuration
211211

212-
It is important to understand how Yii2 module is configured to run the application. The only required parameter for Yii2 is `configFile`. This file with configuration for test environment of Yii application. It should be stored merge original application config overriding `id` value and provide different database for testing:
212+
213+
To start you need to install Codeception via Composer
214+
215+
```
216+
composer require "codeception/codecepton" --dev
217+
```
218+
219+
Create basic test suites
220+
221+
```
222+
composer exec codecept bootstrap
223+
```
224+
225+
Enable module Yii2 for functional tests inside `functional.suite.yml`:
226+
227+
```yml
228+
# fucntional.suite.yml
229+
modules:
230+
enabled:
231+
- Yii2:
232+
configFile: #insert path to config file
233+
```
234+
235+
236+
The only required parameter for Yii2 module is `configFile`. This file with configuration for test configuration of Yii application. It should merge original application config overriding `id` value and provide different database for testing:
213237

214238
```php
215239
<?php
240+
// config/test.php
216241
$config = yii\helpers\ArrayHelper::merge(
217242
require(__DIR__ . '/main.php'),
218243
require(__DIR__ . '/main-local.php'),
@@ -228,7 +253,13 @@ $config = yii\helpers\ArrayHelper::merge(
228253
return $config;
229254
```
230255

231-
It is important to override database configuration so running tests won't affect your development or production database. Test config is recommended to store in `config` folder of application. A relative path to it from `codeception.yml` is required. In basic and advanced applications `configFile` is defined in global configuration file:
256+
Test config is recommended to store in `config` folder of application. You should provide path to test config relatively to `codeception.yml` file.
257+
258+
Please also make sure that `YII_ENV` constant is set to `test` as it is done in `tests/_bootstrap.php` file of basic and advanced app templates.
259+
260+
Once you configured functional tests it should be easy to create setup for unit and acceptance tests, as it is described in this guide.
261+
262+
In basic and advanced application templates `configFile` is defined in global configuration file:
232263

233264
```yml
234265
# inside codeception.yml
@@ -238,6 +269,4 @@ modules:
238269
configFile: 'config/test.php'
239270
```
240271
241-
This way we don't need to provide test config for each defined suite.
242-
243-
Please also make sure that `YII_ENV` constant is set to `test` as it is done in `tests/_bootstrap.php` file of basic and advanced app templates.
272+
This way we don't need to provide test config for each defined suite.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy