generated from yiisoft/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to set custom config merge plan file path, config and ven…
…dor directories (#50)
- Loading branch information
Showing
10 changed files
with
118 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
actor: UnitTester |
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,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\Yii\Runner\Console\Tests\Unit; | ||
|
||
use Codeception\PHPUnit\TestCase; | ||
use Yiisoft\Yii\Runner\Console\ConsoleApplicationRunner; | ||
|
||
final class ConsoleApplicationRunnerTest extends TestCase | ||
{ | ||
public function testConfigMergePlanFile(): void | ||
{ | ||
$runner = new ConsoleApplicationRunner( | ||
rootPath: __DIR__ . '/Support/custom-merge-plan', | ||
configMergePlanFile: 'test-merge-plan.php', | ||
); | ||
|
||
$params = $runner->getConfig()->get('params-console'); | ||
|
||
$this->assertSame(['a' => 42,], $params); | ||
} | ||
|
||
public function testConfigDirectory(): void | ||
{ | ||
$runner = new ConsoleApplicationRunner( | ||
rootPath: __DIR__ . '/Support', | ||
configDirectory: 'custom-config', | ||
); | ||
|
||
$params = $runner->getConfig()->get('params-console'); | ||
|
||
$this->assertSame(['age' => 22], $params); | ||
} | ||
} |
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,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
// Do not edit. Content will be replaced. | ||
return [ | ||
'/' => [ | ||
'params-console' => [ | ||
'/' => [ | ||
'params.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 [ | ||
'age' => 22, | ||
]; |
14 changes: 14 additions & 0 deletions
14
tests/Unit/Support/custom-merge-plan/config/test-merge-plan.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,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
// Do not edit. Content will be replaced. | ||
return [ | ||
'/' => [ | ||
'params-console' => [ | ||
'/' => [ | ||
'test-params.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 [ | ||
'a' => 42, | ||
]; |
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\Yii\Runner\Console\Tests; | ||
|
||
/** | ||
* Inherited Methods | ||
* @method void wantTo($text) | ||
* @method void wantToTest($text) | ||
* @method void execute($callable) | ||
* @method void expectTo($prediction) | ||
* @method void expect($prediction) | ||
* @method void amGoingTo($argumentation) | ||
* @method void am($role) | ||
* @method void lookForwardTo($achieveValue) | ||
* @method void comment($description) | ||
* @method void pause($vars = []) | ||
* | ||
* @SuppressWarnings(PHPMD) | ||
*/ | ||
class UnitTester extends \Codeception\Actor | ||
{ | ||
use _generated\UnitTesterActions; | ||
|
||
/** | ||
* Define custom actions here | ||
*/ | ||
} |