generated from yiisoft/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
- Loading branch information
Showing
25 changed files
with
342 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tests/Integration/NestedGroupBug153/NestedGroupBug153Test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\Config\Tests\Integration\NestedGroupBug153; | ||
|
||
use Yiisoft\Config\Tests\Integration\IntegrationTestCase; | ||
|
||
final class NestedGroupBug153Test extends IntegrationTestCase | ||
{ | ||
public function testBase(): void | ||
{ | ||
$config = $this->runComposerUpdateAndCreateConfig( | ||
rootPath: __DIR__, | ||
packages: [ | ||
'test/a' => __DIR__ . '/packages/a', | ||
], | ||
extra: [ | ||
'config-plugin' => [ | ||
'params' => [], | ||
'di' => 'di.php', | ||
'di-web' => '$di', | ||
], | ||
], | ||
); | ||
|
||
$this->assertSame(['key' => 'app-di'], $config->get('di-web')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'key' => 'app-di', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "test/a", | ||
"version": "1.0.0", | ||
"extra": { | ||
"config-plugin": { | ||
"di-web": "di-web.php" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'key' => 'package-di-web', | ||
]; |
39 changes: 39 additions & 0 deletions
39
tests/Integration/NestedGroupDuplicateKey/NestedGroupDuplicateKeyTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\Config\Tests\Integration\NestedGroupDuplicateKey; | ||
|
||
use ErrorException; | ||
use Yiisoft\Config\Tests\Integration\IntegrationTestCase; | ||
|
||
final class NestedGroupDuplicateKeyTest extends IntegrationTestCase | ||
{ | ||
public function testBase(): void | ||
{ | ||
$config = $this->runComposerUpdateAndCreateConfig( | ||
rootPath: __DIR__, | ||
packages: [ | ||
'test/a' => __DIR__ . '/packages/a', | ||
], | ||
extra: [ | ||
'config-plugin' => [ | ||
'params' => [], | ||
'di' => 'di.php', | ||
'di-web' => [ | ||
'$di', | ||
'di-web.php', | ||
], | ||
], | ||
], | ||
); | ||
|
||
$this->expectException(ErrorException::class); | ||
$this->expectExceptionMessage( | ||
'Duplicate key "key" in the following configs while building "di-web" group:' . "\n" . | ||
' - di-web.php' . "\n" . | ||
' - di.php' | ||
); | ||
$config->get('di-web'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'key' => 'app-di-web', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'key' => 'app-di', | ||
]; |
9 changes: 9 additions & 0 deletions
9
tests/Integration/NestedGroupDuplicateKey/packages/a/composer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "test/a", | ||
"version": "1.0.0", | ||
"extra": { | ||
"config-plugin": { | ||
"di": "di.php" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
'key' => 'package-di', | ||
]; |
56 changes: 56 additions & 0 deletions
56
tests/Integration/RemoveFromVendorExtended/RemoveFromVendorExtendedTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Integration\RemoveFromVendorExtended; | ||
|
||
use Yiisoft\Config\Modifier\RecursiveMerge; | ||
use Yiisoft\Config\Modifier\RemoveFromVendor; | ||
use Yiisoft\Config\Tests\Integration\IntegrationTestCase; | ||
|
||
final class RemoveFromVendorExtendedTest extends IntegrationTestCase | ||
{ | ||
public function testBase(): void | ||
{ | ||
$config = $this->runComposerUpdateAndCreateConfig( | ||
rootPath: __DIR__, | ||
packages: [ | ||
'yiisoft/auth-jwt' => __DIR__ . '/packages/yiisoft-auth-jwt', | ||
], | ||
extra: [ | ||
'config-plugin' => [ | ||
'params' => 'params.php', | ||
'params-web' => [ | ||
'$params', | ||
'params-web.php', | ||
], | ||
], | ||
'config-plugin-environments' => [ | ||
'dev' => [ | ||
'params' => 'params-dev.php', | ||
], | ||
], | ||
], | ||
environment: 'dev', | ||
paramsGroup: 'params-web', | ||
modifiers: [ | ||
RecursiveMerge::groups('params', 'params-web'), | ||
RemoveFromVendor::keys(['yiisoft/auth-jwt', 'algorithms'])->package('yiisoft/auth-jwt', 'params'), | ||
], | ||
); | ||
|
||
$this->assertSame( | ||
[ | ||
'yiisoft/auth-jwt' => [ | ||
'algorithms' => [ | ||
'RS384', | ||
'HS512', | ||
], | ||
], | ||
'debug' => true, | ||
'test' => 7, | ||
], | ||
$config->get('params-web'), | ||
); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/Integration/RemoveFromVendorExtended/packages/yiisoft-auth-jwt/composer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "yiisoft/auth-jwt", | ||
"version": "1.0.0", | ||
"extra": { | ||
"config-plugin": { | ||
"params": "params.php" | ||
} | ||
} | ||
} |
Oops, something went wrong.