forked from coenjacobs/mozart
-
Notifications
You must be signed in to change notification settings - Fork 25
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
03a148c
commit 9a93339
Showing
3 changed files
with
105 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* Problem with too many replacements due to common class, domain, namespace names, "Normalizer". | ||
* | ||
* @see https://github.com/BrianHenryIE/strauss/issues/27 | ||
*/ | ||
|
||
namespace BrianHenryIE\Strauss\Tests\Issues; | ||
|
||
use BrianHenryIE\Strauss\Console\Commands\Compose; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
/** | ||
* @package BrianHenryIE\Strauss\Tests\Issues | ||
* @coversNothing | ||
*/ | ||
class StraussIssue27Test extends \BrianHenryIE\Strauss\Tests\Integration\Util\IntegrationTestCase | ||
{ | ||
|
||
/** | ||
*/ | ||
public function test_virtual_package() | ||
{ | ||
|
||
$composerJsonString = <<<'EOD' | ||
{ | ||
"require": { | ||
"symfony/polyfill-intl-normalizer": "1.23" | ||
}, | ||
"extra": { | ||
"strauss": { | ||
"namespace_prefix": "Normalizer_Test\\", | ||
"classmap_prefix": "Normalizer_Test_" | ||
} | ||
} | ||
} | ||
EOD; | ||
|
||
file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); | ||
|
||
chdir($this->testsWorkingDir); | ||
|
||
exec('composer install'); | ||
|
||
$inputInterfaceMock = $this->createMock(InputInterface::class); | ||
$outputInterfaceMock = $this->createMock(OutputInterface::class); | ||
|
||
$strauss = new Compose(); | ||
|
||
$result = $strauss->run($inputInterfaceMock, $outputInterfaceMock); | ||
|
||
$php_string = file_get_contents($this->testsWorkingDir . 'strauss/symfony/polyfill-intl-normalizer/Normalizer.php'); | ||
|
||
$this->assertStringNotContainsString('namespace Normalizer_Test\Symfony\Polyfill\Intl\Normalizer_Test_Normalizer;', $php_string); | ||
$this->assertStringContainsString('namespace Normalizer_Test\Symfony\Polyfill\Intl\Normalizer;', $php_string); | ||
|
||
$this->assertStringNotContainsString('class Normalizer_Test_Normalizer', $php_string); | ||
$this->assertStringContainsString('class Normalizer', $php_string); | ||
|
||
|
||
$php_string = file_get_contents($this->testsWorkingDir . 'strauss/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php'); | ||
|
||
$this->assertStringNotContainsString('class Normalizer_Test_Normalizer extends Normalizer_Test\Symfony\Polyfill\Intl\Normalizer_Test_Normalizer\Normalizer', $php_string); | ||
$this->assertStringContainsString('class Normalizer_Test_Normalizer extends Normalizer_Test\Symfony\Polyfill\Intl\Normalizer\Normalizer', $php_string); | ||
} | ||
} |
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