Skip to content

Commit

Permalink
#27 failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Aug 1, 2021
1 parent ba05bcf commit a31720d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/Unit/PrefixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1285,4 +1285,37 @@ public function __construct()
$result = $replacer->replaceNamespace($result, 'ST', 'StraussTest\\ST');
$this->assertEquals($expected, $result);
}

/**
* A prefixed classname was being replaced inside a namespace.
*
* namespace Symfony\Polyfill\Intl\Normalizer_Test_Normalizer;
*
* @see https://github.com/BrianHenryIE/strauss/issues/27
*
* @author BrianHenryIE
*/
public function testItDoesNotPrefixClassnameInsideNamespaceName(): void
{

$contents = <<<'EOD'
namespace Symfony\Polyfill\Intl\Normalizer;
class NA
{
}
EOD;

$originalClassname = 'Normalizer';
$classnamePrefix = 'Normalizer_Test_';

$config = $this->createMock(StraussConfig::class);

$replacer = new Prefixer($config, __DIR__);

$result = $replacer->replaceClassname($contents, $originalClassname, $classnamePrefix);

$this->assertEquals($contents, $result);
}

}

0 comments on commit a31720d

Please sign in to comment.