From 21e9a24df025b164d9d8e8a2996cedfe665301f8 Mon Sep 17 00:00:00 2001 From: Michael Woodward Date: Fri, 15 Jul 2016 15:16:20 +0100 Subject: [PATCH 1/4] Move to M2 support only --- .gitignore | 1 + .travis.yml | 4 +- README.md | 9 +- src/StaticsMergerPlugin.php | 61 ++++--- test/StaticsMergerPluginTest.php | 276 ++++++++++++++++--------------- 5 files changed, 189 insertions(+), 162 deletions(-) diff --git a/.gitignore b/.gitignore index 61ead86..9e5d3c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +.idea /vendor diff --git a/.travis.yml b/.travis.yml index 2649030..74a2702 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,7 @@ language: php sudo: false php: - - 5.4 - - 5.5 - - 5.6 + - 7 - hhvm install: diff --git a/README.md b/README.md index d530e8f..2f53aad 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,16 @@ The plugin hooks onto two composer commands ```install``` and ```update``` in wh This module is installable via ```Composer```. If you have used the Magento Skeleton as a base module then you can just require this project and all the rest is done for you. +### Magento 1 ```sh $ cd project-root -$ ./composer.phar require "wearejh/statics-merger" +$ ./composer.phar require "wearejh/statics-merger:^2.0.0" +``` + +### Magento 2 +```sh +$ cd project-root +$ ./composer.phar require "wearejh/statics-merger:^3.0.0" ``` ### Upgrading 1.x to 2.x ? diff --git a/src/StaticsMergerPlugin.php b/src/StaticsMergerPlugin.php index 0212124..dd799f8 100644 --- a/src/StaticsMergerPlugin.php +++ b/src/StaticsMergerPlugin.php @@ -7,7 +7,7 @@ use Composer\IO\IOInterface; use Composer\Plugin\PluginInterface; use Composer\Script\ScriptEvents; -use Composer\Script\CommandEvent; +use Composer\Script\Event; use Composer\Util\Filesystem; use Composer\Package\PackageInterface; use Composer\Package\Package; @@ -56,7 +56,7 @@ class StaticsMergerPlugin implements PluginInterface, EventSubscriberInterface /** * @var string */ - protected $mageDir; + protected $mageDir = ''; /** * @param Composer $composer @@ -77,12 +77,12 @@ public function activate(Composer $composer, IOInterface $io) } if (!isset($this->packageExtra['magento-root-dir'])) { - $this->io->write("Magento root dir not defined"); - return false; + $this->io->write("Magento root dir not defined, assumed current working directory"); + } else { + $this->mageDir = rtrim($this->packageExtra['magento-root-dir'], '/'); } - $this->staticMaps = $this->packageExtra['static-map']; - $this->mageDir = rtrim($this->packageExtra['magento-root-dir'], '/'); + $this->staticMaps = $this->packageExtra['static-map']; } /** @@ -132,19 +132,20 @@ public static function getSubscribedEvents() /** * Symlink the static repositories - * @param CommandEvent $event + * @param Event $event * @return bool|void */ - public function symlinkStatics(CommandEvent $event) + public function symlinkStatics(Event $event) { foreach ($this->getStaticPackages() as $package) { + $packageSource = $this->getInstallPath($package); + foreach ($this->getStaticMaps($package->getName()) as $mappingDir => $mappings) { - $packageSource = $this->getInstallPath($package); - $destinationTheme = sprintf('%s/%s/skin/frontend/%s', getcwd(), $this->mageDir, $mappingDir); + $destinationTheme = $this->getRootThemeDir($mappingDir); // Add slash to paths - $packageSource = rtrim($packageSource, "/"); - $destinationTheme = rtrim($destinationTheme, "/"); + $packageSource = rtrim($packageSource, "/"); + $destinationTheme = rtrim($destinationTheme, "/"); // If theme doesn't exist - Create it $this->filesystem->ensureDirectoryExists($destinationTheme); @@ -246,7 +247,7 @@ public function processSymlink($packageSrc, $relativeSourcePath, $destinationThe } $relativeSourcePath = $this->getRelativePath($destinationPath, $sourcePath); - if (!\symlink($relativeSourcePath, $destinationPath)) { + if (!@\symlink($relativeSourcePath, $destinationPath)) { $this->io->write( "Failed to symlink $sourcePath to $destinationPath" ); @@ -284,16 +285,14 @@ public function getStaticMaps($packageName = null) } /** - * @param CommandEvent $event + * @param Event $event * @return bool|void */ - public function staticsCleanup(CommandEvent $event) + public function staticsCleanup(Event $event) { foreach ($this->getStaticPackages() as $package) { foreach ($this->getStaticMaps($package->getName()) as $mappingDir => $mappings) { - $mappingDirs = explode('/', $mappingDir); - $packageRootDir = sprintf('%s/%s/skin/frontend/%s', getcwd(), $this->mageDir, $mappingDirs[0]); - $themeRootDir = sprintf('%s/%s/skin/frontend/%s', getcwd(), $this->mageDir, $mappingDir); + $themeRootDir = $this->getRootThemeDir($mappingDir); if (!is_dir($themeRootDir)) { continue; @@ -305,11 +304,11 @@ public function staticsCleanup(CommandEvent $event) array_multisort($strLengths, SORT_DESC, $contents); // Exception error message - $errorMsg = sprintf("Failed to remove %s from %s", $package->getName(), $packageRootDir); + $errorMsg = sprintf("Failed to remove %s from %s", $package->getName(), $themeRootDir); foreach ($contents as $content) { // Remove packages symlinked files/dirs - if (is_link($content) && strpos($content, $mappingDir) !== false) { + if (is_link($content) && strpos($content, $mappingDir . '/web/assets') !== false) { $this->tryCleanup($content, $errorMsg); continue; } @@ -319,11 +318,6 @@ public function staticsCleanup(CommandEvent $event) $this->tryCleanup($content, $errorMsg); } } - - // Check if we need to remove package dir - if (is_dir($packageRootDir) && $this->filesystem->isDirEmpty($packageRootDir)) { - $this->tryCleanup(rtrim($packageRootDir, "/"), $errorMsg); - } } } } @@ -348,6 +342,7 @@ private function tryCleanup($path, $errorMsg) */ private function getFullDirectoryListing($path) { + // TODO: RecursiveDirectoryIterator::SKIP_DOTS ? $listings = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path)); $listingArr = array_keys(\iterator_to_array($listings)); @@ -363,7 +358,7 @@ private function getFullDirectoryListing($path) * Returns the relative path from $from to $to * * This is utility method for symlink creation. - * Orig Source: http://stackoverflow.com/a/2638272/485589 + * @see http://stackoverflow.com/a/2638272/485589 * * @param string $from * @param string $to @@ -402,4 +397,18 @@ public function getRelativePath($from, $to) } return implode('/', $relPath); } + + /** + * @param $mappingDir + * @return string + */ + private function getRootThemeDir($mappingDir) + { + return sprintf( + '%s%s/app/design/frontend/%s/web/assets', + getcwd(), + $this->mageDir ? '/' . $this->mageDir : '', + $mappingDir + ); + } } diff --git a/test/StaticsMergerPluginTest.php b/test/StaticsMergerPluginTest.php index 42921d5..be156c6 100644 --- a/test/StaticsMergerPluginTest.php +++ b/test/StaticsMergerPluginTest.php @@ -7,7 +7,7 @@ use Composer\Package\RootPackage; use Composer\Repository\RepositoryManager; use Composer\Repository\WritableArrayRepository; -use Composer\Script\CommandEvent; +use Composer\Script\Event; use Composer\Util\Filesystem; use Jh\StaticsMerger\StaticsMergerPlugin; use Composer\Test\TestCase; @@ -313,7 +313,7 @@ public function testErrorIsPrintedIfMagentoRootNotSet() $this->io ->expects($this->once()) ->method('write') - ->with('Magento root dir not defined'); + ->with('Magento root dir not defined, assumed current working directory'); $this->activatePlugin(); } @@ -321,14 +321,14 @@ public function testErrorIsPrintedIfMagentoRootNotSet() public function testSymLinkStaticsCorrectlySymLinksStaticFiles() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage($this->createStaticPackage()); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); } public function testFileGlobAreAllCorrectlySymLinkedToRoot() @@ -354,25 +354,25 @@ public function testFileGlobAreAllCorrectlySymLinkedToRoot() $this->composer->getPackage()->setExtra($rootPackageExtra); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); // Favicons linked from root - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/favicon1"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/favicon2"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/favicon3"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/favicon1")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/favicon2")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon1"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon2"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon3"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon1")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon2")); // Images linked from image dir - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/image1.jpg"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/image2.jpg"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/image1.jpg")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/image2.jpg")); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/picture1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image2.jpg"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image1.jpg")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image2.jpg")); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/picture1.jpg"); } public function testFileGlobAreAllCorrectlySymLinkedWithSetDest() @@ -383,18 +383,18 @@ public function testFileGlobAreAllCorrectlySymLinkedWithSetDest() $this->addGlobsWithDest($package); $this->localRepository->addPackage($package); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images"); - $this->assertTrue(is_dir("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images")); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/image1.jpg"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/image2.jpg"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/image1.jpg")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/image2.jpg")); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/picture1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images"); + $this->assertTrue(is_dir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/image1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/image2.jpg"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/image1.jpg")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/image2.jpg")); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/picture1.jpg"); } public function testStandardFilesAreAllCorrectlySymLinked() @@ -404,18 +404,18 @@ public function testStandardFilesAreAllCorrectlySymLinked() $this->createStaticPackage('some/static', 'package/theme', array(), true, false, true) ); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog")); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog/image1.jpg") + file_exists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog/image1.jpg") ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog/image2.jpg") + file_exists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog/image2.jpg") ); } @@ -427,26 +427,26 @@ public function testCurrentSymlinksAreUnlinked() $packageLocation = $this->projectRoot . "/vendor/" . $package->getName(); mkdir($packageLocation . '/assets/testdir'); - mkdir("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/", 0777, true); + mkdir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/", 0777, true); symlink( $packageLocation . '/assets/testdir', - "{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog" ); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog")); $this->assertEquals( $packageLocation . '/assets/testdir', - readLink("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog") + readLink("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog") ); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog")); } public function testFilesAndFolderErrorWithoutDestinationSet() @@ -465,27 +465,27 @@ public function testFilesAndFolderErrorWithoutDestinationSet() ->method('write') ->with($message); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/image1.jpg"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/image2.jpg"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/image3.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image1.jpg"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image2.jpg"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image3.jpg"); } public function testAssetSymLinkFailsIfAlreadyExistButNotSymLink() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage($this->createStaticPackage()); - mkdir("{$this->projectRoot}/htdocs/skin/frontend/package/theme", 0777, true); - touch("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets"); + mkdir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets", 0777, true); + touch("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets"); - $errorMsg = 'Your static path: "%s/htdocs/skin/frontend/package/theme/assets" '; + $errorMsg = 'Your static path: "%s/htdocs/app/design/frontend/package/theme/web/assets/assets" '; $errorMsg .= 'is currently not a symlink, please remove first '; $message = sprintf($errorMsg, $this->projectRoot); @@ -496,13 +496,13 @@ public function testAssetSymLinkFailsIfAlreadyExistButNotSymLink() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertTrue(is_file("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); + $this->assertTrue(is_file("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); } public function testErrorIsReportedIfStaticPackageMissingSpecifiedSource() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage( $this->createStaticPackage('some/static', 'package/theme', array(), false) @@ -535,7 +535,7 @@ public function testSkipsNonStaticPackages() ->expects($this->never()) ->method('processSymlink'); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $staticPlugin->activate($this->composer, $this->io); $staticPlugin->symlinkStatics($event); } @@ -566,7 +566,7 @@ public function testWritesErrorWithNoFilePaths() ->method('write') ->with($message); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); } @@ -599,7 +599,7 @@ public function testSymlinkFail() $this->localRepository->addPackage($staticPackage); // Change perms to force symlink error - $themeDir = $this->projectRoot . '/htdocs/skin/frontend/package/theme'; + $themeDir = $this->projectRoot . '/htdocs/app/design/frontend/package/theme/web/assets'; mkdir($themeDir, 0755, true); chmod($themeDir, 0400); @@ -610,7 +610,7 @@ public function testSymlinkFail() ->method('write') ->with($this->stringContains($message)); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); @@ -623,32 +623,31 @@ public function testSymlinkFail() public function testStaticsCleanupCorrectlyRemovesDirs() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage($this->createStaticPackage()); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); $this->plugin->staticsCleanup($event); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); } public function testStaticsCleanupOutputOnException() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage($this->createStaticPackage()); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); $filesystem = $this->getMockBuilder('Composer\Util\Filesystem') ->setMethods(array('remove')) @@ -663,7 +662,7 @@ public function testStaticsCleanupOutputOnException() ->expects($this->once()) ->method('write') ->with(sprintf( - "Failed to remove some/static from %s/htdocs/skin/frontend/package", + "Failed to remove some/static from %s/htdocs/app/design/frontend/package/theme/web/assets", realpath(sys_get_temp_dir()) . "/static-merge-test" )); @@ -674,49 +673,37 @@ public function testStaticsCleanupOutputOnException() $this->plugin->staticsCleanup($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); } public function testStaticsCleanupOutputOnPackageRemovalException() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage($this->createStaticPackage()); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); - $filesystem = $this->getMockBuilder('Composer\Util\Filesystem') ->setMethods(array('removeDirectory')) ->getMock(); - $themeDir = $themeDir = sprintf( - '%s/htdocs/skin/frontend/package/theme', + $themeDir = sprintf( + '%s/htdocs/app/design/frontend/package/theme/web/assets', $this->projectRoot ); $filesystem - ->expects($this->exactly(2)) + ->expects($this->once()) ->method('removeDirectory') - ->will($this->onConsecutiveCalls( - $this->returnCallback(function () use ($themeDir) { - $fileSys = new Filesystem(); - $fileSys->removeDirectory($themeDir); - }), - $this->throwException(new \RuntimeException()) - )); + ->will($this->throwException(new \RuntimeException())); $this->io ->expects($this->once()) ->method('write') - ->with(sprintf( - "Failed to remove some/static from %s/htdocs/skin/frontend/package", - realpath(sys_get_temp_dir()) . "/static-merge-test" - )); + ->with(sprintf("Failed to remove some/static from %s", $themeDir)); $refObject = new ReflectionObject($this->plugin); $refProperty = $refObject->getProperty('filesystem'); @@ -724,75 +711,70 @@ public function testStaticsCleanupOutputOnPackageRemovalException() $refProperty->setValue($this->plugin, $filesystem); $this->plugin->staticsCleanup($event); - - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package"); } public function testStaticCleanupWillNotRemoveNonMappedThemesFromPackage() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage($this->createStaticPackage()); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); // Create a non mapped static theme - mkdir(sprintf('%s/htdocs/skin/frontend/package/nonMappedTheme', $this->projectRoot)); + mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme2/web/assets', $this->projectRoot), 0777, true); $this->plugin->staticsCleanup($event); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/nonMappedTheme"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets"); } public function testStaticCleanupWillNotRemoveNonMappedFilesFromTheme() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage($this->createStaticPackage()); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); // Create a non mapped static theme - mkdir(sprintf('%s/htdocs/skin/frontend/package/theme/keepdir', $this->projectRoot)); - touch(sprintf('%s/htdocs/skin/frontend/package/theme/keepdir/keepme.txt', $this->projectRoot)); - touch(sprintf('%s/htdocs/skin/frontend/package/theme/keepme.txt', $this->projectRoot)); - mkdir(sprintf('%s/htdocs/skin/frontend/package/theme/removeme/', $this->projectRoot)); + mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme/web/assets/keepdir', $this->projectRoot)); + touch(sprintf('%s/htdocs/app/design/frontend/package/theme/web/assets/keepdir/keepme.txt', $this->projectRoot)); + touch(sprintf('%s/htdocs/app/design/frontend/package/theme/web/assets/keepme.txt', $this->projectRoot)); + mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme/web/assets/removeme/', $this->projectRoot)); $this->plugin->staticsCleanup($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/keepdir"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/keepdir/keepme.txt"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/keepme.txt"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/removeme"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/keepdir"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/keepdir/keepme.txt"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/keepme.txt"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/removeme"); } public function testStaticsCleanupWorksWithNoFilesToClean() { $this->createRootPackage(); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->localRepository->addPackage($this->createStaticPackage()); $this->activatePlugin(); $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); $this->plugin->staticsCleanup($event); $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); } public function testGetStaticMapsWillReturnAll() @@ -908,47 +890,77 @@ public function testMultipleThemesForOnePackageLinksCorrectly() $this->composer->getPackage()->setExtra($rootPackageExtra); - $event = new CommandEvent('event', $this->composer, $this->io); + $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); // package/theme - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/assets")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog")); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog" + ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog/image1.jpg") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets") ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/skin/frontend/package/theme/images/catalog/image2.jpg") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog") + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog/image1.jpg" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog/image2.jpg" ); // package/theme2 - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme2"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme2/assets"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package/theme2/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme2/assets")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package/theme2/images/catalog")); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets/images/catalog" + ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/skin/frontend/package/theme2/images/catalog/image1.jpg") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets") ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/skin/frontend/package/theme2/images/catalog/image2.jpg") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/images/catalog") + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets/images/catalog/image1.jpg" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets/images/catalog/image2.jpg" ); // package2/theme - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package2/theme"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package2/theme/assets"); - $this->assertFileExists("{$this->projectRoot}/htdocs/skin/frontend/package2/theme/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package2/theme/assets")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/skin/frontend/package2/theme/images/catalog")); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/assets" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/images/catalog" + ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/skin/frontend/package2/theme/images/catalog/image1.jpg") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/assets") ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/skin/frontend/package2/theme/images/catalog/image2.jpg") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/images/catalog") + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/images/catalog/image1.jpg" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/images/catalog/image2.jpg" ); } From 62405db10168ff7a9598f4ccd9fd0aa1d4b84fd4 Mon Sep 17 00:00:00 2001 From: Michael Woodward Date: Fri, 15 Jul 2016 15:57:52 +0100 Subject: [PATCH 2/4] Don't include the asset dir by default, let this be mapped --- src/StaticsMergerPlugin.php | 2 +- test/StaticsMergerPluginTest.php | 180 +++++++++++++++---------------- 2 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/StaticsMergerPlugin.php b/src/StaticsMergerPlugin.php index dd799f8..f0fa019 100644 --- a/src/StaticsMergerPlugin.php +++ b/src/StaticsMergerPlugin.php @@ -405,7 +405,7 @@ public function getRelativePath($from, $to) private function getRootThemeDir($mappingDir) { return sprintf( - '%s%s/app/design/frontend/%s/web/assets', + '%s%s/app/design/frontend/%s/web', getcwd(), $this->mageDir ? '/' . $this->mageDir : '', $mappingDir diff --git a/test/StaticsMergerPluginTest.php b/test/StaticsMergerPluginTest.php index be156c6..c2e2f7f 100644 --- a/test/StaticsMergerPluginTest.php +++ b/test/StaticsMergerPluginTest.php @@ -327,8 +327,8 @@ public function testSymLinkStaticsCorrectlySymLinksStaticFiles() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); } public function testFileGlobAreAllCorrectlySymLinkedToRoot() @@ -359,20 +359,20 @@ public function testFileGlobAreAllCorrectlySymLinkedToRoot() $this->plugin->symlinkStatics($event); // Favicons linked from root - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon1"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon2"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon3"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon1")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/favicon2")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon1"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon2"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon3"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon1")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon2")); // Images linked from image dir - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image1.jpg"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image2.jpg"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image1.jpg")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image2.jpg")); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/picture1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image2.jpg"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image1.jpg")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image2.jpg")); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/picture1.jpg"); } public function testFileGlobAreAllCorrectlySymLinkedWithSetDest() @@ -387,14 +387,14 @@ public function testFileGlobAreAllCorrectlySymLinkedWithSetDest() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images"); - $this->assertTrue(is_dir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images")); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/image1.jpg"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/image2.jpg"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/image1.jpg")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/image2.jpg")); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/picture1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images"); + $this->assertTrue(is_dir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image2.jpg"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image1.jpg")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image2.jpg")); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/picture1.jpg"); } public function testStandardFilesAreAllCorrectlySymLinked() @@ -408,14 +408,14 @@ public function testStandardFilesAreAllCorrectlySymLinked() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog")); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog/image1.jpg") + file_exists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog/image1.jpg") ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog/image2.jpg") + file_exists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog/image2.jpg") ); } @@ -427,26 +427,26 @@ public function testCurrentSymlinksAreUnlinked() $packageLocation = $this->projectRoot . "/vendor/" . $package->getName(); mkdir($packageLocation . '/assets/testdir'); - mkdir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/", 0777, true); + mkdir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/", 0777, true); symlink( $packageLocation . '/assets/testdir', - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog" ); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog")); $this->assertEquals( $packageLocation . '/assets/testdir', - readLink("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog") + readLink("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog") ); $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog")); } public function testFilesAndFolderErrorWithoutDestinationSet() @@ -469,10 +469,10 @@ public function testFilesAndFolderErrorWithoutDestinationSet() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image1.jpg"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image2.jpg"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/image3.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image1.jpg"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image2.jpg"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image3.jpg"); } public function testAssetSymLinkFailsIfAlreadyExistButNotSymLink() @@ -482,10 +482,10 @@ public function testAssetSymLinkFailsIfAlreadyExistButNotSymLink() $this->localRepository->addPackage($this->createStaticPackage()); - mkdir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets", 0777, true); - touch("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets"); + mkdir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web", 0777, true); + touch("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $errorMsg = 'Your static path: "%s/htdocs/app/design/frontend/package/theme/web/assets/assets" '; + $errorMsg = 'Your static path: "%s/htdocs/app/design/frontend/package/theme/web/assets" '; $errorMsg .= 'is currently not a symlink, please remove first '; $message = sprintf($errorMsg, $this->projectRoot); @@ -496,7 +496,7 @@ public function testAssetSymLinkFailsIfAlreadyExistButNotSymLink() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertTrue(is_file("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); + $this->assertTrue(is_file("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); } public function testErrorIsReportedIfStaticPackageMissingSpecifiedSource() @@ -599,7 +599,7 @@ public function testSymlinkFail() $this->localRepository->addPackage($staticPackage); // Change perms to force symlink error - $themeDir = $this->projectRoot . '/htdocs/app/design/frontend/package/theme/web/assets'; + $themeDir = $this->projectRoot . '/htdocs/app/design/frontend/package/theme/web'; mkdir($themeDir, 0755, true); chmod($themeDir, 0400); @@ -629,12 +629,12 @@ public function testStaticsCleanupCorrectlyRemovesDirs() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); $this->plugin->staticsCleanup($event); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); } public function testStaticsCleanupOutputOnException() @@ -646,8 +646,8 @@ public function testStaticsCleanupOutputOnException() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); $filesystem = $this->getMockBuilder('Composer\Util\Filesystem') ->setMethods(array('remove')) @@ -662,7 +662,7 @@ public function testStaticsCleanupOutputOnException() ->expects($this->once()) ->method('write') ->with(sprintf( - "Failed to remove some/static from %s/htdocs/app/design/frontend/package/theme/web/assets", + "Failed to remove some/static from %s/htdocs/app/design/frontend/package/theme/web", realpath(sys_get_temp_dir()) . "/static-merge-test" )); @@ -673,8 +673,8 @@ public function testStaticsCleanupOutputOnException() $this->plugin->staticsCleanup($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); } public function testStaticsCleanupOutputOnPackageRemovalException() @@ -691,7 +691,7 @@ public function testStaticsCleanupOutputOnPackageRemovalException() ->getMock(); $themeDir = sprintf( - '%s/htdocs/app/design/frontend/package/theme/web/assets', + '%s/htdocs/app/design/frontend/package/theme/web', $this->projectRoot ); @@ -722,15 +722,15 @@ public function testStaticCleanupWillNotRemoveNonMappedThemesFromPackage() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); // Create a non mapped static theme - mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme2/web/assets', $this->projectRoot), 0777, true); + mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme2/web', $this->projectRoot), 0777, true); $this->plugin->staticsCleanup($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web"); } public function testStaticCleanupWillNotRemoveNonMappedFilesFromTheme() @@ -742,22 +742,22 @@ public function testStaticCleanupWillNotRemoveNonMappedFilesFromTheme() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); // Create a non mapped static theme - mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme/web/assets/keepdir', $this->projectRoot)); - touch(sprintf('%s/htdocs/app/design/frontend/package/theme/web/assets/keepdir/keepme.txt', $this->projectRoot)); - touch(sprintf('%s/htdocs/app/design/frontend/package/theme/web/assets/keepme.txt', $this->projectRoot)); - mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme/web/assets/removeme/', $this->projectRoot)); + mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme/web/keepdir', $this->projectRoot)); + touch(sprintf('%s/htdocs/app/design/frontend/package/theme/web/keepdir/keepme.txt', $this->projectRoot)); + touch(sprintf('%s/htdocs/app/design/frontend/package/theme/web/keepme.txt', $this->projectRoot)); + mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme/web/removeme/', $this->projectRoot)); $this->plugin->staticsCleanup($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/keepdir"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/keepdir/keepme.txt"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/keepme.txt"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/removeme"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/keepdir"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/keepdir/keepme.txt"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/keepme.txt"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/removeme"); } public function testStaticsCleanupWorksWithNoFilesToClean() @@ -769,12 +769,12 @@ public function testStaticsCleanupWorksWithNoFilesToClean() $this->activatePlugin(); $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); $this->plugin->staticsCleanup($event); $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); } public function testGetStaticMapsWillReturnAll() @@ -896,71 +896,71 @@ public function testMultipleThemesForOnePackageLinksCorrectly() // package/theme $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog" ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/assets") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets") ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog") ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog/image1.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog/image1.jpg" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets/images/catalog/image2.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog/image2.jpg" ); // package/theme2 $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/images/catalog" ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets") ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/images/catalog") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/images/catalog") ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets/images/catalog/image1.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/images/catalog/image1.jpg" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/assets/images/catalog/image2.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/images/catalog/image2.jpg" ); // package2/theme $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets" + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/assets" + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/images/catalog" ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/assets") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets") ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/images/catalog") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/images/catalog") ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/images/catalog/image1.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/images/catalog/image1.jpg" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets/images/catalog/image2.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/images/catalog/image2.jpg" ); } From 3c54280c3aba80de9fa0e824c32addae31a30a92 Mon Sep 17 00:00:00 2001 From: Michael Woodward Date: Mon, 18 Jul 2016 10:25:32 +0100 Subject: [PATCH 3/4] =?UTF-8?q?Move=20to=20>=3DPHP7=20=F0=9F=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- composer.lock | 1194 +++++++++++++++++++++++------- src/StaticsMergerPlugin.php | 141 ++-- test/StaticsMergerPluginTest.php | 35 +- 4 files changed, 1009 insertions(+), 363 deletions(-) diff --git a/composer.json b/composer.json index 2b78863..3b6c65f 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ }, "require-dev": { "composer/composer": "dev-master", - "phpunit/phpunit": "~4.4", + "phpunit/phpunit": "^5.0.0", "squizlabs/php_codesniffer": "2.3.*" } } diff --git a/composer.lock b/composer.lock index b64dace..7b6776a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,40 +4,102 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "c126040b2bbe1c11a5b11a7d4c366ff3", + "hash": "24b8284ce17b5e37aa104b6d6308542d", + "content-hash": "41e6af2ee26eb43486eb590ad9b3bf04", "packages": [], "packages-dev": [ + { + "name": "composer/ca-bundle", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "a2995e5fe351055f2c7630166af12ce8fd03edfc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/a2995e5fe351055f2c7630166af12ce8fd03edfc", + "reference": "a2995e5fe351055f2c7630166af12ce8fd03edfc", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "symfony/process": "^2.5 || ^3.0" + }, + "suggest": { + "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2016-04-13 10:13:24" + }, { "name": "composer/composer", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "c471edc488f49f254c77ab97ecc14ea50bf3d2ab" + "reference": "a242f7e9ba50765573e142a9f033b548034cc261" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/c471edc488f49f254c77ab97ecc14ea50bf3d2ab", - "reference": "c471edc488f49f254c77ab97ecc14ea50bf3d2ab", + "url": "https://api.github.com/repos/composer/composer/zipball/a242f7e9ba50765573e142a9f033b548034cc261", + "reference": "a242f7e9ba50765573e142a9f033b548034cc261", "shasum": "" }, "require": { - "justinrainbow/json-schema": "~1.4", - "php": ">=5.3.2", - "seld/cli-prompt": "~1.0", - "seld/jsonlint": "~1.0", - "seld/phar-utils": "~1.0", - "symfony/console": "~2.5", - "symfony/finder": "~2.2", - "symfony/process": "~2.1" + "composer/ca-bundle": "^1.0", + "composer/semver": "^1.0", + "composer/spdx-licenses": "^1.0", + "justinrainbow/json-schema": "^1.6 || ^2.0", + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0", + "seld/cli-prompt": "^1.0", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.5 || ^3.0", + "symfony/filesystem": "^2.5 || ^3.0", + "symfony/finder": "^2.2 || ^3.0", + "symfony/process": "^2.1 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0" + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives, and allows gzip compression of all internet traffic" + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" }, "bin": [ "bin/composer" @@ -45,12 +107,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.2-dev" } }, "autoload": { - "psr-0": { - "Composer": "src/" + "psr-4": { + "Composer\\": "src/Composer" } }, "notification-url": "https://packagist.org/downloads/", @@ -76,20 +138,143 @@ "dependency", "package" ], - "time": "2015-06-11 10:22:19" + "time": "2016-07-12 15:18:30" + }, + { + "name": "composer/semver", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "03c9de5aa25e7672c4ad251eeaba0c47a06c8b98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/03c9de5aa25e7672c4ad251eeaba0c47a06c8b98", + "reference": "03c9de5aa25e7672c4ad251eeaba0c47a06c8b98", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2016-06-02 09:04:51" + }, + { + "name": "composer/spdx-licenses", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "88c26372b1afac36d8db601cdf04ad8716f53d88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/88c26372b1afac36d8db601cdf04ad8716f53d88", + "reference": "88c26372b1afac36d8db601cdf04ad8716f53d88", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "time": "2016-05-04 12:27:30" }, { "name": "doctrine/instantiator", - "version": "1.0.4", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { @@ -100,7 +285,7 @@ "ext-pdo": "*", "ext-phar": "*", "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { @@ -109,8 +294,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -130,29 +315,29 @@ "constructor", "instantiate" ], - "time": "2014-10-13 12:58:55" + "time": "2015-06-14 21:17:01" }, { "name": "justinrainbow/json-schema", - "version": "1.4.1", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2465fe486c864e30badaa4d005ebdf89dbc503f3" + "reference": "6b2a33e6a768f96bdc2ead5600af0822eed17d67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2465fe486c864e30badaa4d005ebdf89dbc503f3", - "reference": "2465fe486c864e30badaa4d005ebdf89dbc503f3", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/6b2a33e6a768f96bdc2ead5600af0822eed17d67", + "reference": "6b2a33e6a768f96bdc2ead5600af0822eed17d67", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.3" }, "require-dev": { - "json-schema/json-schema-test-suite": "1.1.0", + "json-schema/json-schema-test-suite": "1.2.0", "phpdocumentor/phpdocumentor": "~2", - "phpunit/phpunit": "~3.7" + "phpunit/phpunit": "^4.8.22" }, "bin": [ "bin/validate-json" @@ -160,17 +345,17 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-0": { - "JsonSchema": "src/" + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { @@ -196,41 +381,180 @@ "json", "schema" ], - "time": "2015-03-27 16:41:39" + "time": "2016-06-02 10:59:52" + }, + { + "name": "myclabs/deep-copy", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "a8773992b362b58498eed24bf85005f363c34771" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771", + "reference": "a8773992b362b58498eed24bf85005f363c34771", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2015-11-20 12:04:31" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-06-10 09:48:41" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -242,37 +566,39 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2016-06-10 07:14:17" }, { "name": "phpspec/prophecy", - "version": "v1.4.1", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -305,43 +631,44 @@ "spy", "stub" ], - "time": "2015-04-27 22:15:08" + "time": "2016-06-07 08:13:47" }, { "name": "phpunit/php-code-coverage", - "version": "2.1.5", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e" + "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/be2286cb8c7e1773eded49d9719219e6f74f9e3e", - "reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/900370c81280cc0d942ffbc5912d80464eaee7e9", + "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9", "shasum": "" }, "require": { - "php": ">=5.3.3", + "php": "^5.6 || ^7.0", "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" + "phpunit/php-token-stream": "^1.4.2", + "sebastian/code-unit-reverse-lookup": "~1.0", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0|~2.0" }, "require-dev": { "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "phpunit/phpunit": "^5.4" }, "suggest": { "ext-dom": "*", - "ext-xdebug": ">=2.2.1", + "ext-xdebug": ">=2.4.0", "ext-xmlwriter": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -367,20 +694,20 @@ "testing", "xunit" ], - "time": "2015-06-09 13:05:42" + "time": "2016-06-03 05:03:56" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "shasum": "" }, "require": { @@ -414,20 +741,20 @@ "filesystem", "iterator" ], - "time": "2015-04-02 05:19:05" + "time": "2015-06-21 13:08:43" }, { "name": "phpunit/php-text-template", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { @@ -436,20 +763,17 @@ "type": "library", "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -458,35 +782,35 @@ "keywords": [ "template" ], - "time": "2014-01-30 17:20:04" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.5", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "type": "library", "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -502,20 +826,20 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", - "version": "1.4.1", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "eab81d02569310739373308137284e0158424330" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/eab81d02569310739373308137284e0158424330", - "reference": "eab81d02569310739373308137284e0158424330", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -551,20 +875,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-04-08 04:46:07" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "4.7.2", + "version": "5.4.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "8e0c63329c8c4185296b8d357daa5c6bae43080f" + "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e0c63329c8c4185296b8d357daa5c6bae43080f", - "reference": "8e0c63329c8c4185296b8d357daa5c6bae43080f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", + "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", "shasum": "" }, "require": { @@ -573,21 +897,27 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", - "phpunit/php-code-coverage": "~2.1", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "^4.0", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0", - "phpunit/phpunit-mock-objects": "~2.3", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", + "sebastian/environment": "^1.3 || ^2.0", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", + "sebastian/object-enumerator": "~1.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0|~2.0", "symfony/yaml": "~2.1|~3.0" }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, "suggest": { "phpunit/php-invoker": "~1.1" }, @@ -597,63 +927,155 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.7.x-dev" + "dev-master": "5.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2016-06-16 06:01:15" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "b13d0d9426ced06958bd32104653526a6c998a52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", + "reference": "b13d0d9426ced06958bd32104653526a6c998a52", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2016-06-12 07:37:26" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Common interface for logging libraries", "keywords": [ - "phpunit", - "testing", - "xunit" + "log", + "psr", + "psr-3" ], - "time": "2015-06-06 08:36:08" + "time": "2012-12-21 11:40:51" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.3", + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "253c005852591fd547fc18cd5b7b43a1ec82d8f7" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/253c005852591fd547fc18cd5b7b43a1ec82d8f7", - "reference": "253c005852591fd547fc18cd5b7b43a1ec82d8f7", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "~5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -668,30 +1090,25 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-05-29 05:19:18" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2016-02-13 06:45:14" }, { "name": "sebastian/comparator", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "shasum": "" }, "require": { @@ -705,7 +1122,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -742,32 +1159,32 @@ "compare", "equality" ], - "time": "2015-01-29 16:28:08" + "time": "2015-07-26 15:48:44" }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -790,24 +1207,24 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/environment", - "version": "1.2.2", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { @@ -844,20 +1261,20 @@ "environment", "hhvm" ], - "time": "2015-01-01 10:01:08" + "time": "2016-05-17 03:18:57" }, { "name": "sebastian/exporter", - "version": "1.2.0", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -865,12 +1282,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -910,20 +1328,20 @@ "export", "exporter" ], - "time": "2015-01-27 07:23:06" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { @@ -961,20 +1379,66 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2015-10-12 03:26:01" }, { - "name": "sebastian/recursion-context", + "name": "sebastian/object-enumerator", "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", + "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2016-01-28 13:25:10" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -1014,23 +1478,73 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" + "time": "2015-11-11 19:50:13" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", - "version": "1.0.5", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" + "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", "shasum": "" }, + "require": { + "php": ">=5.6" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1049,20 +1563,20 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-02-24 06:35:25" + "time": "2016-02-04 12:56:52" }, { "name": "seld/cli-prompt", - "version": "1.0.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/Seldaek/cli-prompt.git", - "reference": "fe114c7a6ac5cb0ce76932ae4017024d9842a49c" + "reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/fe114c7a6ac5cb0ce76932ae4017024d9842a49c", - "reference": "fe114c7a6ac5cb0ce76932ae4017024d9842a49c", + "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4", + "reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4", "shasum": "" }, "require": { @@ -1097,24 +1611,24 @@ "input", "prompt" ], - "time": "2015-04-30 20:24:49" + "time": "2016-04-18 09:31:41" }, { "name": "seld/jsonlint", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "863ae85c6d3ef60ca49cb12bd051c4a0648c40c4" + "reference": "66834d3e3566bb5798db7294619388786ae99394" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/863ae85c6d3ef60ca49cb12bd051c4a0648c40c4", - "reference": "863ae85c6d3ef60ca49cb12bd051c4a0648c40c4", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/66834d3e3566bb5798db7294619388786ae99394", + "reference": "66834d3e3566bb5798db7294619388786ae99394", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^5.3 || ^7.0" }, "bin": [ "bin/jsonlint" @@ -1143,20 +1657,20 @@ "parser", "validator" ], - "time": "2015-01-04 21:18:15" + "time": "2015-11-21 02:21:41" }, { "name": "seld/phar-utils", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "336bb5ee20de511f3c1a164222fcfd194afcab3a" + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/336bb5ee20de511f3c1a164222fcfd194afcab3a", - "reference": "336bb5ee20de511f3c1a164222fcfd194afcab3a", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", "shasum": "" }, "require": { @@ -1187,20 +1701,20 @@ "keywords": [ "phra" ], - "time": "2015-05-01 12:45:48" + "time": "2015-10-13 18:44:15" }, { "name": "squizlabs/php_codesniffer", - "version": "2.3.2", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "e96d8579fbed0c95ecf2a0501ec4f307a4aa6404" + "reference": "11a2545c44a5915f883e2e5ec12e14ed345e3ab2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e96d8579fbed0c95ecf2a0501ec4f307a4aa6404", - "reference": "e96d8579fbed0c95ecf2a0501ec4f307a4aa6404", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/11a2545c44a5915f883e2e5ec12e14ed345e3ab2", + "reference": "11a2545c44a5915f883e2e5ec12e14ed345e3ab2", "shasum": "" }, "require": { @@ -1261,30 +1775,30 @@ "phpcs", "standards" ], - "time": "2015-04-28 23:28:20" + "time": "2015-09-09 00:18:50" }, { "name": "symfony/console", - "version": "v2.7.0", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "7f0bec04961c61c961df0cb8c2ae88dbfd83f399" + "url": "https://github.com/symfony/console.git", + "reference": "747154aa69b0f83cd02fc9aa554836dee417631a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/7f0bec04961c61c961df0cb8c2ae88dbfd83f399", - "reference": "7f0bec04961c61c961df0cb8c2ae88dbfd83f399", + "url": "https://api.github.com/repos/symfony/console/zipball/747154aa69b0f83cd02fc9aa554836dee417631a", + "reference": "747154aa69b0f83cd02fc9aa554836dee417631a", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", @@ -1294,13 +1808,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.1-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1318,38 +1835,87 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-05-29 16:22:24" + "time": "2016-06-29 07:02:31" }, { - "name": "symfony/finder", - "version": "v2.7.0", + "name": "symfony/filesystem", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "ccb8ed8339cf24824f2ef35dacec30d92ff44368" + "url": "https://github.com/symfony/filesystem.git", + "reference": "322da5f0910d8aa0b25fa65ffccaba68dbddb890" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/ccb8ed8339cf24824f2ef35dacec30d92ff44368", - "reference": "ccb8ed8339cf24824f2ef35dacec30d92ff44368", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/322da5f0910d8aa0b25fa65ffccaba68dbddb890", + "reference": "322da5f0910d8aa0b25fa65ffccaba68dbddb890", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2016-06-29 05:41:56" + }, + { + "name": "symfony/finder", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "8201978de88a9fa0923e18601bb17f1df9c721e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/8201978de88a9fa0923e18601bb17f1df9c721e7", + "reference": "8201978de88a9fa0923e18601bb17f1df9c721e7", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.1-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1367,39 +1933,98 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2015-05-15 14:02:48" + "time": "2016-06-29 05:41:56" }, { - "name": "symfony/process", - "version": "v2.7.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "e0a82b58e36afc60f8e79b8bc85a22bb064077c1" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "dff51f72b0706335131b00a7f49606168c582594" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/e0a82b58e36afc60f8e79b8bc85a22bb064077c1", - "reference": "e0a82b58e36afc60f8e79b8bc85a22bb064077c1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.3.3" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "1.2-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-05-18 14:26:46" + }, + { + "name": "symfony/process", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "5c11a1a4d4016662eeaf0f8757958c7de069f9a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/5c11a1a4d4016662eeaf0f8757958c7de069f9a0", + "reference": "5c11a1a4d4016662eeaf0f8757958c7de069f9a0", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" } }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -1416,38 +2041,38 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-05-15 13:33:16" + "time": "2016-06-29 05:42:25" }, { "name": "symfony/yaml", - "version": "v2.7.0", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3" + "url": "https://github.com/symfony/yaml.git", + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/4a29a5248aed4fb45f626a7bbbd330291492f5c3", - "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de", + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de", "shasum": "" }, "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.1-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1465,7 +2090,56 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-05-02 15:21:08" + "time": "2016-06-29 05:41:56" + }, + { + "name": "webmozart/assert", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2015-08-24 13:29:44" } ], "aliases": [], diff --git a/src/StaticsMergerPlugin.php b/src/StaticsMergerPlugin.php index f0fa019..8cbd1b2 100644 --- a/src/StaticsMergerPlugin.php +++ b/src/StaticsMergerPlugin.php @@ -46,12 +46,12 @@ class StaticsMergerPlugin implements PluginInterface, EventSubscriberInterface /** * @var array */ - protected $packageExtra = array(); + protected $packageExtra = []; /** * @var array */ - protected $staticMaps = array(); + protected $staticMaps = []; /** * @var string @@ -59,11 +59,9 @@ class StaticsMergerPlugin implements PluginInterface, EventSubscriberInterface protected $mageDir = ''; /** - * @param Composer $composer - * @param IOInterface $io - * @return bool|void + * @throws \RuntimeException On composer config failure */ - public function activate(Composer $composer, IOInterface $io) + public function activate(Composer $composer, IOInterface $io) : bool { $this->composer = $composer; $this->io = $io; @@ -71,36 +69,29 @@ public function activate(Composer $composer, IOInterface $io) $this->filesystem = new Filesystem(); $this->packageExtra = $this->composer->getPackage()->getExtra(); - if (!isset($this->packageExtra['static-map'])) { - $this->io->write("No static maps defined"); + if (!array_key_exists('static-map', $this->packageExtra)) { + $this->io->write('No static maps defined'); return false; } - if (!isset($this->packageExtra['magento-root-dir'])) { - $this->io->write("Magento root dir not defined, assumed current working directory"); + if (!array_key_exists('magento-root-dir', $this->packageExtra)) { + $this->io->write('Magento root dir not defined, assumed current working directory'); } else { $this->mageDir = rtrim($this->packageExtra['magento-root-dir'], '/'); } $this->staticMaps = $this->packageExtra['static-map']; + return true; } - /** - * @param PackageInterface $package - * @return string - */ - public function getInstallPath(PackageInterface $package) + public function getInstallPath(PackageInterface $package) : string { $targetDir = $package->getTargetDir(); return $this->getPackageBasePath($package) . ($targetDir ? '/'.$targetDir : ''); } - /** - * @param PackageInterface $package - * @return string - */ - protected function getPackageBasePath(PackageInterface $package) + protected function getPackageBasePath(PackageInterface $package) : string { $this->filesystem->ensureDirectoryExists($this->vendorDir); $this->vendorDir = realpath($this->vendorDir); @@ -108,33 +99,24 @@ protected function getPackageBasePath(PackageInterface $package) return ($this->vendorDir ? $this->vendorDir.'/' : '') . $package->getPrettyName(); } - /** - * Tell event dispatcher what events we want to subscribe to - * @return array - */ - public static function getSubscribedEvents() + public static function getSubscribedEvents() : array { - return array( - ScriptEvents::PRE_INSTALL_CMD => array( - array('staticsCleanup', 0) - ), - ScriptEvents::PRE_UPDATE_CMD => array( - array('staticsCleanup', 0) - ), - ScriptEvents::POST_INSTALL_CMD => array( - array('symlinkStatics', 0) - ), - ScriptEvents::POST_UPDATE_CMD => array( - array('symlinkStatics', 0) - ) - ); + return [ + ScriptEvents::PRE_INSTALL_CMD => [ + ['staticsCleanup', 0] + ], + ScriptEvents::PRE_UPDATE_CMD => [ + ['staticsCleanup', 0] + ], + ScriptEvents::POST_INSTALL_CMD => [ + ['symlinkStatics', 0] + ], + ScriptEvents::POST_UPDATE_CMD => [ + ['symlinkStatics', 0] + ] + ]; } - /** - * Symlink the static repositories - * @param Event $event - * @return bool|void - */ public function symlinkStatics(Event $event) { foreach ($this->getStaticPackages() as $package) { @@ -144,8 +126,8 @@ public function symlinkStatics(Event $event) $destinationTheme = $this->getRootThemeDir($mappingDir); // Add slash to paths - $packageSource = rtrim($packageSource, "/"); - $destinationTheme = rtrim($destinationTheme, "/"); + $packageSource = rtrim($packageSource, '/'); + $destinationTheme = rtrim($destinationTheme, '/'); // If theme doesn't exist - Create it $this->filesystem->ensureDirectoryExists($destinationTheme); @@ -166,12 +148,9 @@ public function symlinkStatics(Event $event) } /** - * @param string $packageSource - * @param string $destinationTheme - * @param array $files - * @return bool|void + * Processes defined file mappings and symlinks resulting files to destination theme */ - public function processFiles($packageSource, $destinationTheme, $files = array()) + public function processFiles(string $packageSource, string $destinationTheme, array $files = []) { foreach ($files as $file) { // Ensure we have correct json @@ -207,15 +186,14 @@ public function processFiles($packageSource, $destinationTheme, $files = array() } /** - * Process symlink with checks given source and destination paths - * @param string $packageSrc - * @param string $relativeSourcePath - * @param string $destinationTheme - * @param string $relativeDestinationPath - * @return bool|void + * Process symlink, checks given source and destination paths */ - public function processSymlink($packageSrc, $relativeSourcePath, $destinationTheme, $relativeDestinationPath) - { + public function processSymlink( + string $packageSrc, + string $relativeSourcePath, + string $destinationTheme, + string $relativeDestinationPath + ) { $sourcePath = sprintf("%s/%s", $packageSrc, $relativeSourcePath); $destinationPath = sprintf("%s/%s", $destinationTheme, $relativeDestinationPath); @@ -223,7 +201,7 @@ public function processSymlink($packageSrc, $relativeSourcePath, $destinationThe $this->io->write( sprintf('The static package does not contain directory: "%s" ', $relativeSourcePath) ); - return false; + return; } if (file_exists($destinationPath) && !is_link($destinationPath)) { @@ -233,7 +211,7 @@ public function processSymlink($packageSrc, $relativeSourcePath, $destinationThe $destinationPath ) ); - return false; + return; } //if it's a link, remove it and recreate it @@ -248,17 +226,14 @@ public function processSymlink($packageSrc, $relativeSourcePath, $destinationThe $relativeSourcePath = $this->getRelativePath($destinationPath, $sourcePath); if (!@\symlink($relativeSourcePath, $destinationPath)) { - $this->io->write( - "Failed to symlink $sourcePath to $destinationPath" - ); + $this->io->write(sprintf('Failed to symlink %s to %s', $sourcePath, $destinationPath)); } } /** * Get filtered packages array - * @return array */ - public function getStaticPackages() + public function getStaticPackages() : array { $packages = $this->composer->getRepositoryManager()->getLocalRepository()->getPackages(); @@ -269,24 +244,21 @@ public function getStaticPackages() /** * Get a single static package's maps or all static maps - * @param null $packageName - * @return array */ - public function getStaticMaps($packageName = null) + public function getStaticMaps($packageName = null) : array { if ($packageName === null) { return $this->staticMaps; } elseif (array_key_exists($packageName, $this->staticMaps)) { return $this->staticMaps[$packageName]; } else { - $this->io->write(sprintf("Mappings for %s are not defined", $packageName)); - return array(); + $this->io->write(sprintf('Mappings for %s are not defined', $packageName)); + return []; } } /** - * @param Event $event - * @return bool|void + * Isolated event that runs on PRE hooks to cleanup mapped packages */ public function staticsCleanup(Event $event) { @@ -324,9 +296,8 @@ public function staticsCleanup(Event $event) /** * Try to cleanup a file/dir, output on exception - * @param $path */ - private function tryCleanup($path, $errorMsg) + private function tryCleanup(string $path, string $errorMsg) { try { $this->filesystem->remove($path); @@ -337,12 +308,9 @@ private function tryCleanup($path, $errorMsg) /** * Get full directory listing without dots - * @param string $path - * @return array */ - private function getFullDirectoryListing($path) + private function getFullDirectoryListing(string $path) : array { - // TODO: RecursiveDirectoryIterator::SKIP_DOTS ? $listings = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path)); $listingArr = array_keys(\iterator_to_array($listings)); @@ -355,17 +323,10 @@ private function getFullDirectoryListing($path) } /** - * Returns the relative path from $from to $to - * * This is utility method for symlink creation. * @see http://stackoverflow.com/a/2638272/485589 - * - * @param string $from - * @param string $to - * - * @return string */ - public function getRelativePath($from, $to) + public function getRelativePath(string $from, string $to) : string { // some compatibility fixes for Windows paths $from = is_dir($from) ? rtrim($from, '\/') . '/' : $from; @@ -398,11 +359,7 @@ public function getRelativePath($from, $to) return implode('/', $relPath); } - /** - * @param $mappingDir - * @return string - */ - private function getRootThemeDir($mappingDir) + private function getRootThemeDir(string $mappingDir) : string { return sprintf( '%s%s/app/design/frontend/%s/web', diff --git a/test/StaticsMergerPluginTest.php b/test/StaticsMergerPluginTest.php index c2e2f7f..a397618 100644 --- a/test/StaticsMergerPluginTest.php +++ b/test/StaticsMergerPluginTest.php @@ -8,7 +8,6 @@ use Composer\Repository\RepositoryManager; use Composer\Repository\WritableArrayRepository; use Composer\Script\Event; -use Composer\Util\Filesystem; use Jh\StaticsMerger\StaticsMergerPlugin; use Composer\Test\TestCase; use Composer\Composer; @@ -48,7 +47,7 @@ public function setUp() ), )); - $this->io = $this->getMock('Composer\IO\IOInterface'); + $this->io = static::createMock('Composer\IO\IOInterface'); $this->repoManager = new RepositoryManager($this->io, $this->config); $this->localRepository = new WritableArrayRepository(); $this->composer->setRepositoryManager($this->repoManager); @@ -387,14 +386,30 @@ public function testFileGlobAreAllCorrectlySymLinkedWithSetDest() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images"); - $this->assertTrue(is_dir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images")); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image1.jpg"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image2.jpg"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image1.jpg")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image2.jpg")); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/picture1.jpg"); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images" + ); + $this->assertTrue( + is_dir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images") + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image1.jpg" + ); + $this->assertFileExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image2.jpg" + ); + $this->assertTrue( + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image1.jpg") + ); + $this->assertTrue( + is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image2.jpg") + ); + $this->assertFileNotExists( + "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/picture1.jpg" + ); } public function testStandardFilesAreAllCorrectlySymLinked() From 9a46c7b7204d0dd64692779c603f2c3d8b60fd27 Mon Sep 17 00:00:00 2001 From: Michael Woodward Date: Mon, 18 Jul 2016 11:43:48 +0100 Subject: [PATCH 4/4] Ensure vendor dir name is capitalised --- src/StaticsMergerPlugin.php | 4 +- test/StaticsMergerPluginTest.php | 188 +++++++++++++++---------------- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/src/StaticsMergerPlugin.php b/src/StaticsMergerPlugin.php index 8cbd1b2..2090a9f 100644 --- a/src/StaticsMergerPlugin.php +++ b/src/StaticsMergerPlugin.php @@ -280,7 +280,7 @@ public function staticsCleanup(Event $event) foreach ($contents as $content) { // Remove packages symlinked files/dirs - if (is_link($content) && strpos($content, $mappingDir . '/web/assets') !== false) { + if (is_link($content)) { $this->tryCleanup($content, $errorMsg); continue; } @@ -365,7 +365,7 @@ private function getRootThemeDir(string $mappingDir) : string '%s%s/app/design/frontend/%s/web', getcwd(), $this->mageDir ? '/' . $this->mageDir : '', - $mappingDir + ucwords($mappingDir) ); } } diff --git a/test/StaticsMergerPluginTest.php b/test/StaticsMergerPluginTest.php index a397618..1c9b86e 100644 --- a/test/StaticsMergerPluginTest.php +++ b/test/StaticsMergerPluginTest.php @@ -326,8 +326,8 @@ public function testSymLinkStaticsCorrectlySymLinksStaticFiles() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets")); } public function testFileGlobAreAllCorrectlySymLinkedToRoot() @@ -358,20 +358,20 @@ public function testFileGlobAreAllCorrectlySymLinkedToRoot() $this->plugin->symlinkStatics($event); // Favicons linked from root - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon1"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon2"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon3"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon1")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/favicon2")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/favicon1"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/favicon2"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/favicon3"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/favicon1")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/favicon2")); // Images linked from image dir - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image1.jpg"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image2.jpg"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image1.jpg")); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image2.jpg")); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/picture1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/image1.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/image2.jpg"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/image1.jpg")); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/image2.jpg")); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/picture1.jpg"); } public function testFileGlobAreAllCorrectlySymLinkedWithSetDest() @@ -387,28 +387,28 @@ public function testFileGlobAreAllCorrectlySymLinkedWithSetDest() $this->plugin->symlinkStatics($event); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images" ); $this->assertTrue( - is_dir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images") + is_dir("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images") ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image1.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/image1.jpg" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image2.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/image2.jpg" ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image1.jpg") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/image1.jpg") ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/image2.jpg") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/image2.jpg") ); $this->assertFileNotExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/picture1.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/picture1.jpg" ); } @@ -423,14 +423,14 @@ public function testStandardFilesAreAllCorrectlySymLinked() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog")); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog/image1.jpg") + file_exists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog/image1.jpg") ); $this->assertTrue( - file_exists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog/image2.jpg") + file_exists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog/image2.jpg") ); } @@ -442,26 +442,26 @@ public function testCurrentSymlinksAreUnlinked() $packageLocation = $this->projectRoot . "/vendor/" . $package->getName(); mkdir($packageLocation . '/assets/testdir'); - mkdir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/", 0777, true); + mkdir("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/", 0777, true); symlink( $packageLocation . '/assets/testdir', - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog" ); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog")); $this->assertEquals( $packageLocation . '/assets/testdir', - readLink("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog") + readLink("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog") ); $event = new Event('event', $this->composer, $this->io); $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog")); } public function testFilesAndFolderErrorWithoutDestinationSet() @@ -484,10 +484,10 @@ public function testFilesAndFolderErrorWithoutDestinationSet() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image1.jpg"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image2.jpg"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/image3.jpg"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/image1.jpg"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/image2.jpg"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/image3.jpg"); } public function testAssetSymLinkFailsIfAlreadyExistButNotSymLink() @@ -497,10 +497,10 @@ public function testAssetSymLinkFailsIfAlreadyExistButNotSymLink() $this->localRepository->addPackage($this->createStaticPackage()); - mkdir("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web", 0777, true); - touch("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets"); + mkdir("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web", 0777, true); + touch("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets"); - $errorMsg = 'Your static path: "%s/htdocs/app/design/frontend/package/theme/web/assets" '; + $errorMsg = 'Your static path: "%s/htdocs/app/design/frontend/Package/theme/web/assets" '; $errorMsg .= 'is currently not a symlink, please remove first '; $message = sprintf($errorMsg, $this->projectRoot); @@ -511,7 +511,7 @@ public function testAssetSymLinkFailsIfAlreadyExistButNotSymLink() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertTrue(is_file("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); + $this->assertTrue(is_file("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets")); } public function testErrorIsReportedIfStaticPackageMissingSpecifiedSource() @@ -614,7 +614,7 @@ public function testSymlinkFail() $this->localRepository->addPackage($staticPackage); // Change perms to force symlink error - $themeDir = $this->projectRoot . '/htdocs/app/design/frontend/package/theme/web'; + $themeDir = $this->projectRoot . '/htdocs/app/design/frontend/Package/theme/web'; mkdir($themeDir, 0755, true); chmod($themeDir, 0400); @@ -644,12 +644,12 @@ public function testStaticsCleanupCorrectlyRemovesDirs() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets")); $this->plugin->staticsCleanup($event); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); } public function testStaticsCleanupOutputOnException() @@ -661,8 +661,8 @@ public function testStaticsCleanupOutputOnException() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets")); $filesystem = $this->getMockBuilder('Composer\Util\Filesystem') ->setMethods(array('remove')) @@ -677,7 +677,7 @@ public function testStaticsCleanupOutputOnException() ->expects($this->once()) ->method('write') ->with(sprintf( - "Failed to remove some/static from %s/htdocs/app/design/frontend/package/theme/web", + "Failed to remove some/static from %s/htdocs/app/design/frontend/Package/theme/web", realpath(sys_get_temp_dir()) . "/static-merge-test" )); @@ -688,8 +688,8 @@ public function testStaticsCleanupOutputOnException() $this->plugin->staticsCleanup($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets")); } public function testStaticsCleanupOutputOnPackageRemovalException() @@ -706,7 +706,7 @@ public function testStaticsCleanupOutputOnPackageRemovalException() ->getMock(); $themeDir = sprintf( - '%s/htdocs/app/design/frontend/package/theme/web', + '%s/htdocs/app/design/frontend/Package/theme/web', $this->projectRoot ); @@ -718,7 +718,7 @@ public function testStaticsCleanupOutputOnPackageRemovalException() $this->io ->expects($this->once()) ->method('write') - ->with(sprintf("Failed to remove some/static from %s", $themeDir)); + ->with(sprintf('Failed to remove some/static from %s', $themeDir)); $refObject = new ReflectionObject($this->plugin); $refProperty = $refObject->getProperty('filesystem'); @@ -737,15 +737,15 @@ public function testStaticCleanupWillNotRemoveNonMappedThemesFromPackage() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets")); // Create a non mapped static theme - mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme2/web', $this->projectRoot), 0777, true); + mkdir(sprintf('%s/htdocs/app/design/frontend/Package/theme2/web', $this->projectRoot), 0777, true); $this->plugin->staticsCleanup($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme2/web"); } public function testStaticCleanupWillNotRemoveNonMappedFilesFromTheme() @@ -757,22 +757,22 @@ public function testStaticCleanupWillNotRemoveNonMappedFilesFromTheme() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets")); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertTrue(is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets")); // Create a non mapped static theme - mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme/web/keepdir', $this->projectRoot)); - touch(sprintf('%s/htdocs/app/design/frontend/package/theme/web/keepdir/keepme.txt', $this->projectRoot)); - touch(sprintf('%s/htdocs/app/design/frontend/package/theme/web/keepme.txt', $this->projectRoot)); - mkdir(sprintf('%s/htdocs/app/design/frontend/package/theme/web/removeme/', $this->projectRoot)); + mkdir(sprintf('%s/htdocs/app/design/frontend/Package/theme/web/keepdir', $this->projectRoot)); + touch(sprintf('%s/htdocs/app/design/frontend/Package/theme/web/keepdir/keepme.txt', $this->projectRoot)); + touch(sprintf('%s/htdocs/app/design/frontend/Package/theme/web/keepme.txt', $this->projectRoot)); + mkdir(sprintf('%s/htdocs/app/design/frontend/Package/theme/web/removeme/', $this->projectRoot)); $this->plugin->staticsCleanup($event); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/keepdir"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/keepdir/keepme.txt"); - $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/keepme.txt"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/removeme"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/keepdir"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/keepdir/keepme.txt"); + $this->assertFileExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/keepme.txt"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/removeme"); } public function testStaticsCleanupWorksWithNoFilesToClean() @@ -784,12 +784,12 @@ public function testStaticsCleanupWorksWithNoFilesToClean() $this->activatePlugin(); $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); $this->plugin->staticsCleanup($event); $this->assertFileNotExists("{$this->projectRoot}/htdocs/skin/frontend/package"); - $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web"); + $this->assertFileNotExists("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web"); } public function testGetStaticMapsWillReturnAll() @@ -909,73 +909,73 @@ public function testMultipleThemesForOnePackageLinksCorrectly() $this->activatePlugin(); $this->plugin->symlinkStatics($event); - // package/theme + // Package/theme $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog" ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/assets") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/assets") ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog") ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog/image1.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog/image1.jpg" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme/web/images/catalog/image2.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme/web/images/catalog/image2.jpg" ); - // package/theme2 + // Package/theme2 $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme2/web/" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme2/web/assets" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme2/web/assets/images/catalog" ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme2/web/assets") ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/images/catalog") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package/theme2/web/images/catalog") ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/images/catalog/image1.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme2/web/assets/images/catalog/image1.jpg" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package/theme2/web/assets/images/catalog/image2.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package/theme2/web/assets/images/catalog/image2.jpg" ); - // package2/theme + // Package2/theme $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web" + "{$this->projectRoot}/htdocs/app/design/frontend/Package2/theme/web" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets" + "{$this->projectRoot}/htdocs/app/design/frontend/Package2/theme/web/assets" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/images/catalog" + "{$this->projectRoot}/htdocs/app/design/frontend/Package2/theme/web/images/catalog" ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/assets") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package2/theme/web/assets") ); $this->assertTrue( - is_link("{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/images/catalog") + is_link("{$this->projectRoot}/htdocs/app/design/frontend/Package2/theme/web/images/catalog") ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/images/catalog/image1.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package2/theme/web/images/catalog/image1.jpg" ); $this->assertFileExists( - "{$this->projectRoot}/htdocs/app/design/frontend/package2/theme/web/images/catalog/image2.jpg" + "{$this->projectRoot}/htdocs/app/design/frontend/Package2/theme/web/images/catalog/image2.jpg" ); }