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.
All PSR-4 autoload key to be an array
- Loading branch information
1 parent
09ebec1
commit b32fe49
Showing
5 changed files
with
109 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* Test PSR-4 array of autoload values. | ||
* | ||
* @see https://github.com/BrianHenryIE/strauss/issues/76 | ||
*/ | ||
|
||
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 StraussIssue76Test extends \BrianHenryIE\Strauss\Tests\Integration\Util\IntegrationTestCase | ||
{ | ||
|
||
/** | ||
*/ | ||
public function test_psr4_array() | ||
{ | ||
|
||
$composerJsonString = <<<'EOD' | ||
{ | ||
"autoload": { | ||
"psr-4": { | ||
"FakerPress\\": [ | ||
"src/FakerPress/", | ||
"src/functions/" | ||
], | ||
"FakerPress\\Dev\\": "dev/src/" | ||
} | ||
}, | ||
"extra": { | ||
"strauss": { | ||
"target_directory": "vendor-prefixed", | ||
"namespace_prefix": "FakerPress\\ThirdParty\\", | ||
"classmap_prefix": "FakerPress_ThirdParty_", | ||
"constant_prefix": "FAKERPRESS__" | ||
} | ||
} | ||
} | ||
EOD; | ||
|
||
chdir($this->testsWorkingDir); | ||
|
||
file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); | ||
|
||
exec('composer install'); | ||
|
||
$inputInterfaceMock = $this->createMock(InputInterface::class); | ||
$outputInterfaceMock = $this->createMock(OutputInterface::class); | ||
|
||
$strauss = new Compose(); | ||
|
||
$result = $strauss->run($inputInterfaceMock, $outputInterfaceMock); | ||
|
||
self::assertEquals(0, $result); | ||
} | ||
} |
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