Skip to content

Commit

Permalink
"directory does not exist" with crewlabs/unsplash
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed May 1, 2021
1 parent 3ffb7b8 commit 849559f
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions tests/Issues/MozartIssue97Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace BrianHenryIE\Strauss\Tests\Issues;

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

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

/**
* Issue 97. Package named "crewlabs/unsplash" is downloaded to `vendor/crewlabs/unsplash` but their composer.json
* has the package name as "unsplash/unsplash".
*
* "The "/Users/BrianHenryIE/Sites/mozart-97/vendor/unsplash/unsplash/src" directory does not exist."
*/
public function testCrewlabsUnsplashSucceeds()
{

$composerJsonString = <<<'EOD'
{
"name": "brianhenryie/mozart-issue-97",
"require": {
"crewlabs/unsplash": "3.1.0"
},
"extra": {
"strauss": {
"namespace_prefix": "BrianHenryIE\\Strauss\\",
"classmap_prefix": "BrianHenryIE_Strauss_"
}
}
}
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);

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

0 comments on commit 849559f

Please sign in to comment.