From 2a8d4230b7706024d42cf4541f562e8fcf1edced Mon Sep 17 00:00:00 2001 From: Ukee Date: Fri, 20 Dec 2024 00:53:40 +0100 Subject: [PATCH] Add @part route to amOnRoute method in Yii2 module Solved issue #111 --- src/Codeception/Module/Yii2.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Codeception/Module/Yii2.php b/src/Codeception/Module/Yii2.php index a79af73..bf16657 100644 --- a/src/Codeception/Module/Yii2.php +++ b/src/Codeception/Module/Yii2.php @@ -102,6 +102,7 @@ * * `orm` - include only `haveRecord/grabRecord/seeRecord/dontSeeRecord` actions. * * `fixtures` - use fixtures inside tests with `haveFixtures/grabFixture/grabFixtures` actions. * * `email` - include email actions `seeEmailsIsSent/grabLastSentEmail/...` + * * `route` - include route actions `amOnRoute` * * See [WebDriver module](https://codeception.com/docs/modules/WebDriver#Loading-Parts-from-other-Modules) * for general information on how to load parts of a framework module. @@ -117,7 +118,7 @@ * browser: firefox * - Yii2: * configFile: 'config/test.php' - * part: orm # allow to use AR methods + * part: orm, route # allow to use AR methods and route method * transaction: false # don't wrap test in transaction * cleanup: false # don't cleanup the fixtures * entryScript: index-test.php @@ -422,7 +423,7 @@ protected function rollbackTransactions(): void public function _parts(): array { - return ['orm', 'init', 'fixtures', 'email']; + return ['orm', 'init', 'fixtures', 'email','route']; } /** @@ -679,6 +680,7 @@ protected function findRecord(string $model, array $attributes = []): \yii\db\Ac * * @param string $route A route * @param array $params Additional route parameters + * @part route */ public function amOnRoute(string $route, array $params = []): void {