public function testInstall() { $composer = new ComposerTestFramework\Composer\Wrapper(); $artifactDirectory = new \SplFileInfo($this->tempdir()); $pluginDirectory = new \SplFileInfo(realpath(__DIR__ . '/../../')); $projectDirectory = new \SplFileInfo($this->tempdir()); //var_dump($pluginDirectory, $artifactDirectory, $projectDirectory); $composer->archive($pluginDirectory, $artifactDirectory); $composerJson = new \SplTempFileObject(); $composerJsonContent = <<<composerJson { "repositories": [ { "type": "artifact", "url": "{$artifactDirectory}/" }, { "type": "composer", "url": "http://packages.firegento.com" } ], "require": { "cotya/composer-magento-plugin": "dev-master@dev", "firegento/psr0autoloader": "dev-master" } } composerJson; $composerJson->fwrite($composerJsonContent); $composer->install($projectDirectory, $composerJson); $this->assertFileNotExists($projectDirectory . '/vendor/magento-hackathon/magento-composer-installer/composer.json'); }
/** * @group */ public function testCreateProject() { $composer = new ComposerTestFramework\Composer\Wrapper(); $projectDirectory = new \SplFileInfo(self::getTempComposerProjectPath()); $composer->createProject($projectDirectory, 'fabpot/silex-skeleton', null, null); $this->assertFileExists($projectDirectory->getPathname() . '/silex-skeleton/composer.json'); $this->assertFileExists($projectDirectory->getPathname() . '/silex-skeleton/vendor/psr/log/README.md'); }
/** * @group experiment */ public function testInstall() { $composer = new ComposerTestFramework\Composer\Wrapper(); $projectDirectory = new \SplFileInfo(self::getTempComposerProjectPath()); //@todo create project can not work on git repositories, it needs to be listed in a composer repository $this->markTestIncomplete('create project can not work on git repositories, it needs to be listed in a composer repository'); $composer->createProject($projectDirectory, 'oro/crm-application', '1.3.0', 'https://github.com/orocrm/crm-application.git'); echo $projectDirectory; }
public function testComposerWrapperArchive() { $composer = new ComposerTestFramework\Composer\Wrapper(); $artifactDirectory = new \SplFileInfo($this->tempdir()); $packagesPath = __DIR__ . '/../../tests/res/packages'; $directory = new \DirectoryIterator($packagesPath); /** @var \DirectoryIterator $file */ foreach ($directory as $file) { if (!$file->isDot() && $file->isDir()) { $composer->archive($file, $artifactDirectory); } } $this->assertFileExists($artifactDirectory->getPathname() . '/magento-hackathon-magento-composer-installer-test-wildcard-1.0.0.zip'); $this->assertFileExists($artifactDirectory->getPathname() . '/magento-hackathon-magento-composer-installer-test-wildcard2-1.0.0.zip'); $this->assertFileExists($artifactDirectory->getPathname() . '/magento-hackathon-magento-composer-installer-test-library-1.0.0.zip'); }