forked from coenjacobs/mozart
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f274ad
commit 7593385
Showing
1 changed file
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* Defined CLI arguments are breaking the extra.strauss config even when they are not present. | ||
* | ||
* @see https://github.com/BrianHenryIE/strauss/pull/109 | ||
*/ | ||
|
||
namespace BrianHenryIE\Strauss\Tests\Issues; | ||
|
||
use BrianHenryIE\Strauss\Tests\Integration\Util\IntegrationTestCase; | ||
|
||
/** | ||
* @package BrianHenryIE\Strauss\Tests\Issues | ||
* @coversNothing | ||
*/ | ||
class StraussIssue109Test extends IntegrationTestCase | ||
{ | ||
public function test_absent_cli_argument_parsing_does_not_overwrite_config() | ||
{ | ||
$composerJsonString = <<<'EOD' | ||
{ | ||
"name": "strauss/issue104", | ||
"require": { | ||
"psr/log": "1.0.0" | ||
}, | ||
"extra": { | ||
"strauss": { | ||
"namespace_prefix": "Strauss\\Issue109\\", | ||
"delete_vendor_packages": true | ||
} | ||
} | ||
} | ||
EOD; | ||
|
||
chdir($this->testsWorkingDir); | ||
|
||
file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); | ||
|
||
exec('composer install'); | ||
|
||
$_SERVER['argv'] = [$this->projectDir . '/bin/strauss']; | ||
|
||
$version = '0.19.1'; | ||
$app = new \BrianHenryIE\Strauss\Console\Application($version); | ||
$app->setAutoExit(false); | ||
$result = $app->run(); | ||
|
||
$this->assertEquals(0, $result); | ||
|
||
$this->assertFileDoesNotExist($this->testsWorkingDir . 'vendor/psr/log/composer.json'); | ||
} | ||
} |