Skip to content

Commit

Permalink
Moved test host info to Yii2 config
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhirtz committed Apr 15, 2024
1 parent 1d902e4 commit a4f5b8e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/codeception/Yii2.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Yii2 extends \Codeception\Module\Yii2
public function __construct(ModuleContainer $moduleContainer, ?array $config = null)
{
$config['applicationClass'] ??= Application::class;
$config['entryUrl'] ??= 'https://www.example.com:443/index.php';

parent::__construct($moduleContainer, $config);
}
Expand Down
2 changes: 0 additions & 2 deletions src/codeception/traits/ConsoleApplicationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ trait ConsoleApplicationTrait
protected function createConsoleApplicationMock(): void
{
$config = require(__DIR__ . '/../../../tests/config/test.php');
unset($config['components']['request']['hostInfo']);

(new Application($config));
}
}
3 changes: 0 additions & 3 deletions tests/config/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
'password' => getenv('MYSQL_PASSWORD') ?: '',
'charset' => 'utf8',
],
'request' => [
'hostInfo' => 'https://www.example.com',
],
],
'params' => [
'cookieValidationKey' => 'test',
Expand Down
7 changes: 1 addition & 6 deletions tests/unit/web/UrlManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ public function testImmutableRuleParams(): void

protected function getUrlManager($config = []): UrlManager
{
return new UrlManager([
'baseUrl' => '',
'scriptUrl' => '/index.php',
'cache' => null,
...$config
]);
return new UrlManager($config);
}
}

0 comments on commit a4f5b8e

Please sign in to comment.