From b829d9d45a18c3c6ee242473dd3c5f28b81424b4 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 28 Oct 2014 02:03:02 +0300 Subject: [PATCH] Fixes #4827: default config for functional tests of both basic and advanced app now turns off CSRF validation while providing commented out alternative setting cookie domain to localhost --- .../tests/codeception/config/functional.php | 13 ++++++++++++- apps/basic/tests/codeception/config/functional.php | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/apps/advanced/tests/codeception/config/functional.php b/apps/advanced/tests/codeception/config/functional.php index 1778b1cc04..c893ea24a7 100644 --- a/apps/advanced/tests/codeception/config/functional.php +++ b/apps/advanced/tests/codeception/config/functional.php @@ -3,5 +3,16 @@ * Application configuration shared by all applications functional tests */ return [ - + 'components' => [ + 'request' => [ + // it's not recommended to run functional tests with CSRF validation enabled + 'enableCsrfValidation' => false, + // but if you absolutely need it set cookie domain to localhost + /* + 'csrfCookie' => [ + 'domain' => 'localhost', + ], + */ + ], + ], ]; \ No newline at end of file diff --git a/apps/basic/tests/codeception/config/functional.php b/apps/basic/tests/codeception/config/functional.php index 499ad5a9c9..6d22bd97ba 100644 --- a/apps/basic/tests/codeception/config/functional.php +++ b/apps/basic/tests/codeception/config/functional.php @@ -9,6 +9,17 @@ return yii\helpers\ArrayHelper::merge( require(__DIR__ . '/../../../config/web.php'), require(__DIR__ . '/config.php'), [ - + 'components' => [ + 'request' => [ + // it's not recommended to run functional tests with CSRF validation enabled + 'enableCsrfValidation' => false, + // but if you absolutely need it set cookie domain to localhost + /* + 'csrfCookie' => [ + 'domain' => 'localhost', + ], + */ + ], + ], ] );