Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameters $useBootstrap, $checkEvents and $configGroupPostfix to the HttpApplicationRunner #43

Merged
merged 15 commits into from
Feb 19, 2023
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## 1.2.0 under development

- Enh #39: Adapt to `yiisoft/yii-runner` of version `^2.0` (@vjik)
- New #40: In the `HttpApplicationRunner` constructor make parameter "environment" optional (`null` by default) and add
new parameters that set config group names for container, bootstrap and events (@vjik)
- New #42: In the `HttpApplicationRunner` constructor add parameter that set config params group name (@vjik)
- New #40: In the `HttpApplicationRunner` constructor make parameter "environment" optional, default `null` (@vjik)
- New #43: Add parameters `$useBootstrap`, `$checkEvents` and `$configGroupPostfix` to the `HttpApplicationRunner`
constructor (@vjik)

## 1.1.2 November 10, 2022

Expand Down
11 changes: 4 additions & 7 deletions src/HttpApplicationRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,12 @@ final class HttpApplicationRunner extends ApplicationRunner
public function __construct(
string $rootPath,
bool $debug,
string $paramsConfigGroup = 'params',
string $containerConfigGroup = 'web',
?string $bootstrapGroup = 'bootstrap-web',
?string $eventsGroup = 'events-web',
bool $useBootstrap = true,
bool $checkEvents = true,
?string $configGroupPostfix = 'web',
?string $environment = null,
) {
parent::__construct($rootPath, $debug, $paramsConfigGroup, $containerConfigGroup, $environment);
$this->bootstrapGroup = $bootstrapGroup;
$this->eventsGroup = $eventsGroup;
parent::__construct($rootPath, $debug, $useBootstrap, $checkEvents, $configGroupPostfix, $environment);
}

/**
Expand Down
13 changes: 6 additions & 7 deletions tests/HttpApplicationRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ public function testRun(): void

public function testRunWithoutBootstrapAndCheckEvents(): void
{
$runner = $this->runner
->withoutBootstrap()
->withoutCheckingEvents();
$runner = new HttpApplicationRunner(
rootPath: __DIR__ . '/Support',
debug: true,
useBootstrap: false,
checkEvents: false
);

$this->expectOutputString('OK');

Expand Down Expand Up @@ -119,10 +122,6 @@ public function testRunWithFailureDuringProcess(): void

public function testImmutability(): void
{
$this->assertNotSame($this->runner, $this->runner->withBootstrap('bootstrap-web'));
$this->assertNotSame($this->runner, $this->runner->withoutBootstrap());
$this->assertNotSame($this->runner, $this->runner->withCheckingEvents('events-web'));
$this->assertNotSame($this->runner, $this->runner->withoutCheckingEvents());
$this->assertNotSame($this->runner, $this->runner->withConfig($this->createConfig()));
$this->assertNotSame($this->runner, $this->runner->withContainer($this->createContainer()));
$this->assertNotSame($this->runner, $this->runner->withTemporaryErrorHandler($this->createErrorHandler()));
Expand Down
12 changes: 6 additions & 6 deletions tests/Support/config/.merge-plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
'params.php',
],
],
'web' => [
'di-web' => [
'/' => [
'web.php',
'di-web.php',
],
],
'events-web' => [
'/' => [
'events-web.php',
],
],
'providers-web' => [
'di-providers-web' => [
'/' => [
'providers-web.php',
'di-providers-web.php',
],
],
'delegates-web' => [
'di-delegates-web' => [
'/' => [
'delegates-web.php',
'di-delegates-web.php',
],
],
'bootstrap-web' => [
Expand Down
File renamed without changes.