-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '3.0' of https://github.com/fglaser-dotsource/magento-co…
…mposer-installer into 3.0
- Loading branch information
Showing
7 changed files
with
269 additions
and
2 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
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
180 changes: 180 additions & 0 deletions
180
tests/MagentoHackathon/Composer/FullStack/Regression/IssueC065Test.php
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,180 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2008-2015 dotSource GmbH. | ||
* All rights reserved. | ||
* http://www.dotsource.de | ||
* | ||
* Created: | ||
* 26.08.2015 | ||
* | ||
* Contributors: | ||
* Felix Glaser - initial contents | ||
* | ||
* @category Dotsource | ||
*/ | ||
|
||
namespace MagentoHackathon\Composer\FullStack\Regression; | ||
|
||
use Composer\Util\Filesystem; | ||
use Cotya\ComposerTestFramework; | ||
|
||
class IssueC065Test extends ComposerTestFramework\PHPUnit\FullStackTestCase | ||
{ | ||
/** @var ComposerTestFramework\Composer\Wrapper */ | ||
protected $composer; | ||
|
||
/** @var \SplFileInfo */ | ||
protected $projectDirectory; | ||
|
||
/** @var \SplFileInfo */ | ||
protected $artifactDirectory; | ||
|
||
/** @var string */ | ||
protected $testFilePath; | ||
|
||
protected function setUp() | ||
{ | ||
$this->composer = new ComposerTestFramework\Composer\Wrapper(); | ||
$this->projectDirectory = new \SplFileInfo(self::getTempComposerProjectPath()); | ||
$this->artifactDirectory = new \SplFileInfo(__DIR__.'/../../../../../tests/FullStackTest/artifact'); | ||
$this->testFilePath = $this->projectDirectory->getPathname()."/mage/app/code/local/Test/Module"; | ||
} | ||
|
||
private function prepareProject() | ||
{ | ||
$fs = new Filesystem(); | ||
$fs->remove($this->projectDirectory->getPathname()."/mage/app"); | ||
$fs->ensureDirectoryExists($this->projectDirectory->getPathname()."/app/code/local/Test/Module"); | ||
|
||
$modman = new \SplFileObject($this->projectDirectory->getPathname()."/modman", "w"); | ||
$modmanContent = <<<MODMAN | ||
app/code/local/* app/code/local/ | ||
MODMAN; | ||
|
||
$modman->fwrite($modmanContent); | ||
} | ||
|
||
/** | ||
* @group regression | ||
*/ | ||
public function testIncludeRootPackageNotSet() | ||
{ | ||
$this->prepareProject(); | ||
|
||
$composerJson = new \SplTempFileObject(); | ||
$composerJsonContent = <<<JSON | ||
{ | ||
"name": "test/module", | ||
"type": "magento-module", | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "http://packages.firegento.com" | ||
}, | ||
{ | ||
"type": "artifact", | ||
"url": "$this->artifactDirectory/" | ||
} | ||
], | ||
"require": { | ||
"magento-hackathon/magento-composer-installer": "999.0.0" | ||
}, | ||
"extra": { | ||
"magento-deploy-strategy": "symlink", | ||
"magento-root-dir": "./mage" | ||
} | ||
} | ||
JSON; | ||
|
||
$composerJson->fwrite($composerJsonContent); | ||
|
||
$this->composer->install($this->projectDirectory, $composerJson); | ||
|
||
$this->assertFileNotExists($this->testFilePath); | ||
} | ||
|
||
/** | ||
* @group regression | ||
*/ | ||
public function testIncludeRootPackageIsFalse() | ||
{ | ||
$this->prepareProject(); | ||
|
||
|
||
$composerJson = new \SplTempFileObject(); | ||
$composerJsonContent = <<<JSON | ||
{ | ||
"name": "test/module", | ||
"type": "magento-module", | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "http://packages.firegento.com" | ||
}, | ||
{ | ||
"type": "artifact", | ||
"url": "$this->artifactDirectory/" | ||
} | ||
], | ||
"require": { | ||
"magento-hackathon/magento-composer-installer": "999.0.0" | ||
}, | ||
"extra": { | ||
"magento-deploy-strategy": "symlink", | ||
"magento-root-dir": "./mage", | ||
"include-root-package": false | ||
} | ||
} | ||
JSON; | ||
|
||
$composerJson->fwrite($composerJsonContent); | ||
|
||
$this->composer->install($this->projectDirectory, $composerJson); | ||
|
||
$this->assertFileNotExists($this->testFilePath); | ||
} | ||
|
||
/** | ||
* @group regression | ||
*/ | ||
public function testIncludeRootPackageIsTrue() | ||
{ | ||
$this->prepareProject(); | ||
|
||
|
||
$composerJson = new \SplTempFileObject(); | ||
$composerJsonContent = <<<JSON | ||
{ | ||
"name": "test/module", | ||
"type": "magento-module", | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "http://packages.firegento.com" | ||
}, | ||
{ | ||
"type": "artifact", | ||
"url": "$this->artifactDirectory/" | ||
} | ||
], | ||
"require": { | ||
"magento-hackathon/magento-composer-installer": "999.0.0" | ||
}, | ||
"extra": { | ||
"magento-deploy-strategy": "symlink", | ||
"magento-root-dir": "./mage", | ||
"include-root-package": true | ||
} | ||
} | ||
JSON; | ||
|
||
$composerJson->fwrite($composerJsonContent); | ||
|
||
$this->composer->install($this->projectDirectory, $composerJson); | ||
|
||
$this->assertFileExists($this->testFilePath); | ||
} | ||
} |
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