Skip to content

Commit f777b64

Browse files
authored
Add @part route to amOnRoute method in Yii2 module (#113)
1 parent 1ebe6bc commit f777b64

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Codeception/Module/Yii2.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
* * `orm` - include only `haveRecord/grabRecord/seeRecord/dontSeeRecord` actions.
103103
* * `fixtures` - use fixtures inside tests with `haveFixtures/grabFixture/grabFixtures` actions.
104104
* * `email` - include email actions `seeEmailsIsSent/grabLastSentEmail/...`
105+
* * `route` - include route actions `amOnRoute`
105106
*
106107
* See [WebDriver module](https://codeception.com/docs/modules/WebDriver#Loading-Parts-from-other-Modules)
107108
* for general information on how to load parts of a framework module.
@@ -117,7 +118,7 @@
117118
* browser: firefox
118119
* - Yii2:
119120
* configFile: 'config/test.php'
120-
* part: orm # allow to use AR methods
121+
* part: [orm, route] # allow to use AR methods and route method
121122
* transaction: false # don't wrap test in transaction
122123
* cleanup: false # don't cleanup the fixtures
123124
* entryScript: index-test.php
@@ -422,7 +423,7 @@ protected function rollbackTransactions(): void
422423

423424
public function _parts(): array
424425
{
425-
return ['orm', 'init', 'fixtures', 'email'];
426+
return ['orm', 'init', 'fixtures', 'email','route'];
426427
}
427428

428429
/**
@@ -679,6 +680,7 @@ protected function findRecord(string $model, array $attributes = []): \yii\db\Ac
679680
*
680681
* @param string $route A route
681682
* @param array $params Additional route parameters
683+
* @part route
682684
*/
683685
public function amOnRoute(string $route, array $params = []): void
684686
{

0 commit comments

Comments
 (0)