Skip to content

Commit

Permalink
nesbot/carbon empty searchNamespace
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed May 1, 2021
1 parent a2d3f3a commit fba2cef
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions tests/Issues/MozartIssue109Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
/**
* nesbot/carbon empty searchNamespace
* @see https://github.com/coenjacobs/mozart/issues/109
*
* Comments were being prefixed.
*/

namespace BrianHenryIE\Strauss\Tests\Issues;

use BrianHenryIE\Strauss\Console\Commands\Compose;
use BrianHenryIE\Strauss\Tests\Integration\Util\IntegrationTestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Class MozartIssue109Test
* @package BrianHenryIE\Strauss\Tests\Issues
* @coversNothing
*/
class MozartIssue109Test extends IntegrationTestCase
{

public function testTheOutputDoesNotPrefixComments()
{

$composerJsonString = <<<'EOD'
{
"minimum-stability": "dev",
"require": {
"nesbot/carbon":"1.39.0"
},
"require-dev": {
"coenjacobs/mozart": "dev-master"
},
"extra": {
"mozart": {
"dep_namespace": "Mozart\\",
"dep_directory": "/strauss/",
"delete_vendor_files": false,
"exclude_packages": [
"kylekatarnls/update-helper",
"symfony/polyfill-intl-idn",
"symfony/translation",
"symfony/polyfill-mbstring",
"symfony/translation-contracts",
"composer-plugin-api"
]
}
}
}
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);

$mozartCompose = new Compose();

$result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock);

$phpString = file_get_contents($this->testsWorkingDir .'strauss/nesbot/carbon/src/Carbon/Carbon.php');

$this->assertStringNotContainsString('*Mozart\\ This file is part of the Carbon package.Mozart\\', $phpString);
}
}

0 comments on commit fba2cef

Please sign in to comment.