From f4cf842f0b427c8ca1879174dae94b6bb8438fa7 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 19:06:25 +0000 Subject: [PATCH 01/59] Mark multiple stable extensions scenario as critical --- features/extensions_are_catalogued.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/extensions_are_catalogued.feature b/features/extensions_are_catalogued.feature index f7321e8..3cbb0fe 100644 --- a/features/extensions_are_catalogued.feature +++ b/features/extensions_are_catalogued.feature @@ -14,6 +14,7 @@ Feature: Extensions are catalogued Then the extension catalogue should contain 1 extension And "behat/symfony2-extension" extension should be in the catalogue + @critical Scenario: Releasing multiple stable extensions Given "behat/symfony2-extension" extension was created in "Behat/Symfony2Extension" And "behat/mink-extension" extension was created in "Behat/MinkExtension" From 55b4ecf0ebcab995e3b76cd9e38969da52e2dade Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 19:26:14 +0000 Subject: [PATCH 02/59] Generate ExtensionBundle --- app/AppKernel.php | 1 + app/config/routing.yml | 5 ++++ .../Controller/ExtensionController.php | 11 ++++++++ .../ExtensionExtension.php | 25 +++++++++++++++++++ .../ExtensionBundle/ExtensionBundle.php | 9 +++++++ .../Resources/config/services.xml | 16 ++++++++++++ 6 files changed, 67 insertions(+) create mode 100644 src/Application/ExtensionBundle/Controller/ExtensionController.php create mode 100644 src/Application/ExtensionBundle/DependencyInjection/ExtensionExtension.php create mode 100644 src/Application/ExtensionBundle/ExtensionBundle.php create mode 100644 src/Application/ExtensionBundle/Resources/config/services.xml diff --git a/app/AppKernel.php b/app/AppKernel.php index 93c66e6..4ff1eac 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,6 +17,7 @@ public function registerBundles() new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Behat\Borg\Application\ReleaseBundle\ReleaseBundle(), new Behat\Borg\Application\DocumentationBundle\DocumentationBundle(), + new Behat\Borg\Application\ExtensionBundle\ExtensionBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { diff --git a/app/config/routing.yml b/app/config/routing.yml index e0b8cad..b4b4261 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -5,6 +5,11 @@ homepage: template: '::homepage.html.twig' section: 'homepage' +extension: + resource: "@ExtensionBundle/Controller/" + type: annotation + prefix: /extensions + documentation: resource: '@DocumentationBundle/Controller/' type: annotation diff --git a/src/Application/ExtensionBundle/Controller/ExtensionController.php b/src/Application/ExtensionBundle/Controller/ExtensionController.php new file mode 100644 index 0000000..3bcf07b --- /dev/null +++ b/src/Application/ExtensionBundle/Controller/ExtensionController.php @@ -0,0 +1,11 @@ +load('services.xml'); + } +} diff --git a/src/Application/ExtensionBundle/ExtensionBundle.php b/src/Application/ExtensionBundle/ExtensionBundle.php new file mode 100644 index 0000000..b5fb181 --- /dev/null +++ b/src/Application/ExtensionBundle/ExtensionBundle.php @@ -0,0 +1,9 @@ + + + + + + From d931b8378adb3bab6482cd14fcfaeaa2a22e88da Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 19:28:40 +0000 Subject: [PATCH 03/59] Implement extension listing controller --- .../Controller/ExtensionController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Application/ExtensionBundle/Controller/ExtensionController.php b/src/Application/ExtensionBundle/Controller/ExtensionController.php index 3bcf07b..4cb55c4 100644 --- a/src/Application/ExtensionBundle/Controller/ExtensionController.php +++ b/src/Application/ExtensionBundle/Controller/ExtensionController.php @@ -2,10 +2,27 @@ namespace Behat\Borg\Application\ExtensionBundle\Controller; +use Behat\Borg\ExtensionCatalogue; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; class ExtensionController extends Controller { + /** + * @Route("/") + * @Template() + */ + public function listAction() + { + return ['extensions' => $this->catalogue()->all()]; + } + + /** + * @return ExtensionCatalogue + */ + private function catalogue() + { + return $this->get('extension.catalogue'); + } } From baebdc6a288a24005212e714cc35d68320b7cd6d Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 19:33:59 +0000 Subject: [PATCH 04/59] Define extension.catalogue service --- app/config/config_test.yml | 1 + .../Resources/config/services.xml | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/config/config_test.yml b/app/config/config_test.yml index ae2b5d5..e89b326 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -22,3 +22,4 @@ parameters: package.release_downloader.path: %kernel.cache_dir%/build/repositories documentation.build.path: %kernel.cache_dir%/build/docs documentation.publisher.path: %kernel.cache_dir%/docs + extension.repo.path: %kernel.cache_dir%%/extensions diff --git a/src/Application/ExtensionBundle/Resources/config/services.xml b/src/Application/ExtensionBundle/Resources/config/services.xml index df06712..5878320 100644 --- a/src/Application/ExtensionBundle/Resources/config/services.xml +++ b/src/Application/ExtensionBundle/Resources/config/services.xml @@ -4,13 +4,22 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - + From dc60db06252a71b41d8f3eea6d2e82f5d5ee1046 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 20:11:23 +0000 Subject: [PATCH 05/59] Add extensions template --- .../Resources/views/Extension/list.html.twig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig diff --git a/src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig b/src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig new file mode 100644 index 0000000..7c947bb --- /dev/null +++ b/src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig @@ -0,0 +1,14 @@ +{% extends '::layout.html.twig' %} + +{% block stylesheets %} +{% endblock %} + +{% block page %} +
+ {% for extension in extensions %} +
+ {{ extension }} +
+ {% endfor %} +
+{% endblock %} From 4187c86013ce2093e25a0c93859b77c698260044 Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 16 Mar 2015 23:29:31 +0000 Subject: [PATCH 06/59] Fix Extension bundle to be inline with master changes --- app/AppKernel.php | 2 +- .../Controller/ExtensionController.php | 2 +- .../DependencyInjection/ExtensionExtension.php | 2 +- .../{ExtensionBundle => Extension}/ExtensionBundle.php | 2 +- .../Resources/config/services.xml | 2 +- .../Resources/views/Extension/list.html.twig | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename src/Application/{ExtensionBundle => Extension}/Controller/ExtensionController.php (90%) rename src/Application/{ExtensionBundle => Extension}/DependencyInjection/ExtensionExtension.php (91%) rename src/Application/{ExtensionBundle => Extension}/ExtensionBundle.php (66%) rename src/Application/{ExtensionBundle => Extension}/Resources/config/services.xml (88%) rename src/Application/{ExtensionBundle => Extension}/Resources/views/Extension/list.html.twig (100%) diff --git a/app/AppKernel.php b/app/AppKernel.php index 05ee39e..558acb2 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,7 +17,7 @@ public function registerBundles() new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Behat\Borg\Application\Release\ReleaseBundle(), new Behat\Borg\Application\Documentation\DocumentationBundle(), - new Behat\Borg\Application\ExtensionBundle\ExtensionBundle(), + new Behat\Borg\Application\Extension\ExtensionBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { diff --git a/src/Application/ExtensionBundle/Controller/ExtensionController.php b/src/Application/Extension/Controller/ExtensionController.php similarity index 90% rename from src/Application/ExtensionBundle/Controller/ExtensionController.php rename to src/Application/Extension/Controller/ExtensionController.php index 4cb55c4..f9f56d3 100644 --- a/src/Application/ExtensionBundle/Controller/ExtensionController.php +++ b/src/Application/Extension/Controller/ExtensionController.php @@ -1,6 +1,6 @@ %extension.repo.path%/catalogue.meta diff --git a/src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig b/src/Application/Extension/Resources/views/Extension/list.html.twig similarity index 100% rename from src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig rename to src/Application/Extension/Resources/views/Extension/list.html.twig From 2553e851294ac0b8910cc246ba6253b0a680dd07 Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 16 Mar 2015 23:48:00 +0000 Subject: [PATCH 07/59] Add ExtensionCataloguer to the list of package listeners --- .../Composer/ComposerExtractorSpec.php | 15 ++++++++++++++ .../Extension/Resources/config/services.xml | 9 +++++++++ .../Release/Resources/config/services.xml | 3 +++ .../Extension/Composer/ComposerExtractor.php | 20 +++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 spec/Integration/Extension/Composer/ComposerExtractorSpec.php create mode 100644 src/Integration/Extension/Composer/ComposerExtractor.php diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php new file mode 100644 index 0000000..ed6a25a --- /dev/null +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -0,0 +1,15 @@ +shouldHaveType(Extractor::class); + } +} diff --git a/src/Application/Extension/Resources/config/services.xml b/src/Application/Extension/Resources/config/services.xml index aea8c90..295d2a2 100644 --- a/src/Application/Extension/Resources/config/services.xml +++ b/src/Application/Extension/Resources/config/services.xml @@ -20,6 +20,15 @@ %extension.repo.path%/catalogue.meta + + + + + + + diff --git a/src/Application/Release/Resources/config/services.xml b/src/Application/Release/Resources/config/services.xml index 7e8aefd..5b42790 100644 --- a/src/Application/Release/Resources/config/services.xml +++ b/src/Application/Release/Resources/config/services.xml @@ -16,6 +16,9 @@ + + + Date: Mon, 16 Mar 2015 23:56:43 +0000 Subject: [PATCH 08/59] Implement extraction of non-composer package --- .../Extension/Composer/ComposerExtractorSpec.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php index ed6a25a..1a94ffc 100644 --- a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -3,6 +3,7 @@ namespace spec\Behat\Borg\Integration\Extension\Composer; use Behat\Borg\Extension\Extractor\Extractor; +use Behat\Borg\Release\Package; use PhpSpec\ObjectBehavior; use Prophecy\Argument; @@ -12,4 +13,9 @@ function it_is_extension_extractor() { $this->shouldHaveType(Extractor::class); } + + function it_extracts_nothing_if_provided_package_is_not_a_composer_package(Package $package) + { + $this->extract($package)->shouldReturn(null); + } } From fc2d55cac248b1e62f9674fc03e1f9225cf4523d Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 16 Mar 2015 23:57:45 +0000 Subject: [PATCH 09/59] Implement extraction of non-extension composer package --- .../Composer/ComposerExtractorSpec.php | 11 ++++++++++ .../Release/Composer/ComposerPackageSpec.php | 8 ++++---- .../Release/Composer/ComposerPackage.php | 20 ++++++++++--------- .../Composer/ComposerPackageFinder.php | 2 +- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php index 1a94ffc..f88affb 100644 --- a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -3,6 +3,7 @@ namespace spec\Behat\Borg\Integration\Extension\Composer; use Behat\Borg\Extension\Extractor\Extractor; +use Behat\Borg\Integration\Release\Composer\ComposerPackage; use Behat\Borg\Release\Package; use PhpSpec\ObjectBehavior; use Prophecy\Argument; @@ -18,4 +19,14 @@ function it_extracts_nothing_if_provided_package_is_not_a_composer_package(Packa { $this->extract($package)->shouldReturn(null); } + + function it_extracts_nothing_if_provided_composer_package_is_not_of_type_behat_extension() + { + $package = new ComposerPackage([ + 'name' => 'behat/behat', + 'type' => 'library' + ]); + + $this->extract($package)->shouldReturn(null); + } } diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index 54bcf8e..68aac35 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -10,7 +10,7 @@ class ComposerPackageSpec extends ObjectBehavior { function let() { - $this->beConstructedWith('behat/docs'); + $this->beConstructedWith(['name' => 'behat/docs', 'type' => 'library']); } function it_is_a_package() @@ -20,12 +20,12 @@ function it_is_a_package() function it_can_not_be_constructed_with_a_name_that_has_less_than_2_segments_in_it() { - $this->shouldThrow()->during('__construct', ['behat']); + $this->shouldThrow()->during('__construct', [['name' => 'behat', 'type' => 'library']]); } function it_can_not_be_constructed_with_a_name_that_has_more_than_2_segments_in_it() { - $this->shouldThrow()->during('__construct', ['behat/docs/v2']); + $this->shouldThrow()->during('__construct', [['name' => 'behat/docs/v2', 'type' => 'library']]); } function its_organisation_name_is_a_first_segment_of_the_constructor_argument() @@ -35,7 +35,7 @@ function its_organisation_name_is_a_first_segment_of_the_constructor_argument() function it_lowercases_provided_organisation_and_package_name() { - $this->beConstructedWith('Behat/Docs'); + $this->beConstructedWith(['name' => 'Behat/Docs', 'type' => 'library']); $this->organisationName()->shouldReturn('behat'); $this->name()->shouldReturn('docs'); diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index 937c1b0..d44957a 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -13,22 +13,24 @@ final class ComposerPackage implements Package /** * @var string */ - private $string; + private $name; /** * Initializes package. * - * @param string $string + * @param array $data */ - public function __construct($string) + public function __construct(array $data) { - if (1 !== preg_match(self::PACKAGE_NAME_REGEX, $string)) { + $name = $data['name']; + + if (1 !== preg_match(self::PACKAGE_NAME_REGEX, $name)) { throw new BadPackageNameGiven( - "Composer package name should match `" . self::PACKAGE_NAME_REGEX . "`, but `{$string}` given." + "Composer package name should match `" . self::PACKAGE_NAME_REGEX . "`, but `{$name}` given." ); } - $this->string = strtolower($string); + $this->name = strtolower($name); } /** @@ -36,7 +38,7 @@ public function __construct($string) */ public function organisationName() { - return explode('/', $this->string)[0]; + return explode('/', $this->name)[0]; } /** @@ -44,7 +46,7 @@ public function organisationName() */ public function name() { - return explode('/', $this->string)[1]; + return explode('/', $this->name)[1]; } /** @@ -52,6 +54,6 @@ public function name() */ public function __toString() { - return $this->string; + return $this->name; } } diff --git a/src/Integration/Release/Composer/ComposerPackageFinder.php b/src/Integration/Release/Composer/ComposerPackageFinder.php index c307a27..486dbbf 100644 --- a/src/Integration/Release/Composer/ComposerPackageFinder.php +++ b/src/Integration/Release/Composer/ComposerPackageFinder.php @@ -22,6 +22,6 @@ public function find(Download $download) $path = $download->filePath('composer.json'); $meta = json_decode(file_get_contents($path), true); - return new ComposerPackage($meta['name']); + return new ComposerPackage($meta); } } From 344ad11ebc6da7179e03f28d21e06e2150731092 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 17 Mar 2015 00:17:31 +0000 Subject: [PATCH 10/59] Implement extensions list page --- app/config/config_test.yml | 2 +- .../Composer/ComposerExtensionSpec.php | 35 ++++++++++++ .../Composer/ComposerExtractorSpec.php | 13 +++++ .../Release/Composer/ComposerPackageSpec.php | 9 ++- .../Filesystem/PersistedObjectsRepository.php | 1 + .../Extension/Composer/ComposerExtension.php | 56 +++++++++++++++++++ .../Extension/Composer/ComposerExtractor.php | 11 +++- .../Filesystem/PersistedObjectsRepository.php | 1 + .../Release/Composer/ComposerPackage.php | 15 +++++ 9 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 spec/Integration/Extension/Composer/ComposerExtensionSpec.php create mode 100644 src/Integration/Extension/Composer/ComposerExtension.php diff --git a/app/config/config_test.yml b/app/config/config_test.yml index e89b326..8f6c64a 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -22,4 +22,4 @@ parameters: package.release_downloader.path: %kernel.cache_dir%/build/repositories documentation.build.path: %kernel.cache_dir%/build/docs documentation.publisher.path: %kernel.cache_dir%/docs - extension.repo.path: %kernel.cache_dir%%/extensions + extension.repo.path: %kernel.cache_dir%/extensions diff --git a/spec/Integration/Extension/Composer/ComposerExtensionSpec.php b/spec/Integration/Extension/Composer/ComposerExtensionSpec.php new file mode 100644 index 0000000..97c09ac --- /dev/null +++ b/spec/Integration/Extension/Composer/ComposerExtensionSpec.php @@ -0,0 +1,35 @@ +beConstructedWith('behat', 'symfony2-extension'); + } + + function it_is_extension() + { + $this->shouldHaveType(Extension::class); + } + + function it_has_an_organisation_name() + { + $this->organisationName()->shouldReturn('behat'); + } + + function it_has_a_name() + { + $this->name()->shouldReturn('symfony2-extension'); + } + + function it_can_be_converted_to_string() + { + $this->__toString()->shouldReturn('behat/symfony2-extension'); + } +} diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php index f88affb..b2e8c7e 100644 --- a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -2,6 +2,7 @@ namespace spec\Behat\Borg\Integration\Extension\Composer; +use Behat\Borg\Extension\Extension; use Behat\Borg\Extension\Extractor\Extractor; use Behat\Borg\Integration\Release\Composer\ComposerPackage; use Behat\Borg\Release\Package; @@ -29,4 +30,16 @@ function it_extracts_nothing_if_provided_composer_package_is_not_of_type_behat_e $this->extract($package)->shouldReturn(null); } + + function it_extracts_extension_if_provided_composer_package_is_of_type_behat_extension() + { + $package = new ComposerPackage([ + 'name' => 'behat/symfony2-extension', + 'type' => 'behat-extension' + ]); + + $extension = $this->extract($package); + $extension->shouldHaveType(Extension::class); + $extension->name()->shouldReturn('symfony2-extension'); + } } diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index 68aac35..1c93862 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -28,7 +28,7 @@ function it_can_not_be_constructed_with_a_name_that_has_more_than_2_segments_in_ $this->shouldThrow()->during('__construct', [['name' => 'behat/docs/v2', 'type' => 'library']]); } - function its_organisation_name_is_a_first_segment_of_the_constructor_argument() + function its_organisation_name_is_a_first_segment_of_the_composer_package_name() { $this->organisationName()->shouldReturn('behat'); } @@ -41,11 +41,16 @@ function it_lowercases_provided_organisation_and_package_name() $this->name()->shouldReturn('docs'); } - function its_name_is_a_second_segment_of_the_constructor_argument() + function its_name_is_a_second_segment_of_the_composer_package_name() { $this->name()->shouldReturn('docs'); } + function it_has_type() + { + $this->type()->shouldReturn('library'); + } + function its_string_representation_is_the_name_of_the_package() { $this->__toString()->shouldReturn('behat/docs'); diff --git a/src/Integration/Documentation/Filesystem/PersistedObjectsRepository.php b/src/Integration/Documentation/Filesystem/PersistedObjectsRepository.php index 1077a26..1bad247 100644 --- a/src/Integration/Documentation/Filesystem/PersistedObjectsRepository.php +++ b/src/Integration/Documentation/Filesystem/PersistedObjectsRepository.php @@ -14,6 +14,7 @@ final class PersistedObjectsRepository implements Repository, ObjectIdentifier { public function __construct($path) { + $path && @mkdir(dirname($path), 0777, true); $this->repo = $path ? new FileRepository($path, $this) : new InMemoryRepository($this); } diff --git a/src/Integration/Extension/Composer/ComposerExtension.php b/src/Integration/Extension/Composer/ComposerExtension.php new file mode 100644 index 0000000..13dc60f --- /dev/null +++ b/src/Integration/Extension/Composer/ComposerExtension.php @@ -0,0 +1,56 @@ +organisationName = $organisationName; + $this->name = $name; + } + + /** + * {@inheritdoc} + */ + public function organisationName() + { + return $this->organisationName; + } + + /** + * {@inheritdoc} + */ + public function name() + { + return $this->name; + } + + /** + * {@inheritdoc} + */ + public function __toString() + { + return sprintf('%s/%s', $this->organisationName, $this->name); + } +} diff --git a/src/Integration/Extension/Composer/ComposerExtractor.php b/src/Integration/Extension/Composer/ComposerExtractor.php index 78957a3..1d7b551 100644 --- a/src/Integration/Extension/Composer/ComposerExtractor.php +++ b/src/Integration/Extension/Composer/ComposerExtractor.php @@ -3,6 +3,7 @@ namespace Behat\Borg\Integration\Extension\Composer; use Behat\Borg\Extension\Extractor\Extractor; +use Behat\Borg\Integration\Release\Composer\ComposerPackage; use Behat\Borg\Release\Package; /** @@ -15,6 +16,14 @@ final class ComposerExtractor implements Extractor */ public function extract(Package $package) { - // TODO: Implement extract() method. + if (!$package instanceof ComposerPackage) { + return null; + } + + if ('behat-extension' != $package->type()) { + return null; + } + + return new ComposerExtension($package->organisationName(), $package->name()); } } diff --git a/src/Integration/Extension/Filesystem/PersistedObjectsRepository.php b/src/Integration/Extension/Filesystem/PersistedObjectsRepository.php index e2c2ba3..0ca10fe 100644 --- a/src/Integration/Extension/Filesystem/PersistedObjectsRepository.php +++ b/src/Integration/Extension/Filesystem/PersistedObjectsRepository.php @@ -15,6 +15,7 @@ final class PersistedObjectsRepository implements Repository, ObjectIdentifier public function __construct($path) { + $path && @mkdir(dirname($path), 0777, true); $this->repo = $path ? new FileRepository($path, $this) : new InMemoryRepository($this); } diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index d44957a..18bdf64 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -14,6 +14,10 @@ final class ComposerPackage implements Package * @var string */ private $name; + /** + * @var string + */ + private $type; /** * Initializes package. @@ -31,6 +35,7 @@ public function __construct(array $data) } $this->name = strtolower($name); + $this->type = $data['type']; } /** @@ -49,6 +54,16 @@ public function name() return explode('/', $this->name)[1]; } + /** + * Returns composer package type. + * + * @return string + */ + public function type() + { + return $this->type; + } + /** * {@inheritdoc] */ From 4c2d35ad9968bec3d907c7328c8f868b16262ebc Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 17 Mar 2015 00:33:12 +0000 Subject: [PATCH 11/59] Fix documentation integration tests --- tests/Documentation/SphinxDoc/SphinxBuilderTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Documentation/SphinxDoc/SphinxBuilderTest.php b/tests/Documentation/SphinxDoc/SphinxBuilderTest.php index bd181bd..3e7a1f2 100644 --- a/tests/Documentation/SphinxDoc/SphinxBuilderTest.php +++ b/tests/Documentation/SphinxDoc/SphinxBuilderTest.php @@ -24,7 +24,7 @@ protected function setUp() { $this->tempInputPath = getenv('TEST_TEMP_PATH') . '/sphinx/input'; $this->tempOutputPath = getenv('TEST_TEMP_PATH') . '/sphinx/output'; - $this->builder = new SphinxBuilder($this->tempOutputPath, realpath(__DIR__ . '/../../../src/Application/DocumentationBundle/Resources/sphinx'), new Filesystem()); + $this->builder = new SphinxBuilder($this->tempOutputPath, realpath(__DIR__ . '/../../../src/Application/Documentation/Resources/sphinx'), new Filesystem()); (new Filesystem())->remove([$this->tempInputPath, $this->tempOutputPath]); } From 621dc9fd352e99518bb002ecac10d1a19a5b9d85 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 17 Mar 2015 19:30:40 +0000 Subject: [PATCH 12/59] Fix the ExtensionCataloguer namespace --- src/Application/Extension/Resources/config/services.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Application/Extension/Resources/config/services.xml b/src/Application/Extension/Resources/config/services.xml index 295d2a2..e631007 100644 --- a/src/Application/Extension/Resources/config/services.xml +++ b/src/Application/Extension/Resources/config/services.xml @@ -21,7 +21,7 @@ From c603349560f78be5e21d83b9960ef41b6cd3968d Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 17 Mar 2015 23:07:47 +0000 Subject: [PATCH 13/59] Move Extension bundle under Integration --- app/AppKernel.php | 2 +- .../Symfony}/Extension/Controller/ExtensionController.php | 2 +- .../Extension/DependencyInjection/ExtensionExtension.php | 2 +- .../Symfony}/Extension/ExtensionBundle.php | 2 +- .../Symfony}/Extension/Resources/config/services.xml | 0 .../Symfony}/Extension/Resources/views/Extension/list.html.twig | 0 6 files changed, 4 insertions(+), 4 deletions(-) rename src/{Application => Integration/Symfony}/Extension/Controller/ExtensionController.php (90%) rename src/{Application => Integration/Symfony}/Extension/DependencyInjection/ExtensionExtension.php (90%) rename src/{Application => Integration/Symfony}/Extension/ExtensionBundle.php (65%) rename src/{Application => Integration/Symfony}/Extension/Resources/config/services.xml (100%) rename src/{Application => Integration/Symfony}/Extension/Resources/views/Extension/list.html.twig (100%) diff --git a/app/AppKernel.php b/app/AppKernel.php index 345db2a..804b67d 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,7 +17,7 @@ public function registerBundles() new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Behat\Borg\Integration\Symfony\Release\ReleaseBundle(), new Behat\Borg\Integration\Symfony\Documentation\DocumentationBundle(), - new Behat\Borg\Application\Extension\ExtensionBundle(), + new Behat\Borg\Integration\Symfony\Extension\ExtensionBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { diff --git a/src/Application/Extension/Controller/ExtensionController.php b/src/Integration/Symfony/Extension/Controller/ExtensionController.php similarity index 90% rename from src/Application/Extension/Controller/ExtensionController.php rename to src/Integration/Symfony/Extension/Controller/ExtensionController.php index f9f56d3..bf5289a 100644 --- a/src/Application/Extension/Controller/ExtensionController.php +++ b/src/Integration/Symfony/Extension/Controller/ExtensionController.php @@ -1,6 +1,6 @@ Date: Sun, 22 Mar 2015 12:46:27 +0000 Subject: [PATCH 14/59] Change Extension interface into the VO --- .../bootstrap/ExtensionMaintainerContext.php | 12 ++-- ...Extension.php => FakeExtensionPackage.php} | 23 +++++--- .../Fake/Extension/FakeExtractor.php | 4 +- .../bootstrap/Fake/Release/FakeRepository.php | 11 ++-- .../bootstrap/Smoke/ExtensionUIContext.php | 22 +++----- .../bootstrap/Transformation/Extension.php | 8 +-- features/extensions_are_catalogued.feature | 10 ++-- .../ExtensionSpec.php} | 10 +--- spec/ExtensionCatalogueSpec.php | 12 +++- src/Extension/Extension.php | 48 ++++++++++++---- .../Extension/Composer/ComposerExtension.php | 56 ------------------- .../Extension/Composer/ComposerExtractor.php | 3 +- 12 files changed, 94 insertions(+), 125 deletions(-) rename features/bootstrap/Fake/Extension/{FakeExtension.php => FakeExtensionPackage.php} (51%) rename spec/{Integration/Extension/Composer/ComposerExtensionSpec.php => Extension/ExtensionSpec.php} (67%) delete mode 100644 src/Integration/Extension/Composer/ComposerExtension.php diff --git a/features/bootstrap/ExtensionMaintainerContext.php b/features/bootstrap/ExtensionMaintainerContext.php index 4f94dda..c518625 100644 --- a/features/bootstrap/ExtensionMaintainerContext.php +++ b/features/bootstrap/ExtensionMaintainerContext.php @@ -10,7 +10,7 @@ use Behat\Borg\Release\ReleasePackager; use Behat\Borg\Release\Version; use Behat\Borg\ReleaseManager; -use Fake\Extension\FakeExtension; +use Fake\Extension\FakeExtensionPackage; use Fake\Extension\FakeExtractor; use Fake\Release\FakeDownloader; use Fake\Release\FakePackageFinder; @@ -47,17 +47,17 @@ public function __construct() } /** - * @Given :extension extension was created in :repository + * @Given :extensionPackage extension package was created in :repository */ - public function extensionWasCreated(FakeRepository $repository, FakeExtension $extension) + public function extensionPackageWasCreated(FakeRepository $repository, FakeExtensionPackage $extensionPackage) { - $repository->createExtension($extension); + $repository->createPackage($extensionPackage); } /** - * @Given extension was not created in :repository + * @Given extension package was not created in :repository */ - public function extensionWasNotCreated() { } + public function extensionPackageWasNotCreated() { } /** * @Given :package version :version was documented in :repository diff --git a/features/bootstrap/Fake/Extension/FakeExtension.php b/features/bootstrap/Fake/Extension/FakeExtensionPackage.php similarity index 51% rename from features/bootstrap/Fake/Extension/FakeExtension.php rename to features/bootstrap/Fake/Extension/FakeExtensionPackage.php index bb404e5..b7ca4d5 100644 --- a/features/bootstrap/Fake/Extension/FakeExtension.php +++ b/features/bootstrap/Fake/Extension/FakeExtensionPackage.php @@ -5,35 +5,42 @@ use Behat\Borg\Extension\Extension; use Behat\Borg\Release\Package; -final class FakeExtension implements Extension, Package +final class FakeExtensionPackage implements Package { - private $name; + private $parts; public static function named($name) { - if (2 !== count(explode('/', $name))) { + $parts = explode('/', $name); + + if (2 !== count($parts)) { throw new \InvalidArgumentException('Extension should include organisation and name.'); } - $package = new FakeExtension(); - $package->name = $name; + $package = new FakeExtensionPackage(); + $package->parts = $parts; return $package; } public function organisationName() { - return explode('/', $this->name)[0]; + return $this->parts[0]; } public function name() { - return explode('/', $this->name)[1]; + return $this->parts[1]; } public function __toString() { - return $this->name; + return implode('/', $this->parts); + } + + public function extension() + { + return new Extension($this->organisationName(), $this->name()); } private function __construct() { } diff --git a/features/bootstrap/Fake/Extension/FakeExtractor.php b/features/bootstrap/Fake/Extension/FakeExtractor.php index dfe8740..4d88a39 100644 --- a/features/bootstrap/Fake/Extension/FakeExtractor.php +++ b/features/bootstrap/Fake/Extension/FakeExtractor.php @@ -9,8 +9,8 @@ final class FakeExtractor implements Extractor { public function extract(Package $package) { - if ($package instanceof FakeExtension) { - return $package; + if ($package instanceof FakeExtensionPackage) { + return $package->extension(); } return null; diff --git a/features/bootstrap/Fake/Release/FakeRepository.php b/features/bootstrap/Fake/Release/FakeRepository.php index 70bacd0..7c6ba09 100644 --- a/features/bootstrap/Fake/Release/FakeRepository.php +++ b/features/bootstrap/Fake/Release/FakeRepository.php @@ -9,13 +9,12 @@ use DateTimeImmutable; use Fake\Documentation\FakeDocumentationDownload; use Fake\Documentation\FakeSource; -use Fake\Extension\FakeExtension; final class FakeRepository implements Repository { private $name; private $downloads = []; - private $extension; + private $package; public static function named($name) { @@ -50,9 +49,9 @@ public function documentPackage(Package $package, Version $version, DateTimeImmu $this->downloads[(string)$release] = new FakeDocumentationDownload($release, $time, $package, new FakeSource()); } - public function createExtension(FakeExtension $extension) + public function createPackage(Package $package) { - $this->extension = $extension; + $this->package = $package; } public function download(Release $release) @@ -61,8 +60,8 @@ public function download(Release $release) return $this->downloads[(string)$release]; } - if ($this->extension) { - return new FakePackageDownload($release, new DateTimeImmutable(), $this->extension); + if ($this->package) { + return new FakePackageDownload($release, new DateTimeImmutable(), $this->package); } return new FakeDownload($release, new DateTimeImmutable()); diff --git a/features/bootstrap/Smoke/ExtensionUIContext.php b/features/bootstrap/Smoke/ExtensionUIContext.php index 53a84d5..3ebf0c7 100644 --- a/features/bootstrap/Smoke/ExtensionUIContext.php +++ b/features/bootstrap/Smoke/ExtensionUIContext.php @@ -3,8 +3,6 @@ namespace Smoke; use Behat\Behat\Context\Context; -use Behat\Borg\Extension\Extension; -use Behat\Borg\Release\Repository; use Behat\MinkExtension\Context\RawMinkContext; use Github\Client; use PHPUnit_Framework_Assert as PHPUnit; @@ -15,8 +13,6 @@ */ class ExtensionUIContext extends RawMinkContext implements Context { - use Transformation\Extension; - private $client; /** @@ -30,9 +26,9 @@ public function __construct(Client $client) } /** - * @Given :extension extension was created in :repository + * @Given :extension extension package was created in :repository */ - public function extensionWasCreated(Repository $repository, Extension $extension) + public function extensionWasCreated($repository, $extension) { PHPUnit::assertTrue($this->repositoryExtensionIs($repository, $extension), 'Repository does not contain expected extension.'); } @@ -48,19 +44,17 @@ public function extensionCatalogueShouldHaveCount($count = 0) $this->assertSession()->elementsCount('css', '.extension', $count); } - private function repositoryExtensionIs(Repository $repository, Extension $extension) + private function repositoryExtensionIs($repository, $extension) { $content = $this->contentInRepository($repository, 'composer.json'); - return 1 === preg_match('#"name"\s*:\s*"' . preg_quote((string)$extension) . '"#', $content); + return 1 === preg_match('#"name"\s*:\s*"' . preg_quote($extension) . '"#', $content); } - private function contentInRepository(Repository $repository, $path) + private function contentInRepository($repository, $path) { - return file_get_contents( - $this->client->repo()->contents()->show( - (string)$repository->organisationName(), (string)$repository->name(), $path - )['download_url'] - ); + $repositoryParts = explode('/', $repository); + + return file_get_contents($this->client->repo()->contents()->show($repositoryParts[0], $repositoryParts[1], $path)['download_url']); } } diff --git a/features/bootstrap/Transformation/Extension.php b/features/bootstrap/Transformation/Extension.php index 62dce9e..992dae6 100644 --- a/features/bootstrap/Transformation/Extension.php +++ b/features/bootstrap/Transformation/Extension.php @@ -2,16 +2,16 @@ namespace Transformation; -use Fake\Extension\FakeExtension; +use Fake\Extension\FakeExtensionPackage; trait Extension { /** - * @Transform :extension + * @Transform :extensionPackage */ - public function transformStringToExtension($string) + public function transformStringToExtensionPackage($string) { - return FakeExtension::named($string); + return FakeExtensionPackage::named($string); } /** diff --git a/features/extensions_are_catalogued.feature b/features/extensions_are_catalogued.feature index 3cbb0fe..d0e6a34 100644 --- a/features/extensions_are_catalogued.feature +++ b/features/extensions_are_catalogued.feature @@ -9,27 +9,27 @@ Feature: Extensions are catalogued - If repository has documentation, but no extensions, releasing it still doesn't change the catalogue Scenario: Releasing a stable extension - Given "behat/symfony2-extension" extension was created in "Behat/Symfony2Extension" + Given "behat/symfony2-extension" extension package was created in "Behat/Symfony2Extension" When I release "Behat/Symfony2Extension" version "v2.0.0" Then the extension catalogue should contain 1 extension And "behat/symfony2-extension" extension should be in the catalogue @critical Scenario: Releasing multiple stable extensions - Given "behat/symfony2-extension" extension was created in "Behat/Symfony2Extension" - And "behat/mink-extension" extension was created in "Behat/MinkExtension" + Given "behat/symfony2-extension" extension package was created in "Behat/Symfony2Extension" + And "behat/mink-extension" extension package was created in "Behat/MinkExtension" When I release "Behat/Symfony2Extension" version "v2.0.0" And I release "Behat/MinkExtension" version "v2.0.1" Then the extension catalogue should contain 2 extensions Scenario: Releasing multiple versions of the same extension - Given "behat/mink-extension" extension was created in "Behat/MinkExtension" + Given "behat/mink-extension" extension package was created in "Behat/MinkExtension" When I release "Behat/MinkExtension" version "v2.0.0" And I release "Behat/MinkExtension" version "v2.0.1" Then the extension catalogue should still contain 1 extension Scenario: Releasing repository that has no extensions - Given extension was not created in "Behat/MinkExtension" + Given extension package was not created in "Behat/MinkExtension" When I release "Behat/MinkExtension" version "v2.0.0" Then the extension catalogue should be empty diff --git a/spec/Integration/Extension/Composer/ComposerExtensionSpec.php b/spec/Extension/ExtensionSpec.php similarity index 67% rename from spec/Integration/Extension/Composer/ComposerExtensionSpec.php rename to spec/Extension/ExtensionSpec.php index 97c09ac..b94e7d1 100644 --- a/spec/Integration/Extension/Composer/ComposerExtensionSpec.php +++ b/spec/Extension/ExtensionSpec.php @@ -1,23 +1,17 @@ beConstructedWith('behat', 'symfony2-extension'); } - function it_is_extension() - { - $this->shouldHaveType(Extension::class); - } - function it_has_an_organisation_name() { $this->organisationName()->shouldReturn('behat'); diff --git a/spec/ExtensionCatalogueSpec.php b/spec/ExtensionCatalogueSpec.php index 3932bd4..d197ea3 100644 --- a/spec/ExtensionCatalogueSpec.php +++ b/spec/ExtensionCatalogueSpec.php @@ -14,22 +14,28 @@ function let(Repository $repository) $this->beConstructedWith($repository); } - function it_saves_extensions_to_repository_during_registration(Repository $repository, Extension $extension) + function it_saves_extensions_to_repository_during_registration(Repository $repository) { + $extension = new Extension('behat', 'symfony2-extension'); + $repository->add($extension)->shouldBeCalled(); $this->register($extension); } - function it_finds_registered_extensions_using_repository(Repository $repository, Extension $extension) + function it_finds_registered_extensions_using_repository(Repository $repository) { + $extension = new Extension('some', 'extension'); + $repository->extension('some/extension')->willReturn($extension); $this->extension('some/extension')->shouldReturn($extension); } - function it_finds_all_registered_extensions_using_repository(Repository $repository, Extension $extension) + function it_finds_all_registered_extensions_using_repository(Repository $repository) { + $extension = new Extension('some', 'extension'); + $repository->all()->willReturn([$extension]); $this->all()->shouldReturn([$extension]); diff --git a/src/Extension/Extension.php b/src/Extension/Extension.php index 7160eda..ab4ed72 100644 --- a/src/Extension/Extension.php +++ b/src/Extension/Extension.php @@ -5,26 +5,50 @@ /** * Represents Behat extension. */ -interface Extension +final class Extension { /** - * Returns extension organisation name. - * - * @return string + * @var string + */ + private $organisationName; + /** + * @var string */ - public function organisationName(); + private $name; /** - * Returns extension name. + * Initializes extension. * - * @return string + * @param string $organisationName + * @param string $name */ - public function name(); + public function __construct($organisationName, $name) + { + $this->organisationName = $organisationName; + $this->name = $name; + } /** - * Returns string representation of extension. - * - * @return string + * {@inheritdoc} + */ + public function organisationName() + { + return $this->organisationName; + } + + /** + * {@inheritdoc} + */ + public function name() + { + return $this->name; + } + + /** + * {@inheritdoc} */ - public function __toString(); + public function __toString() + { + return sprintf('%s/%s', $this->organisationName, $this->name); + } } diff --git a/src/Integration/Extension/Composer/ComposerExtension.php b/src/Integration/Extension/Composer/ComposerExtension.php deleted file mode 100644 index 13dc60f..0000000 --- a/src/Integration/Extension/Composer/ComposerExtension.php +++ /dev/null @@ -1,56 +0,0 @@ -organisationName = $organisationName; - $this->name = $name; - } - - /** - * {@inheritdoc} - */ - public function organisationName() - { - return $this->organisationName; - } - - /** - * {@inheritdoc} - */ - public function name() - { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return sprintf('%s/%s', $this->organisationName, $this->name); - } -} diff --git a/src/Integration/Extension/Composer/ComposerExtractor.php b/src/Integration/Extension/Composer/ComposerExtractor.php index 1d7b551..03861fb 100644 --- a/src/Integration/Extension/Composer/ComposerExtractor.php +++ b/src/Integration/Extension/Composer/ComposerExtractor.php @@ -2,6 +2,7 @@ namespace Behat\Borg\Integration\Extension\Composer; +use Behat\Borg\Extension\Extension; use Behat\Borg\Extension\Extractor\Extractor; use Behat\Borg\Integration\Release\Composer\ComposerPackage; use Behat\Borg\Release\Package; @@ -24,6 +25,6 @@ public function extract(Package $package) return null; } - return new ComposerExtension($package->organisationName(), $package->name()); + return new Extension($package->organisationName(), $package->name()); } } From ca3e0ff6cdaee2f0c500b91a083ca4e4f5a89a11 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 29 Mar 2015 14:16:56 +0100 Subject: [PATCH 15/59] Fetch extension description and author from Composer --- .../Fake/Extension/FakeExtensionPackage.php | 2 +- spec/Extension/ExtensionSpec.php | 12 ++++- spec/ExtensionCatalogueSpec.php | 6 +-- .../Release/Composer/ComposerPackageSpec.php | 45 ++++++++++++++++++- src/Extension/Extension.php | 44 ++++++++++++++++-- .../Extension/Composer/ComposerExtractor.php | 18 +++++++- .../Release/Composer/ComposerPackage.php | 40 +++++++++++++++++ .../Resources/views/Extension/list.html.twig | 7 ++- 8 files changed, 162 insertions(+), 12 deletions(-) diff --git a/features/bootstrap/Fake/Extension/FakeExtensionPackage.php b/features/bootstrap/Fake/Extension/FakeExtensionPackage.php index b7ca4d5..33e6ce6 100644 --- a/features/bootstrap/Fake/Extension/FakeExtensionPackage.php +++ b/features/bootstrap/Fake/Extension/FakeExtensionPackage.php @@ -40,7 +40,7 @@ public function __toString() public function extension() { - return new Extension($this->organisationName(), $this->name()); + return new Extension($this->organisationName(), $this->name(), 'some package', 'anonymous'); } private function __construct() { } diff --git a/spec/Extension/ExtensionSpec.php b/spec/Extension/ExtensionSpec.php index b94e7d1..8537d09 100644 --- a/spec/Extension/ExtensionSpec.php +++ b/spec/Extension/ExtensionSpec.php @@ -9,7 +9,7 @@ class ExtensionSpec extends ObjectBehavior { function let() { - $this->beConstructedWith('behat', 'symfony2-extension'); + $this->beConstructedWith('behat', 'symfony2-extension', 'Symfony2 framework extension for Behat', 'Konstantin Kudryashov'); } function it_has_an_organisation_name() @@ -26,4 +26,14 @@ function it_can_be_converted_to_string() { $this->__toString()->shouldReturn('behat/symfony2-extension'); } + + function it_has_a_description() + { + $this->description()->shouldReturn('Symfony2 framework extension for Behat'); + } + + function it_has_author() + { + $this->author()->shouldReturn('Konstantin Kudryashov'); + } } diff --git a/spec/ExtensionCatalogueSpec.php b/spec/ExtensionCatalogueSpec.php index d197ea3..a7a309c 100644 --- a/spec/ExtensionCatalogueSpec.php +++ b/spec/ExtensionCatalogueSpec.php @@ -16,7 +16,7 @@ function let(Repository $repository) function it_saves_extensions_to_repository_during_registration(Repository $repository) { - $extension = new Extension('behat', 'symfony2-extension'); + $extension = new Extension('behat', 'symfony2-extension', 'sf2 extension for behat', 'everzet'); $repository->add($extension)->shouldBeCalled(); @@ -25,7 +25,7 @@ function it_saves_extensions_to_repository_during_registration(Repository $repos function it_finds_registered_extensions_using_repository(Repository $repository) { - $extension = new Extension('some', 'extension'); + $extension = new Extension('some', 'extension', 'sf2 extension for behat', 'everzet'); $repository->extension('some/extension')->willReturn($extension); @@ -34,7 +34,7 @@ function it_finds_registered_extensions_using_repository(Repository $repository) function it_finds_all_registered_extensions_using_repository(Repository $repository) { - $extension = new Extension('some', 'extension'); + $extension = new Extension('some', 'extension', 'sf2 extension for behat', 'everzet'); $repository->all()->willReturn([$extension]); diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index 1c93862..e860d7d 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -10,7 +10,17 @@ class ComposerPackageSpec extends ObjectBehavior { function let() { - $this->beConstructedWith(['name' => 'behat/docs', 'type' => 'library']); + $this->beConstructedWith( + [ + 'name' => 'behat/docs', + 'type' => 'library', + 'description' => 'behat documentation', + 'authors' => [ + ['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com'], + ['name' => 'Christophe Coevoet', 'email' => 'stof@notk.org'] + ] + ] + ); } function it_is_a_package() @@ -51,6 +61,39 @@ function it_has_type() $this->type()->shouldReturn('library'); } + function it_has_a_description() + { + $this->description()->shouldReturn('behat documentation'); + } + + function it_has_authors() + { + $this->authors()->shouldReturn( + [ + ['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com'], + ['name' => 'Christophe Coevoet', 'email' => 'stof@notk.org'] + ] + ); + } + + function its_primary_author_is_the_first_one() + { + $this->primaryAuthor()->shouldReturn(['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com']); + } + + function its_primary_author_is_null_if_none_authors_found() + { + $this->beConstructedWith( + [ + 'name' => 'behat/docs', + 'type' => 'library', + 'description' => 'behat documentation' + ] + ); + + $this->primaryAuthor()->shouldReturn(null); + } + function its_string_representation_is_the_name_of_the_package() { $this->__toString()->shouldReturn('behat/docs'); diff --git a/src/Extension/Extension.php b/src/Extension/Extension.php index ab4ed72..0e6d393 100644 --- a/src/Extension/Extension.php +++ b/src/Extension/Extension.php @@ -15,21 +15,35 @@ final class Extension * @var string */ private $name; + /** + * @var string + */ + private $description; + /** + * @var string[] + */ + private $author; /** * Initializes extension. * * @param string $organisationName * @param string $name + * @param string $description + * @param string $author */ - public function __construct($organisationName, $name) + public function __construct($organisationName, $name, $description, $author) { $this->organisationName = $organisationName; $this->name = $name; + $this->description = $description; + $this->author = $author; } /** - * {@inheritdoc} + * Returns organisation this extension belongs to. + * + * @return string */ public function organisationName() { @@ -37,7 +51,9 @@ public function organisationName() } /** - * {@inheritdoc} + * Returns name of the extension. + * + * @return string */ public function name() { @@ -45,7 +61,27 @@ public function name() } /** - * {@inheritdoc} + * Returns extension description. + * + * @return string + */ + public function description() + { + return $this->description; + } + + /** + * Returns extension author name. + * + * @return string + */ + public function author() + { + return $this->author; + } + + /** + * Converts extension to string. */ public function __toString() { diff --git a/src/Integration/Extension/Composer/ComposerExtractor.php b/src/Integration/Extension/Composer/ComposerExtractor.php index 03861fb..87e1b53 100644 --- a/src/Integration/Extension/Composer/ComposerExtractor.php +++ b/src/Integration/Extension/Composer/ComposerExtractor.php @@ -25,6 +25,22 @@ public function extract(Package $package) return null; } - return new Extension($package->organisationName(), $package->name()); + return new Extension($package->organisationName(), $package->name(), $package->description(), $this->primaryAuthorName($package)); + } + + /** + * Gets primary author name from the composer package. + * + * @param ComposerPackage $package + * + * @return string + */ + private function primaryAuthorName(ComposerPackage $package) + { + if (!$package->primaryAuthor()) { + return 'Anonymous'; + } + + return $package->primaryAuthor()['name']; } } diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index 18bdf64..b4fef6f 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -18,6 +18,14 @@ final class ComposerPackage implements Package * @var string */ private $type; + /** + * @var string + */ + private $description; + /** + * @var array + */ + private $authors; /** * Initializes package. @@ -36,6 +44,8 @@ public function __construct(array $data) $this->name = strtolower($name); $this->type = $data['type']; + $this->description = isset($data['description']) ? $data['description'] : null; + $this->authors = isset($data['authors']) ? $data['authors'] : []; } /** @@ -64,6 +74,36 @@ public function type() return $this->type; } + /** + * Returns package description. + * + * @return string + */ + public function description() + { + return $this->description; + } + + /** + * Hash of the primary package author or null if no authors defined. + * + * @return array|null + */ + public function primaryAuthor() + { + return count($this->authors) ? $this->authors[0] : null; + } + + /** + * Returns package authors. + * + * @return array + */ + public function authors() + { + return $this->authors; + } + /** * {@inheritdoc] */ diff --git a/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig b/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig index 7c947bb..ed63a3d 100644 --- a/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig +++ b/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig @@ -5,9 +5,14 @@ {% block page %}
+

Extensions

{% for extension in extensions %}
- {{ extension }} +

{{ extension }}

+ by {{ extension.author }} +

+ {{ extension.description }} +

{% endfor %}
From d0ac06816e3a3292ed17101e8fb532931f238489 Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 30 Mar 2015 19:48:45 +0100 Subject: [PATCH 16/59] Keep extensions folder --- .gitignore | 2 ++ extensions/.gitkeep | 0 2 files changed, 2 insertions(+) create mode 100644 extensions/.gitkeep diff --git a/.gitignore b/.gitignore index e9665b5..7823183 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ vendor/ web/bundles/ +extensions/* docs/* app/cache/* app/logs/* @@ -7,6 +8,7 @@ build/repositories/* build/docs/* !app/cache/.gitkeep !app/logs/.gitkeep +!extensions/.gitkeep !build/repositories/.gitkeep !build/docs/.gitkeep !docs/.gitkeep diff --git a/extensions/.gitkeep b/extensions/.gitkeep new file mode 100644 index 0000000..e69de29 From cfcad25f58207bdc864fbf2d7dac44712221a6c2 Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 30 Mar 2015 20:56:50 +0100 Subject: [PATCH 17/59] Fix broken service definition --- src/Integration/Symfony/Extension/Resources/config/services.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Integration/Symfony/Extension/Resources/config/services.xml b/src/Integration/Symfony/Extension/Resources/config/services.xml index e631007..10ab748 100644 --- a/src/Integration/Symfony/Extension/Resources/config/services.xml +++ b/src/Integration/Symfony/Extension/Resources/config/services.xml @@ -26,7 +26,7 @@ - +
From ec779ebd28d0809db4324b47991abfa77cf63cf5 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 21 Apr 2015 13:41:38 +0100 Subject: [PATCH 18/59] Move page path composition responsibility to Page --- .../Publisher/PublishedDocumentationSpec.php | 7 +---- src/Documentation/Page/Page.php | 2 +- .../Publisher/PublishedDocumentation.php | 26 +++++++------------ 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/spec/Documentation/Publisher/PublishedDocumentationSpec.php b/spec/Documentation/Publisher/PublishedDocumentationSpec.php index 26f9197..7502e93 100644 --- a/spec/Documentation/Publisher/PublishedDocumentationSpec.php +++ b/spec/Documentation/Publisher/PublishedDocumentationSpec.php @@ -58,11 +58,6 @@ function it_throws_an_exception_when_trying_to_get_inexistent_page() function it_can_provide_absolute_path_for_the_page_by_its_id() { - $this->path(new PageId(basename(__FILE__)))->shouldReturn(__FILE__); - } - - function it_throws_an_exception_when_trying_to_get_path_for_inexistent_page() - { - $this->shouldThrow()->duringPath(new PageId('any file')); + $this->path()->shouldReturn(__DIR__); } } diff --git a/src/Documentation/Page/Page.php b/src/Documentation/Page/Page.php index e689af5..aea8681 100644 --- a/src/Documentation/Page/Page.php +++ b/src/Documentation/Page/Page.php @@ -35,7 +35,7 @@ final class Page */ public function __construct(PublishedDocumentation $documentation, PageId $pageId) { - $this->path = $documentation->path($pageId); + $this->path = $documentation->path() . '/' . $pageId; $this->projectName = $documentation->documentationId()->projectName(); $this->versionString = $documentation->documentationId()->versionString(); $this->time = $documentation->documentedAt(); diff --git a/src/Documentation/Publisher/PublishedDocumentation.php b/src/Documentation/Publisher/PublishedDocumentation.php index 4e462e0..f45e4c3 100644 --- a/src/Documentation/Publisher/PublishedDocumentation.php +++ b/src/Documentation/Publisher/PublishedDocumentation.php @@ -68,6 +68,16 @@ public function documentedAt() return $this->documentationTime; } + /** + * Returns the path documentation is stored at. + * + * @return string + */ + public function path() + { + return $this->path; + } + /** * Checks if file at provided relative path exists. * @@ -96,21 +106,5 @@ public function page(PageId $anId) return new Page($this, $anId); } - /** - * Generates absolute file path for provided page ID. - * - * @param PageId $anId - * - * @return string - */ - public function path(PageId $anId) - { - if (!$this->has($anId)) { - throw new PageNotFound("Documentation page `{$anId->path()}` was not found."); - } - - return $this->path . '/' . $anId; - } - private function __construct() { } } From 9aff96ff1043ef607b9a971131abba5c636d38be Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 21 Apr 2015 13:43:37 +0100 Subject: [PATCH 19/59] Make PublishedDocumentation::has() private --- .../Publisher/PublishedDocumentationSpec.php | 6 ----- .../Publisher/PublishedDocumentation.php | 24 +++++++++---------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/spec/Documentation/Publisher/PublishedDocumentationSpec.php b/spec/Documentation/Publisher/PublishedDocumentationSpec.php index 7502e93..ddd71a8 100644 --- a/spec/Documentation/Publisher/PublishedDocumentationSpec.php +++ b/spec/Documentation/Publisher/PublishedDocumentationSpec.php @@ -38,12 +38,6 @@ function it_has_the_same_documentation_time_as_the_built_documentation(\DateTime $this->documentedAt()->shouldReturn($docTime); } - function it_can_tell_if_it_contains_a_page() - { - $this->has(new PageId(basename(__FILE__)))->shouldReturn(true); - $this->has(new PageId('any file'))->shouldReturn(false); - } - function it_can_get_a_page_by_its_id() { $pageId = new PageId(basename(__FILE__)); diff --git a/src/Documentation/Publisher/PublishedDocumentation.php b/src/Documentation/Publisher/PublishedDocumentation.php index f45e4c3..690371b 100644 --- a/src/Documentation/Publisher/PublishedDocumentation.php +++ b/src/Documentation/Publisher/PublishedDocumentation.php @@ -79,31 +79,31 @@ public function path() } /** - * Checks if file at provided relative path exists. + * Returns page by its ID. * * @param PageId $anId * - * @return Boolean + * @return Page */ - public function has(PageId $anId) + public function page(PageId $anId) { - return file_exists($this->path . '/' . $anId); + if (!$this->hasPage($anId)) { + throw new PageNotFound("Documentation page `{$anId->path()}` was not found."); + } + + return new Page($this, $anId); } /** - * Returns page by its ID. + * Checks if file at provided relative path exists. * * @param PageId $anId * - * @return Page + * @return Boolean */ - public function page(PageId $anId) + private function hasPage(PageId $anId) { - if (!$this->has($anId)) { - throw new PageNotFound("Documentation page `{$anId->path()}` was not found."); - } - - return new Page($this, $anId); + return file_exists($this->path . '/' . $anId); } private function __construct() { } From 06ace8b125ba89bd794696d79ce8279aedf6e191 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 21 Apr 2015 13:55:07 +0100 Subject: [PATCH 20/59] Cleanup internal API of Page --- src/Documentation/Page/Page.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Documentation/Page/Page.php b/src/Documentation/Page/Page.php index aea8681..5afa477 100644 --- a/src/Documentation/Page/Page.php +++ b/src/Documentation/Page/Page.php @@ -2,6 +2,7 @@ namespace Behat\Borg\Documentation\Page; +use Behat\Borg\Documentation\DocumentationId; use Behat\Borg\Documentation\Publisher\PublishedDocumentation; use DateTimeImmutable; @@ -11,21 +12,21 @@ final class Page { /** - * @var string - */ - private $path; - /** - * @var string + * @var DocumentationId */ - private $projectName; + private $documentationId; /** - * @var string + * @var PageId */ - private $versionString; + private $pageId; /** * @var DateTimeImmutable */ private $time; + /** + * @var string + */ + private $path; /** * Initializes page. @@ -35,30 +36,30 @@ final class Page */ public function __construct(PublishedDocumentation $documentation, PageId $pageId) { - $this->path = $documentation->path() . '/' . $pageId; - $this->projectName = $documentation->documentationId()->projectName(); - $this->versionString = $documentation->documentationId()->versionString(); + $this->documentationId = $documentation->documentationId(); + $this->pageId = $pageId; $this->time = $documentation->documentedAt(); + $this->path = $documentation->path() . '/' . $pageId->path(); } /** - * Returns a documented project name. + * Returns documentation project name. * * @return string */ public function projectName() { - return $this->projectName; + return $this->documentationId->projectName(); } /** - * Returns a documented project version string. + * Returns documentation version string. * * @return string */ public function versionString() { - return $this->versionString; + return $this->documentationId->versionString(); } /** From badb985e87211e6f0ffcd49da17912d3eca4a92b Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 21 Apr 2015 13:55:21 +0100 Subject: [PATCH 21/59] Fix the wording of documentation_meta feature --- features/bootstrap/DocumentationContributorContext.php | 2 +- features/documentation_meta_is_generated.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/bootstrap/DocumentationContributorContext.php b/features/bootstrap/DocumentationContributorContext.php index 0400c6d..9511ccb 100644 --- a/features/bootstrap/DocumentationContributorContext.php +++ b/features/bootstrap/DocumentationContributorContext.php @@ -101,7 +101,7 @@ public function versionDocumentationShouldNotBePublished($project, $versionStrin } /** - * @Then package name of :pageString page for :project version :versionString should be :name + * @Then project name of :pageString page for :project version :versionString should be :name */ public function packageNameOfPageShouldBe($pageString, $project, $versionString, $name) { diff --git a/features/documentation_meta_is_generated.feature b/features/documentation_meta_is_generated.feature index ecd6944..79edd4d 100644 --- a/features/documentation_meta_is_generated.feature +++ b/features/documentation_meta_is_generated.feature @@ -11,7 +11,7 @@ Feature: Documentation meta is generated Scenario: Getting documentation package name and edit time Given "behat/symfony2-extension" version "v2.0.0" was documented in "Behat/Symfony2Extension" on "04.09.2014, 22:10:45" When I release "Behat/Symfony2Extension" version "v2.0.0" - Then package name of "index.html" page for "behat/symfony2-extension" version "v2.0" should be "behat/symfony2-extension" + Then project name of "index.html" page for "behat/symfony2-extension" version "v2.0" should be "behat/symfony2-extension" And documentation time of "index.html" page for "behat/symfony2-extension" version "v2.0" should be "04.09.2014, 22:10:45" Scenario: Getting alternative documentation versions From 381b191cd18e4f95b16fbceb7b70bc36226bbdd6 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 21 Apr 2015 13:56:18 +0100 Subject: [PATCH 22/59] Remove unused property --- src/Documentation/Page/Page.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Documentation/Page/Page.php b/src/Documentation/Page/Page.php index 5afa477..91e0639 100644 --- a/src/Documentation/Page/Page.php +++ b/src/Documentation/Page/Page.php @@ -15,10 +15,6 @@ final class Page * @var DocumentationId */ private $documentationId; - /** - * @var PageId - */ - private $pageId; /** * @var DateTimeImmutable */ @@ -37,7 +33,6 @@ final class Page public function __construct(PublishedDocumentation $documentation, PageId $pageId) { $this->documentationId = $documentation->documentationId(); - $this->pageId = $pageId; $this->time = $documentation->documentedAt(); $this->path = $documentation->path() . '/' . $pageId->path(); } From c456ea14dcb4cc980418aa87c971c2fc39dfc59b Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 21 Apr 2015 13:58:45 +0100 Subject: [PATCH 23/59] Rename BuiltDocumentation::buildPath() to path() --- .../bootstrap/Fake/Documentation/FakeBuiltDocumentation.php | 2 +- .../Integration/Documentation/SphinxDoc/BuiltSphinxSpec.php | 4 ++-- src/Documentation/Builder/BuiltDocumentation.php | 2 +- .../Documentation/Filesystem/DirectoryPublisher.php | 2 +- src/Integration/Documentation/SphinxDoc/BuiltSphinx.php | 6 +++--- tests/Documentation/SphinxDoc/SphinxBuilderTest.php | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/features/bootstrap/Fake/Documentation/FakeBuiltDocumentation.php b/features/bootstrap/Fake/Documentation/FakeBuiltDocumentation.php index 1fc74c3..81eb5cd 100644 --- a/features/bootstrap/Fake/Documentation/FakeBuiltDocumentation.php +++ b/features/bootstrap/Fake/Documentation/FakeBuiltDocumentation.php @@ -22,7 +22,7 @@ public function documentationId() return $this->documentation->documentationId(); } - public function buildPath() + public function path() { return '/tmp'; } diff --git a/spec/Integration/Documentation/SphinxDoc/BuiltSphinxSpec.php b/spec/Integration/Documentation/SphinxDoc/BuiltSphinxSpec.php index bc5b2c5..7b4e0b5 100644 --- a/spec/Integration/Documentation/SphinxDoc/BuiltSphinxSpec.php +++ b/spec/Integration/Documentation/SphinxDoc/BuiltSphinxSpec.php @@ -29,12 +29,12 @@ function it_has_a_documentation_id() function it_has_a_path_documentation_was_built_into() { - $this->buildPath()->shouldReturn(__DIR__); + $this->path()->shouldReturn(__DIR__); } function it_has_an_index_path_which_is_the_index_html_inside_the_built_path() { - $this->indexPath()->shouldReturn(__DIR__ . '/index.html'); + $this->index()->shouldReturn(__DIR__ . '/index.html'); } function it_has_time_at_which_it_was_built(DateTimeImmutable $buildTime) diff --git a/src/Documentation/Builder/BuiltDocumentation.php b/src/Documentation/Builder/BuiltDocumentation.php index dfca160..7e252d2 100644 --- a/src/Documentation/Builder/BuiltDocumentation.php +++ b/src/Documentation/Builder/BuiltDocumentation.php @@ -22,7 +22,7 @@ public function documentationId(); * * @return string */ - public function buildPath(); + public function path(); /** * Returns the time documentation was built at. diff --git a/src/Integration/Documentation/Filesystem/DirectoryPublisher.php b/src/Integration/Documentation/Filesystem/DirectoryPublisher.php index 412d7d1..3c977bc 100644 --- a/src/Integration/Documentation/Filesystem/DirectoryPublisher.php +++ b/src/Integration/Documentation/Filesystem/DirectoryPublisher.php @@ -29,7 +29,7 @@ public function __construct($publishPath) */ public function publish(BuiltDocumentation $builtDocumentation) { - $buildPath = $builtDocumentation->buildPath(); + $buildPath = $builtDocumentation->path(); $publishPath = "{$this->publishPath}/{$builtDocumentation->documentationId()}"; $publishedDocumentation = PublishedDocumentation::publish($builtDocumentation, $publishPath); diff --git a/src/Integration/Documentation/SphinxDoc/BuiltSphinx.php b/src/Integration/Documentation/SphinxDoc/BuiltSphinx.php index 7b7ad08..74d4e88 100644 --- a/src/Integration/Documentation/SphinxDoc/BuiltSphinx.php +++ b/src/Integration/Documentation/SphinxDoc/BuiltSphinx.php @@ -45,7 +45,7 @@ public function documentationId() /** * {@inheritdoc} */ - public function buildPath() + public function path() { return $this->buildPath; } @@ -53,9 +53,9 @@ public function buildPath() /** * {@inheritdoc} */ - public function indexPath() + public function index() { - return $this->buildPath() . '/index.html'; + return $this->path() . '/index.html'; } /** diff --git a/tests/Documentation/SphinxDoc/SphinxBuilderTest.php b/tests/Documentation/SphinxDoc/SphinxBuilderTest.php index 3ceec59..69e8270 100644 --- a/tests/Documentation/SphinxDoc/SphinxBuilderTest.php +++ b/tests/Documentation/SphinxDoc/SphinxBuilderTest.php @@ -53,10 +53,10 @@ function it_builds_RST_documentation_into_the_output_path() $this->assertFileExists($this->tempOutputPath . '/my/doc/v1.3/index.html'); $this->assertEquals( - $this->tempOutputPath . '/my/doc/v1.3/index.html', $built->indexPath() + $this->tempOutputPath . '/my/doc/v1.3/index.html', $built->index() ); - $output = file_get_contents($built->indexPath()); + $output = file_get_contents($built->index()); $this->assertContains('

Docs', $output); $this->assertContains('my/doc', $output); @@ -83,7 +83,7 @@ function it_builds_valid_template_when_doc_contains_Twig_like_content() $built = $this->builder->build($documentation); - $output = file_get_contents($built->indexPath()); + $output = file_get_contents($built->index()); $this->assertContains('

Trying to hack the twig-bridge theme {{', $output); $this->assertValidTwigSyntax($output); From 00afc61e12cd7df0036b5176e05bb47b20cf1f80 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 19:06:25 +0000 Subject: [PATCH 24/59] Mark multiple stable extensions scenario as critical --- features/extensions_are_catalogued.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/extensions_are_catalogued.feature b/features/extensions_are_catalogued.feature index f7321e8..3cbb0fe 100644 --- a/features/extensions_are_catalogued.feature +++ b/features/extensions_are_catalogued.feature @@ -14,6 +14,7 @@ Feature: Extensions are catalogued Then the extension catalogue should contain 1 extension And "behat/symfony2-extension" extension should be in the catalogue + @critical Scenario: Releasing multiple stable extensions Given "behat/symfony2-extension" extension was created in "Behat/Symfony2Extension" And "behat/mink-extension" extension was created in "Behat/MinkExtension" From 5674c55dd6d9d61034ea1c2bdec41e66bd3172b6 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 19:26:14 +0000 Subject: [PATCH 25/59] Generate ExtensionBundle --- app/AppKernel.php | 1 + app/config/routing.yml | 5 ++++ .../Controller/ExtensionController.php | 11 ++++++++ .../ExtensionExtension.php | 25 +++++++++++++++++++ .../ExtensionBundle/ExtensionBundle.php | 9 +++++++ .../Resources/config/services.xml | 16 ++++++++++++ 6 files changed, 67 insertions(+) create mode 100644 src/Application/ExtensionBundle/Controller/ExtensionController.php create mode 100644 src/Application/ExtensionBundle/DependencyInjection/ExtensionExtension.php create mode 100644 src/Application/ExtensionBundle/ExtensionBundle.php create mode 100644 src/Application/ExtensionBundle/Resources/config/services.xml diff --git a/app/AppKernel.php b/app/AppKernel.php index 975c58d..3a7aec2 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,6 +17,7 @@ public function registerBundles() new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Behat\Borg\Integration\Symfony\Release\ReleaseBundle(), new Behat\Borg\Integration\Symfony\Documentation\DocumentationBundle(), + new Behat\Borg\Application\ExtensionBundle\ExtensionBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { diff --git a/app/config/routing.yml b/app/config/routing.yml index e0b8cad..b4b4261 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -5,6 +5,11 @@ homepage: template: '::homepage.html.twig' section: 'homepage' +extension: + resource: "@ExtensionBundle/Controller/" + type: annotation + prefix: /extensions + documentation: resource: '@DocumentationBundle/Controller/' type: annotation diff --git a/src/Application/ExtensionBundle/Controller/ExtensionController.php b/src/Application/ExtensionBundle/Controller/ExtensionController.php new file mode 100644 index 0000000..3bcf07b --- /dev/null +++ b/src/Application/ExtensionBundle/Controller/ExtensionController.php @@ -0,0 +1,11 @@ +load('services.xml'); + } +} diff --git a/src/Application/ExtensionBundle/ExtensionBundle.php b/src/Application/ExtensionBundle/ExtensionBundle.php new file mode 100644 index 0000000..b5fb181 --- /dev/null +++ b/src/Application/ExtensionBundle/ExtensionBundle.php @@ -0,0 +1,9 @@ + + + + + + From e4fff585df70538af65b8851619b2eeb37ebf49a Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 19:28:40 +0000 Subject: [PATCH 26/59] Implement extension listing controller --- .../Controller/ExtensionController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Application/ExtensionBundle/Controller/ExtensionController.php b/src/Application/ExtensionBundle/Controller/ExtensionController.php index 3bcf07b..4cb55c4 100644 --- a/src/Application/ExtensionBundle/Controller/ExtensionController.php +++ b/src/Application/ExtensionBundle/Controller/ExtensionController.php @@ -2,10 +2,27 @@ namespace Behat\Borg\Application\ExtensionBundle\Controller; +use Behat\Borg\ExtensionCatalogue; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; class ExtensionController extends Controller { + /** + * @Route("/") + * @Template() + */ + public function listAction() + { + return ['extensions' => $this->catalogue()->all()]; + } + + /** + * @return ExtensionCatalogue + */ + private function catalogue() + { + return $this->get('extension.catalogue'); + } } From 118b01aefc980dab3ddeb6443eba9747c0f9ba0f Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 19:33:59 +0000 Subject: [PATCH 27/59] Define extension.catalogue service --- app/config/config_test.yml | 1 + .../Resources/config/services.xml | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/config/config_test.yml b/app/config/config_test.yml index 50ec66c..6b58ac3 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -22,3 +22,4 @@ parameters: package.release_downloader.path: %kernel.cache_dir%/build/repositories documentation.build.path: %kernel.cache_dir%/build/docs documentation.publisher.path: %kernel.cache_dir%/docs + extension.repo.path: %kernel.cache_dir%%/extensions diff --git a/src/Application/ExtensionBundle/Resources/config/services.xml b/src/Application/ExtensionBundle/Resources/config/services.xml index df06712..5878320 100644 --- a/src/Application/ExtensionBundle/Resources/config/services.xml +++ b/src/Application/ExtensionBundle/Resources/config/services.xml @@ -4,13 +4,22 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - + From 110d1a9d5fb3e2f4d112300dfb31e8cba547a737 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 15 Mar 2015 20:11:23 +0000 Subject: [PATCH 28/59] Add extensions template --- .../Resources/views/Extension/list.html.twig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig diff --git a/src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig b/src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig new file mode 100644 index 0000000..7c947bb --- /dev/null +++ b/src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig @@ -0,0 +1,14 @@ +{% extends '::layout.html.twig' %} + +{% block stylesheets %} +{% endblock %} + +{% block page %} +
+ {% for extension in extensions %} +
+ {{ extension }} +
+ {% endfor %} +
+{% endblock %} From b290e95ef265ea2d42843ca3da48d1a501b5ef3a Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 16 Mar 2015 23:29:31 +0000 Subject: [PATCH 29/59] Fix Extension bundle to be inline with master changes --- app/AppKernel.php | 2 +- .../Controller/ExtensionController.php | 2 +- .../DependencyInjection/ExtensionExtension.php | 2 +- .../{ExtensionBundle => Extension}/ExtensionBundle.php | 2 +- .../Resources/config/services.xml | 2 +- .../Resources/views/Extension/list.html.twig | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename src/Application/{ExtensionBundle => Extension}/Controller/ExtensionController.php (90%) rename src/Application/{ExtensionBundle => Extension}/DependencyInjection/ExtensionExtension.php (91%) rename src/Application/{ExtensionBundle => Extension}/ExtensionBundle.php (66%) rename src/Application/{ExtensionBundle => Extension}/Resources/config/services.xml (88%) rename src/Application/{ExtensionBundle => Extension}/Resources/views/Extension/list.html.twig (100%) diff --git a/app/AppKernel.php b/app/AppKernel.php index 3a7aec2..345db2a 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,7 +17,7 @@ public function registerBundles() new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Behat\Borg\Integration\Symfony\Release\ReleaseBundle(), new Behat\Borg\Integration\Symfony\Documentation\DocumentationBundle(), - new Behat\Borg\Application\ExtensionBundle\ExtensionBundle(), + new Behat\Borg\Application\Extension\ExtensionBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { diff --git a/src/Application/ExtensionBundle/Controller/ExtensionController.php b/src/Application/Extension/Controller/ExtensionController.php similarity index 90% rename from src/Application/ExtensionBundle/Controller/ExtensionController.php rename to src/Application/Extension/Controller/ExtensionController.php index 4cb55c4..f9f56d3 100644 --- a/src/Application/ExtensionBundle/Controller/ExtensionController.php +++ b/src/Application/Extension/Controller/ExtensionController.php @@ -1,6 +1,6 @@ %extension.repo.path%/catalogue.meta diff --git a/src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig b/src/Application/Extension/Resources/views/Extension/list.html.twig similarity index 100% rename from src/Application/ExtensionBundle/Resources/views/Extension/list.html.twig rename to src/Application/Extension/Resources/views/Extension/list.html.twig From ea211358bc37c716d860142cc50abce0edd58784 Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 16 Mar 2015 23:48:00 +0000 Subject: [PATCH 30/59] Add ExtensionCataloguer to the list of package listeners --- .../Composer/ComposerExtractorSpec.php | 15 ++++++++++++++ .../Extension/Resources/config/services.xml | 9 +++++++++ .../Extension/Composer/ComposerExtractor.php | 20 +++++++++++++++++++ .../Release/Resources/config/services.xml | 3 +++ 4 files changed, 47 insertions(+) create mode 100644 spec/Integration/Extension/Composer/ComposerExtractorSpec.php create mode 100644 src/Integration/Extension/Composer/ComposerExtractor.php diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php new file mode 100644 index 0000000..ed6a25a --- /dev/null +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -0,0 +1,15 @@ +shouldHaveType(Extractor::class); + } +} diff --git a/src/Application/Extension/Resources/config/services.xml b/src/Application/Extension/Resources/config/services.xml index aea8c90..295d2a2 100644 --- a/src/Application/Extension/Resources/config/services.xml +++ b/src/Application/Extension/Resources/config/services.xml @@ -20,6 +20,15 @@ %extension.repo.path%/catalogue.meta + + + + + + + diff --git a/src/Integration/Extension/Composer/ComposerExtractor.php b/src/Integration/Extension/Composer/ComposerExtractor.php new file mode 100644 index 0000000..78957a3 --- /dev/null +++ b/src/Integration/Extension/Composer/ComposerExtractor.php @@ -0,0 +1,20 @@ + + + + Date: Mon, 16 Mar 2015 23:56:43 +0000 Subject: [PATCH 31/59] Implement extraction of non-composer package --- .../Extension/Composer/ComposerExtractorSpec.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php index ed6a25a..1a94ffc 100644 --- a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -3,6 +3,7 @@ namespace spec\Behat\Borg\Integration\Extension\Composer; use Behat\Borg\Extension\Extractor\Extractor; +use Behat\Borg\Release\Package; use PhpSpec\ObjectBehavior; use Prophecy\Argument; @@ -12,4 +13,9 @@ function it_is_extension_extractor() { $this->shouldHaveType(Extractor::class); } + + function it_extracts_nothing_if_provided_package_is_not_a_composer_package(Package $package) + { + $this->extract($package)->shouldReturn(null); + } } From a0c5cf51de61acdcba851f3940bd83137857e2f3 Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 16 Mar 2015 23:57:45 +0000 Subject: [PATCH 32/59] Implement extraction of non-extension composer package --- .../Composer/ComposerExtractorSpec.php | 11 ++++++++++ .../Release/Composer/ComposerPackageSpec.php | 8 ++++---- .../Release/Composer/ComposerPackage.php | 20 ++++++++++--------- .../Composer/ComposerPackageFinder.php | 2 +- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php index 1a94ffc..f88affb 100644 --- a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -3,6 +3,7 @@ namespace spec\Behat\Borg\Integration\Extension\Composer; use Behat\Borg\Extension\Extractor\Extractor; +use Behat\Borg\Integration\Release\Composer\ComposerPackage; use Behat\Borg\Release\Package; use PhpSpec\ObjectBehavior; use Prophecy\Argument; @@ -18,4 +19,14 @@ function it_extracts_nothing_if_provided_package_is_not_a_composer_package(Packa { $this->extract($package)->shouldReturn(null); } + + function it_extracts_nothing_if_provided_composer_package_is_not_of_type_behat_extension() + { + $package = new ComposerPackage([ + 'name' => 'behat/behat', + 'type' => 'library' + ]); + + $this->extract($package)->shouldReturn(null); + } } diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index 54bcf8e..68aac35 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -10,7 +10,7 @@ class ComposerPackageSpec extends ObjectBehavior { function let() { - $this->beConstructedWith('behat/docs'); + $this->beConstructedWith(['name' => 'behat/docs', 'type' => 'library']); } function it_is_a_package() @@ -20,12 +20,12 @@ function it_is_a_package() function it_can_not_be_constructed_with_a_name_that_has_less_than_2_segments_in_it() { - $this->shouldThrow()->during('__construct', ['behat']); + $this->shouldThrow()->during('__construct', [['name' => 'behat', 'type' => 'library']]); } function it_can_not_be_constructed_with_a_name_that_has_more_than_2_segments_in_it() { - $this->shouldThrow()->during('__construct', ['behat/docs/v2']); + $this->shouldThrow()->during('__construct', [['name' => 'behat/docs/v2', 'type' => 'library']]); } function its_organisation_name_is_a_first_segment_of_the_constructor_argument() @@ -35,7 +35,7 @@ function its_organisation_name_is_a_first_segment_of_the_constructor_argument() function it_lowercases_provided_organisation_and_package_name() { - $this->beConstructedWith('Behat/Docs'); + $this->beConstructedWith(['name' => 'Behat/Docs', 'type' => 'library']); $this->organisationName()->shouldReturn('behat'); $this->name()->shouldReturn('docs'); diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index 937c1b0..d44957a 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -13,22 +13,24 @@ final class ComposerPackage implements Package /** * @var string */ - private $string; + private $name; /** * Initializes package. * - * @param string $string + * @param array $data */ - public function __construct($string) + public function __construct(array $data) { - if (1 !== preg_match(self::PACKAGE_NAME_REGEX, $string)) { + $name = $data['name']; + + if (1 !== preg_match(self::PACKAGE_NAME_REGEX, $name)) { throw new BadPackageNameGiven( - "Composer package name should match `" . self::PACKAGE_NAME_REGEX . "`, but `{$string}` given." + "Composer package name should match `" . self::PACKAGE_NAME_REGEX . "`, but `{$name}` given." ); } - $this->string = strtolower($string); + $this->name = strtolower($name); } /** @@ -36,7 +38,7 @@ public function __construct($string) */ public function organisationName() { - return explode('/', $this->string)[0]; + return explode('/', $this->name)[0]; } /** @@ -44,7 +46,7 @@ public function organisationName() */ public function name() { - return explode('/', $this->string)[1]; + return explode('/', $this->name)[1]; } /** @@ -52,6 +54,6 @@ public function name() */ public function __toString() { - return $this->string; + return $this->name; } } diff --git a/src/Integration/Release/Composer/ComposerPackageFinder.php b/src/Integration/Release/Composer/ComposerPackageFinder.php index c307a27..486dbbf 100644 --- a/src/Integration/Release/Composer/ComposerPackageFinder.php +++ b/src/Integration/Release/Composer/ComposerPackageFinder.php @@ -22,6 +22,6 @@ public function find(Download $download) $path = $download->filePath('composer.json'); $meta = json_decode(file_get_contents($path), true); - return new ComposerPackage($meta['name']); + return new ComposerPackage($meta); } } From cf0b978ef099ba9abd7d6ae043253c330b5a8905 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 17 Mar 2015 00:17:31 +0000 Subject: [PATCH 33/59] Implement extensions list page --- app/config/config_test.yml | 2 +- .../Composer/ComposerExtensionSpec.php | 35 ++++++++++++ .../Composer/ComposerExtractorSpec.php | 13 +++++ .../Release/Composer/ComposerPackageSpec.php | 9 ++- .../Filesystem/PersistedObjectsRepository.php | 1 + .../Extension/Composer/ComposerExtension.php | 56 +++++++++++++++++++ .../Extension/Composer/ComposerExtractor.php | 11 +++- .../Filesystem/PersistedObjectsRepository.php | 1 + .../Release/Composer/ComposerPackage.php | 15 +++++ 9 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 spec/Integration/Extension/Composer/ComposerExtensionSpec.php create mode 100644 src/Integration/Extension/Composer/ComposerExtension.php diff --git a/app/config/config_test.yml b/app/config/config_test.yml index 6b58ac3..6f763e2 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -22,4 +22,4 @@ parameters: package.release_downloader.path: %kernel.cache_dir%/build/repositories documentation.build.path: %kernel.cache_dir%/build/docs documentation.publisher.path: %kernel.cache_dir%/docs - extension.repo.path: %kernel.cache_dir%%/extensions + extension.repo.path: %kernel.cache_dir%/extensions diff --git a/spec/Integration/Extension/Composer/ComposerExtensionSpec.php b/spec/Integration/Extension/Composer/ComposerExtensionSpec.php new file mode 100644 index 0000000..97c09ac --- /dev/null +++ b/spec/Integration/Extension/Composer/ComposerExtensionSpec.php @@ -0,0 +1,35 @@ +beConstructedWith('behat', 'symfony2-extension'); + } + + function it_is_extension() + { + $this->shouldHaveType(Extension::class); + } + + function it_has_an_organisation_name() + { + $this->organisationName()->shouldReturn('behat'); + } + + function it_has_a_name() + { + $this->name()->shouldReturn('symfony2-extension'); + } + + function it_can_be_converted_to_string() + { + $this->__toString()->shouldReturn('behat/symfony2-extension'); + } +} diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php index f88affb..b2e8c7e 100644 --- a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -2,6 +2,7 @@ namespace spec\Behat\Borg\Integration\Extension\Composer; +use Behat\Borg\Extension\Extension; use Behat\Borg\Extension\Extractor\Extractor; use Behat\Borg\Integration\Release\Composer\ComposerPackage; use Behat\Borg\Release\Package; @@ -29,4 +30,16 @@ function it_extracts_nothing_if_provided_composer_package_is_not_of_type_behat_e $this->extract($package)->shouldReturn(null); } + + function it_extracts_extension_if_provided_composer_package_is_of_type_behat_extension() + { + $package = new ComposerPackage([ + 'name' => 'behat/symfony2-extension', + 'type' => 'behat-extension' + ]); + + $extension = $this->extract($package); + $extension->shouldHaveType(Extension::class); + $extension->name()->shouldReturn('symfony2-extension'); + } } diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index 68aac35..1c93862 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -28,7 +28,7 @@ function it_can_not_be_constructed_with_a_name_that_has_more_than_2_segments_in_ $this->shouldThrow()->during('__construct', [['name' => 'behat/docs/v2', 'type' => 'library']]); } - function its_organisation_name_is_a_first_segment_of_the_constructor_argument() + function its_organisation_name_is_a_first_segment_of_the_composer_package_name() { $this->organisationName()->shouldReturn('behat'); } @@ -41,11 +41,16 @@ function it_lowercases_provided_organisation_and_package_name() $this->name()->shouldReturn('docs'); } - function its_name_is_a_second_segment_of_the_constructor_argument() + function its_name_is_a_second_segment_of_the_composer_package_name() { $this->name()->shouldReturn('docs'); } + function it_has_type() + { + $this->type()->shouldReturn('library'); + } + function its_string_representation_is_the_name_of_the_package() { $this->__toString()->shouldReturn('behat/docs'); diff --git a/src/Integration/Documentation/Filesystem/PersistedObjectsRepository.php b/src/Integration/Documentation/Filesystem/PersistedObjectsRepository.php index 1a713ba..99e58aa 100644 --- a/src/Integration/Documentation/Filesystem/PersistedObjectsRepository.php +++ b/src/Integration/Documentation/Filesystem/PersistedObjectsRepository.php @@ -14,6 +14,7 @@ final class PersistedObjectsRepository implements Repository, ObjectIdentifier { public function __construct($path) { + $path && @mkdir(dirname($path), 0777, true); $this->repo = $path ? new FileRepository($path, $this) : new InMemoryRepository($this); } diff --git a/src/Integration/Extension/Composer/ComposerExtension.php b/src/Integration/Extension/Composer/ComposerExtension.php new file mode 100644 index 0000000..13dc60f --- /dev/null +++ b/src/Integration/Extension/Composer/ComposerExtension.php @@ -0,0 +1,56 @@ +organisationName = $organisationName; + $this->name = $name; + } + + /** + * {@inheritdoc} + */ + public function organisationName() + { + return $this->organisationName; + } + + /** + * {@inheritdoc} + */ + public function name() + { + return $this->name; + } + + /** + * {@inheritdoc} + */ + public function __toString() + { + return sprintf('%s/%s', $this->organisationName, $this->name); + } +} diff --git a/src/Integration/Extension/Composer/ComposerExtractor.php b/src/Integration/Extension/Composer/ComposerExtractor.php index 78957a3..1d7b551 100644 --- a/src/Integration/Extension/Composer/ComposerExtractor.php +++ b/src/Integration/Extension/Composer/ComposerExtractor.php @@ -3,6 +3,7 @@ namespace Behat\Borg\Integration\Extension\Composer; use Behat\Borg\Extension\Extractor\Extractor; +use Behat\Borg\Integration\Release\Composer\ComposerPackage; use Behat\Borg\Release\Package; /** @@ -15,6 +16,14 @@ final class ComposerExtractor implements Extractor */ public function extract(Package $package) { - // TODO: Implement extract() method. + if (!$package instanceof ComposerPackage) { + return null; + } + + if ('behat-extension' != $package->type()) { + return null; + } + + return new ComposerExtension($package->organisationName(), $package->name()); } } diff --git a/src/Integration/Extension/Filesystem/PersistedObjectsRepository.php b/src/Integration/Extension/Filesystem/PersistedObjectsRepository.php index e2c2ba3..0ca10fe 100644 --- a/src/Integration/Extension/Filesystem/PersistedObjectsRepository.php +++ b/src/Integration/Extension/Filesystem/PersistedObjectsRepository.php @@ -15,6 +15,7 @@ final class PersistedObjectsRepository implements Repository, ObjectIdentifier public function __construct($path) { + $path && @mkdir(dirname($path), 0777, true); $this->repo = $path ? new FileRepository($path, $this) : new InMemoryRepository($this); } diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index d44957a..18bdf64 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -14,6 +14,10 @@ final class ComposerPackage implements Package * @var string */ private $name; + /** + * @var string + */ + private $type; /** * Initializes package. @@ -31,6 +35,7 @@ public function __construct(array $data) } $this->name = strtolower($name); + $this->type = $data['type']; } /** @@ -49,6 +54,16 @@ public function name() return explode('/', $this->name)[1]; } + /** + * Returns composer package type. + * + * @return string + */ + public function type() + { + return $this->type; + } + /** * {@inheritdoc] */ From e9632285839480ff8e2c97928400d95a1c0f2e7f Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 17 Mar 2015 19:30:40 +0000 Subject: [PATCH 34/59] Fix the ExtensionCataloguer namespace --- src/Application/Extension/Resources/config/services.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Application/Extension/Resources/config/services.xml b/src/Application/Extension/Resources/config/services.xml index 295d2a2..e631007 100644 --- a/src/Application/Extension/Resources/config/services.xml +++ b/src/Application/Extension/Resources/config/services.xml @@ -21,7 +21,7 @@ From 252bc79be7818403c44342cc59a6c81f1c1e9b67 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 17 Mar 2015 23:07:47 +0000 Subject: [PATCH 35/59] Move Extension bundle under Integration --- app/AppKernel.php | 2 +- .../Symfony}/Extension/Controller/ExtensionController.php | 2 +- .../Extension/DependencyInjection/ExtensionExtension.php | 2 +- .../Symfony}/Extension/ExtensionBundle.php | 2 +- .../Symfony}/Extension/Resources/config/services.xml | 0 .../Symfony}/Extension/Resources/views/Extension/list.html.twig | 0 6 files changed, 4 insertions(+), 4 deletions(-) rename src/{Application => Integration/Symfony}/Extension/Controller/ExtensionController.php (90%) rename src/{Application => Integration/Symfony}/Extension/DependencyInjection/ExtensionExtension.php (90%) rename src/{Application => Integration/Symfony}/Extension/ExtensionBundle.php (65%) rename src/{Application => Integration/Symfony}/Extension/Resources/config/services.xml (100%) rename src/{Application => Integration/Symfony}/Extension/Resources/views/Extension/list.html.twig (100%) diff --git a/app/AppKernel.php b/app/AppKernel.php index 345db2a..804b67d 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,7 +17,7 @@ public function registerBundles() new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Behat\Borg\Integration\Symfony\Release\ReleaseBundle(), new Behat\Borg\Integration\Symfony\Documentation\DocumentationBundle(), - new Behat\Borg\Application\Extension\ExtensionBundle(), + new Behat\Borg\Integration\Symfony\Extension\ExtensionBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { diff --git a/src/Application/Extension/Controller/ExtensionController.php b/src/Integration/Symfony/Extension/Controller/ExtensionController.php similarity index 90% rename from src/Application/Extension/Controller/ExtensionController.php rename to src/Integration/Symfony/Extension/Controller/ExtensionController.php index f9f56d3..bf5289a 100644 --- a/src/Application/Extension/Controller/ExtensionController.php +++ b/src/Integration/Symfony/Extension/Controller/ExtensionController.php @@ -1,6 +1,6 @@ Date: Sun, 22 Mar 2015 12:46:27 +0000 Subject: [PATCH 36/59] Change Extension interface into the VO --- .../bootstrap/ExtensionMaintainerContext.php | 12 ++-- ...Extension.php => FakeExtensionPackage.php} | 23 +++++--- .../Fake/Extension/FakeExtractor.php | 4 +- .../bootstrap/Fake/Release/FakeRepository.php | 11 ++-- .../bootstrap/Smoke/ExtensionUIContext.php | 22 +++----- .../bootstrap/Transformation/Extension.php | 8 +-- features/extensions_are_catalogued.feature | 10 ++-- .../ExtensionSpec.php} | 10 +--- spec/ExtensionCatalogueSpec.php | 8 ++- src/Extension/Extension.php | 48 ++++++++++++---- .../Extension/Composer/ComposerExtension.php | 56 ------------------- .../Extension/Composer/ComposerExtractor.php | 3 +- 12 files changed, 91 insertions(+), 124 deletions(-) rename features/bootstrap/Fake/Extension/{FakeExtension.php => FakeExtensionPackage.php} (51%) rename spec/{Integration/Extension/Composer/ComposerExtensionSpec.php => Extension/ExtensionSpec.php} (67%) delete mode 100644 src/Integration/Extension/Composer/ComposerExtension.php diff --git a/features/bootstrap/ExtensionMaintainerContext.php b/features/bootstrap/ExtensionMaintainerContext.php index 157a8bb..24220c0 100644 --- a/features/bootstrap/ExtensionMaintainerContext.php +++ b/features/bootstrap/ExtensionMaintainerContext.php @@ -9,7 +9,7 @@ use Behat\Borg\Release\ReleasePackager; use Behat\Borg\Release\Version; use Behat\Borg\ReleaseManager; -use Fake\Extension\FakeExtension; +use Fake\Extension\FakeExtensionPackage; use Fake\Extension\FakeExtractor; use Fake\Release\FakeDownloader; use Fake\Release\FakePackageFinder; @@ -47,17 +47,17 @@ public function __construct() } /** - * @Given :extension extension was created in :repository + * @Given :extensionPackage extension package was created in :repository */ - public function extensionWasCreated(FakeRepository $repository, FakeExtension $extension) + public function extensionPackageWasCreated(FakeRepository $repository, FakeExtensionPackage $extensionPackage) { - $repository->createExtension($extension); + $repository->createPackage($extensionPackage); } /** - * @Given extension was not created in :repository + * @Given extension package was not created in :repository */ - public function extensionWasNotCreated() { } + public function extensionPackageWasNotCreated() { } /** * @Given :package version :version was documented in :repository diff --git a/features/bootstrap/Fake/Extension/FakeExtension.php b/features/bootstrap/Fake/Extension/FakeExtensionPackage.php similarity index 51% rename from features/bootstrap/Fake/Extension/FakeExtension.php rename to features/bootstrap/Fake/Extension/FakeExtensionPackage.php index bb404e5..b7ca4d5 100644 --- a/features/bootstrap/Fake/Extension/FakeExtension.php +++ b/features/bootstrap/Fake/Extension/FakeExtensionPackage.php @@ -5,35 +5,42 @@ use Behat\Borg\Extension\Extension; use Behat\Borg\Release\Package; -final class FakeExtension implements Extension, Package +final class FakeExtensionPackage implements Package { - private $name; + private $parts; public static function named($name) { - if (2 !== count(explode('/', $name))) { + $parts = explode('/', $name); + + if (2 !== count($parts)) { throw new \InvalidArgumentException('Extension should include organisation and name.'); } - $package = new FakeExtension(); - $package->name = $name; + $package = new FakeExtensionPackage(); + $package->parts = $parts; return $package; } public function organisationName() { - return explode('/', $this->name)[0]; + return $this->parts[0]; } public function name() { - return explode('/', $this->name)[1]; + return $this->parts[1]; } public function __toString() { - return $this->name; + return implode('/', $this->parts); + } + + public function extension() + { + return new Extension($this->organisationName(), $this->name()); } private function __construct() { } diff --git a/features/bootstrap/Fake/Extension/FakeExtractor.php b/features/bootstrap/Fake/Extension/FakeExtractor.php index dfe8740..4d88a39 100644 --- a/features/bootstrap/Fake/Extension/FakeExtractor.php +++ b/features/bootstrap/Fake/Extension/FakeExtractor.php @@ -9,8 +9,8 @@ final class FakeExtractor implements Extractor { public function extract(Package $package) { - if ($package instanceof FakeExtension) { - return $package; + if ($package instanceof FakeExtensionPackage) { + return $package->extension(); } return null; diff --git a/features/bootstrap/Fake/Release/FakeRepository.php b/features/bootstrap/Fake/Release/FakeRepository.php index 70bacd0..7c6ba09 100644 --- a/features/bootstrap/Fake/Release/FakeRepository.php +++ b/features/bootstrap/Fake/Release/FakeRepository.php @@ -9,13 +9,12 @@ use DateTimeImmutable; use Fake\Documentation\FakeDocumentationDownload; use Fake\Documentation\FakeSource; -use Fake\Extension\FakeExtension; final class FakeRepository implements Repository { private $name; private $downloads = []; - private $extension; + private $package; public static function named($name) { @@ -50,9 +49,9 @@ public function documentPackage(Package $package, Version $version, DateTimeImmu $this->downloads[(string)$release] = new FakeDocumentationDownload($release, $time, $package, new FakeSource()); } - public function createExtension(FakeExtension $extension) + public function createPackage(Package $package) { - $this->extension = $extension; + $this->package = $package; } public function download(Release $release) @@ -61,8 +60,8 @@ public function download(Release $release) return $this->downloads[(string)$release]; } - if ($this->extension) { - return new FakePackageDownload($release, new DateTimeImmutable(), $this->extension); + if ($this->package) { + return new FakePackageDownload($release, new DateTimeImmutable(), $this->package); } return new FakeDownload($release, new DateTimeImmutable()); diff --git a/features/bootstrap/Smoke/ExtensionUIContext.php b/features/bootstrap/Smoke/ExtensionUIContext.php index 53a84d5..3ebf0c7 100644 --- a/features/bootstrap/Smoke/ExtensionUIContext.php +++ b/features/bootstrap/Smoke/ExtensionUIContext.php @@ -3,8 +3,6 @@ namespace Smoke; use Behat\Behat\Context\Context; -use Behat\Borg\Extension\Extension; -use Behat\Borg\Release\Repository; use Behat\MinkExtension\Context\RawMinkContext; use Github\Client; use PHPUnit_Framework_Assert as PHPUnit; @@ -15,8 +13,6 @@ */ class ExtensionUIContext extends RawMinkContext implements Context { - use Transformation\Extension; - private $client; /** @@ -30,9 +26,9 @@ public function __construct(Client $client) } /** - * @Given :extension extension was created in :repository + * @Given :extension extension package was created in :repository */ - public function extensionWasCreated(Repository $repository, Extension $extension) + public function extensionWasCreated($repository, $extension) { PHPUnit::assertTrue($this->repositoryExtensionIs($repository, $extension), 'Repository does not contain expected extension.'); } @@ -48,19 +44,17 @@ public function extensionCatalogueShouldHaveCount($count = 0) $this->assertSession()->elementsCount('css', '.extension', $count); } - private function repositoryExtensionIs(Repository $repository, Extension $extension) + private function repositoryExtensionIs($repository, $extension) { $content = $this->contentInRepository($repository, 'composer.json'); - return 1 === preg_match('#"name"\s*:\s*"' . preg_quote((string)$extension) . '"#', $content); + return 1 === preg_match('#"name"\s*:\s*"' . preg_quote($extension) . '"#', $content); } - private function contentInRepository(Repository $repository, $path) + private function contentInRepository($repository, $path) { - return file_get_contents( - $this->client->repo()->contents()->show( - (string)$repository->organisationName(), (string)$repository->name(), $path - )['download_url'] - ); + $repositoryParts = explode('/', $repository); + + return file_get_contents($this->client->repo()->contents()->show($repositoryParts[0], $repositoryParts[1], $path)['download_url']); } } diff --git a/features/bootstrap/Transformation/Extension.php b/features/bootstrap/Transformation/Extension.php index 62dce9e..992dae6 100644 --- a/features/bootstrap/Transformation/Extension.php +++ b/features/bootstrap/Transformation/Extension.php @@ -2,16 +2,16 @@ namespace Transformation; -use Fake\Extension\FakeExtension; +use Fake\Extension\FakeExtensionPackage; trait Extension { /** - * @Transform :extension + * @Transform :extensionPackage */ - public function transformStringToExtension($string) + public function transformStringToExtensionPackage($string) { - return FakeExtension::named($string); + return FakeExtensionPackage::named($string); } /** diff --git a/features/extensions_are_catalogued.feature b/features/extensions_are_catalogued.feature index 3cbb0fe..d0e6a34 100644 --- a/features/extensions_are_catalogued.feature +++ b/features/extensions_are_catalogued.feature @@ -9,27 +9,27 @@ Feature: Extensions are catalogued - If repository has documentation, but no extensions, releasing it still doesn't change the catalogue Scenario: Releasing a stable extension - Given "behat/symfony2-extension" extension was created in "Behat/Symfony2Extension" + Given "behat/symfony2-extension" extension package was created in "Behat/Symfony2Extension" When I release "Behat/Symfony2Extension" version "v2.0.0" Then the extension catalogue should contain 1 extension And "behat/symfony2-extension" extension should be in the catalogue @critical Scenario: Releasing multiple stable extensions - Given "behat/symfony2-extension" extension was created in "Behat/Symfony2Extension" - And "behat/mink-extension" extension was created in "Behat/MinkExtension" + Given "behat/symfony2-extension" extension package was created in "Behat/Symfony2Extension" + And "behat/mink-extension" extension package was created in "Behat/MinkExtension" When I release "Behat/Symfony2Extension" version "v2.0.0" And I release "Behat/MinkExtension" version "v2.0.1" Then the extension catalogue should contain 2 extensions Scenario: Releasing multiple versions of the same extension - Given "behat/mink-extension" extension was created in "Behat/MinkExtension" + Given "behat/mink-extension" extension package was created in "Behat/MinkExtension" When I release "Behat/MinkExtension" version "v2.0.0" And I release "Behat/MinkExtension" version "v2.0.1" Then the extension catalogue should still contain 1 extension Scenario: Releasing repository that has no extensions - Given extension was not created in "Behat/MinkExtension" + Given extension package was not created in "Behat/MinkExtension" When I release "Behat/MinkExtension" version "v2.0.0" Then the extension catalogue should be empty diff --git a/spec/Integration/Extension/Composer/ComposerExtensionSpec.php b/spec/Extension/ExtensionSpec.php similarity index 67% rename from spec/Integration/Extension/Composer/ComposerExtensionSpec.php rename to spec/Extension/ExtensionSpec.php index 97c09ac..b94e7d1 100644 --- a/spec/Integration/Extension/Composer/ComposerExtensionSpec.php +++ b/spec/Extension/ExtensionSpec.php @@ -1,23 +1,17 @@ beConstructedWith('behat', 'symfony2-extension'); } - function it_is_extension() - { - $this->shouldHaveType(Extension::class); - } - function it_has_an_organisation_name() { $this->organisationName()->shouldReturn('behat'); diff --git a/spec/ExtensionCatalogueSpec.php b/spec/ExtensionCatalogueSpec.php index 5a84966..a135fe1 100644 --- a/spec/ExtensionCatalogueSpec.php +++ b/spec/ExtensionCatalogueSpec.php @@ -14,15 +14,19 @@ function let(Repository $repository) $this->beConstructedWith($repository); } - function it_finds_registered_extensions_using_repository(Repository $repository, Extension $extension) + function it_finds_registered_extensions_using_repository(Repository $repository) { + $extension = new Extension('some', 'extension'); + $repository->extension('some/extension')->willReturn($extension); $this->extension('some/extension')->shouldReturn($extension); } - function it_finds_all_registered_extensions_using_repository(Repository $repository, Extension $extension) + function it_finds_all_registered_extensions_using_repository(Repository $repository) { + $extension = new Extension('some', 'extension'); + $repository->all()->willReturn([$extension]); $this->all()->shouldReturn([$extension]); diff --git a/src/Extension/Extension.php b/src/Extension/Extension.php index 7160eda..ab4ed72 100644 --- a/src/Extension/Extension.php +++ b/src/Extension/Extension.php @@ -5,26 +5,50 @@ /** * Represents Behat extension. */ -interface Extension +final class Extension { /** - * Returns extension organisation name. - * - * @return string + * @var string + */ + private $organisationName; + /** + * @var string */ - public function organisationName(); + private $name; /** - * Returns extension name. + * Initializes extension. * - * @return string + * @param string $organisationName + * @param string $name */ - public function name(); + public function __construct($organisationName, $name) + { + $this->organisationName = $organisationName; + $this->name = $name; + } /** - * Returns string representation of extension. - * - * @return string + * {@inheritdoc} + */ + public function organisationName() + { + return $this->organisationName; + } + + /** + * {@inheritdoc} + */ + public function name() + { + return $this->name; + } + + /** + * {@inheritdoc} */ - public function __toString(); + public function __toString() + { + return sprintf('%s/%s', $this->organisationName, $this->name); + } } diff --git a/src/Integration/Extension/Composer/ComposerExtension.php b/src/Integration/Extension/Composer/ComposerExtension.php deleted file mode 100644 index 13dc60f..0000000 --- a/src/Integration/Extension/Composer/ComposerExtension.php +++ /dev/null @@ -1,56 +0,0 @@ -organisationName = $organisationName; - $this->name = $name; - } - - /** - * {@inheritdoc} - */ - public function organisationName() - { - return $this->organisationName; - } - - /** - * {@inheritdoc} - */ - public function name() - { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return sprintf('%s/%s', $this->organisationName, $this->name); - } -} diff --git a/src/Integration/Extension/Composer/ComposerExtractor.php b/src/Integration/Extension/Composer/ComposerExtractor.php index 1d7b551..03861fb 100644 --- a/src/Integration/Extension/Composer/ComposerExtractor.php +++ b/src/Integration/Extension/Composer/ComposerExtractor.php @@ -2,6 +2,7 @@ namespace Behat\Borg\Integration\Extension\Composer; +use Behat\Borg\Extension\Extension; use Behat\Borg\Extension\Extractor\Extractor; use Behat\Borg\Integration\Release\Composer\ComposerPackage; use Behat\Borg\Release\Package; @@ -24,6 +25,6 @@ public function extract(Package $package) return null; } - return new ComposerExtension($package->organisationName(), $package->name()); + return new Extension($package->organisationName(), $package->name()); } } From 665f8cd134c820117cd1543bef170551de7c50e5 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 29 Mar 2015 14:16:56 +0100 Subject: [PATCH 37/59] Fetch extension description and author from Composer --- .../Fake/Extension/FakeExtensionPackage.php | 2 +- spec/Extension/ExtensionSpec.php | 12 ++++- spec/ExtensionCatalogueSpec.php | 4 +- .../Release/Composer/ComposerPackageSpec.php | 45 ++++++++++++++++++- src/Extension/Extension.php | 44 ++++++++++++++++-- .../Extension/Composer/ComposerExtractor.php | 18 +++++++- .../Release/Composer/ComposerPackage.php | 40 +++++++++++++++++ .../Resources/views/Extension/list.html.twig | 7 ++- 8 files changed, 161 insertions(+), 11 deletions(-) diff --git a/features/bootstrap/Fake/Extension/FakeExtensionPackage.php b/features/bootstrap/Fake/Extension/FakeExtensionPackage.php index b7ca4d5..33e6ce6 100644 --- a/features/bootstrap/Fake/Extension/FakeExtensionPackage.php +++ b/features/bootstrap/Fake/Extension/FakeExtensionPackage.php @@ -40,7 +40,7 @@ public function __toString() public function extension() { - return new Extension($this->organisationName(), $this->name()); + return new Extension($this->organisationName(), $this->name(), 'some package', 'anonymous'); } private function __construct() { } diff --git a/spec/Extension/ExtensionSpec.php b/spec/Extension/ExtensionSpec.php index b94e7d1..8537d09 100644 --- a/spec/Extension/ExtensionSpec.php +++ b/spec/Extension/ExtensionSpec.php @@ -9,7 +9,7 @@ class ExtensionSpec extends ObjectBehavior { function let() { - $this->beConstructedWith('behat', 'symfony2-extension'); + $this->beConstructedWith('behat', 'symfony2-extension', 'Symfony2 framework extension for Behat', 'Konstantin Kudryashov'); } function it_has_an_organisation_name() @@ -26,4 +26,14 @@ function it_can_be_converted_to_string() { $this->__toString()->shouldReturn('behat/symfony2-extension'); } + + function it_has_a_description() + { + $this->description()->shouldReturn('Symfony2 framework extension for Behat'); + } + + function it_has_author() + { + $this->author()->shouldReturn('Konstantin Kudryashov'); + } } diff --git a/spec/ExtensionCatalogueSpec.php b/spec/ExtensionCatalogueSpec.php index a135fe1..e8a8277 100644 --- a/spec/ExtensionCatalogueSpec.php +++ b/spec/ExtensionCatalogueSpec.php @@ -16,7 +16,7 @@ function let(Repository $repository) function it_finds_registered_extensions_using_repository(Repository $repository) { - $extension = new Extension('some', 'extension'); + $extension = new Extension('some', 'extension', 'sf2 extension for behat', 'everzet'); $repository->extension('some/extension')->willReturn($extension); @@ -25,7 +25,7 @@ function it_finds_registered_extensions_using_repository(Repository $repository) function it_finds_all_registered_extensions_using_repository(Repository $repository) { - $extension = new Extension('some', 'extension'); + $extension = new Extension('some', 'extension', 'sf2 extension for behat', 'everzet'); $repository->all()->willReturn([$extension]); diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index 1c93862..e860d7d 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -10,7 +10,17 @@ class ComposerPackageSpec extends ObjectBehavior { function let() { - $this->beConstructedWith(['name' => 'behat/docs', 'type' => 'library']); + $this->beConstructedWith( + [ + 'name' => 'behat/docs', + 'type' => 'library', + 'description' => 'behat documentation', + 'authors' => [ + ['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com'], + ['name' => 'Christophe Coevoet', 'email' => 'stof@notk.org'] + ] + ] + ); } function it_is_a_package() @@ -51,6 +61,39 @@ function it_has_type() $this->type()->shouldReturn('library'); } + function it_has_a_description() + { + $this->description()->shouldReturn('behat documentation'); + } + + function it_has_authors() + { + $this->authors()->shouldReturn( + [ + ['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com'], + ['name' => 'Christophe Coevoet', 'email' => 'stof@notk.org'] + ] + ); + } + + function its_primary_author_is_the_first_one() + { + $this->primaryAuthor()->shouldReturn(['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com']); + } + + function its_primary_author_is_null_if_none_authors_found() + { + $this->beConstructedWith( + [ + 'name' => 'behat/docs', + 'type' => 'library', + 'description' => 'behat documentation' + ] + ); + + $this->primaryAuthor()->shouldReturn(null); + } + function its_string_representation_is_the_name_of_the_package() { $this->__toString()->shouldReturn('behat/docs'); diff --git a/src/Extension/Extension.php b/src/Extension/Extension.php index ab4ed72..0e6d393 100644 --- a/src/Extension/Extension.php +++ b/src/Extension/Extension.php @@ -15,21 +15,35 @@ final class Extension * @var string */ private $name; + /** + * @var string + */ + private $description; + /** + * @var string[] + */ + private $author; /** * Initializes extension. * * @param string $organisationName * @param string $name + * @param string $description + * @param string $author */ - public function __construct($organisationName, $name) + public function __construct($organisationName, $name, $description, $author) { $this->organisationName = $organisationName; $this->name = $name; + $this->description = $description; + $this->author = $author; } /** - * {@inheritdoc} + * Returns organisation this extension belongs to. + * + * @return string */ public function organisationName() { @@ -37,7 +51,9 @@ public function organisationName() } /** - * {@inheritdoc} + * Returns name of the extension. + * + * @return string */ public function name() { @@ -45,7 +61,27 @@ public function name() } /** - * {@inheritdoc} + * Returns extension description. + * + * @return string + */ + public function description() + { + return $this->description; + } + + /** + * Returns extension author name. + * + * @return string + */ + public function author() + { + return $this->author; + } + + /** + * Converts extension to string. */ public function __toString() { diff --git a/src/Integration/Extension/Composer/ComposerExtractor.php b/src/Integration/Extension/Composer/ComposerExtractor.php index 03861fb..87e1b53 100644 --- a/src/Integration/Extension/Composer/ComposerExtractor.php +++ b/src/Integration/Extension/Composer/ComposerExtractor.php @@ -25,6 +25,22 @@ public function extract(Package $package) return null; } - return new Extension($package->organisationName(), $package->name()); + return new Extension($package->organisationName(), $package->name(), $package->description(), $this->primaryAuthorName($package)); + } + + /** + * Gets primary author name from the composer package. + * + * @param ComposerPackage $package + * + * @return string + */ + private function primaryAuthorName(ComposerPackage $package) + { + if (!$package->primaryAuthor()) { + return 'Anonymous'; + } + + return $package->primaryAuthor()['name']; } } diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index 18bdf64..b4fef6f 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -18,6 +18,14 @@ final class ComposerPackage implements Package * @var string */ private $type; + /** + * @var string + */ + private $description; + /** + * @var array + */ + private $authors; /** * Initializes package. @@ -36,6 +44,8 @@ public function __construct(array $data) $this->name = strtolower($name); $this->type = $data['type']; + $this->description = isset($data['description']) ? $data['description'] : null; + $this->authors = isset($data['authors']) ? $data['authors'] : []; } /** @@ -64,6 +74,36 @@ public function type() return $this->type; } + /** + * Returns package description. + * + * @return string + */ + public function description() + { + return $this->description; + } + + /** + * Hash of the primary package author or null if no authors defined. + * + * @return array|null + */ + public function primaryAuthor() + { + return count($this->authors) ? $this->authors[0] : null; + } + + /** + * Returns package authors. + * + * @return array + */ + public function authors() + { + return $this->authors; + } + /** * {@inheritdoc] */ diff --git a/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig b/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig index 7c947bb..ed63a3d 100644 --- a/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig +++ b/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig @@ -5,9 +5,14 @@ {% block page %}
+

Extensions

{% for extension in extensions %}
- {{ extension }} +

{{ extension }}

+ by {{ extension.author }} +

+ {{ extension.description }} +

{% endfor %}
From d31977a7b46a1db3a0ee0bb29472a89433da0dac Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 30 Mar 2015 19:48:45 +0100 Subject: [PATCH 38/59] Keep extensions folder --- .gitignore | 2 ++ extensions/.gitkeep | 0 2 files changed, 2 insertions(+) create mode 100644 extensions/.gitkeep diff --git a/.gitignore b/.gitignore index e9665b5..7823183 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ vendor/ web/bundles/ +extensions/* docs/* app/cache/* app/logs/* @@ -7,6 +8,7 @@ build/repositories/* build/docs/* !app/cache/.gitkeep !app/logs/.gitkeep +!extensions/.gitkeep !build/repositories/.gitkeep !build/docs/.gitkeep !docs/.gitkeep diff --git a/extensions/.gitkeep b/extensions/.gitkeep new file mode 100644 index 0000000..e69de29 From cf15a53c44d309d0a9a2264d169dff7d753eecad Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 30 Mar 2015 20:56:50 +0100 Subject: [PATCH 39/59] Fix broken service definition --- src/Integration/Symfony/Extension/Resources/config/services.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Integration/Symfony/Extension/Resources/config/services.xml b/src/Integration/Symfony/Extension/Resources/config/services.xml index e631007..10ab748 100644 --- a/src/Integration/Symfony/Extension/Resources/config/services.xml +++ b/src/Integration/Symfony/Extension/Resources/config/services.xml @@ -26,7 +26,7 @@ - +
From 29c36b8320d57b4cb48c2974cda7abf2d7dfe600 Mon Sep 17 00:00:00 2001 From: everzet Date: Sat, 1 Aug 2015 10:11:55 +0100 Subject: [PATCH 40/59] Fix broken DirectoryPublisher test --- tests/Documentation/Filesystem/DirectoryPublisherTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Documentation/Filesystem/DirectoryPublisherTest.php b/tests/Documentation/Filesystem/DirectoryPublisherTest.php index 742b3b6..d05b509 100644 --- a/tests/Documentation/Filesystem/DirectoryPublisherTest.php +++ b/tests/Documentation/Filesystem/DirectoryPublisherTest.php @@ -33,7 +33,7 @@ function it_publishes_documentation_by_moving_it_to_appropriate_folder() $anId = new DocumentationId('built_doc', 'v1.0'); $builtDoc = $this->getMock(BuiltDocumentation::class); $builtDoc->method('documentationId')->willReturn($anId); - $builtDoc->method('buildPath')->willReturn($this->tempBuildPath . '/built_doc/v1.0'); + $builtDoc->method('path')->willReturn($this->tempBuildPath . '/built_doc/v1.0'); (new Filesystem())->mkdir($this->tempBuildPath . '/built_doc/v1.0'); (new Filesystem())->touch($this->tempBuildPath . '/built_doc/v1.0/my_file'); From 0663a67f7bbed81276d6eaf19641e080442e734c Mon Sep 17 00:00:00 2001 From: everzet Date: Sat, 1 Aug 2015 10:13:39 +0100 Subject: [PATCH 41/59] Update dependencies --- app/SymfonyRequirements.php | 55 +++- composer.lock | 634 ++++++++++++++++++++---------------- 2 files changed, 393 insertions(+), 296 deletions(-) diff --git a/app/SymfonyRequirements.php b/app/SymfonyRequirements.php index cbcf1c8..b9d62f7 100644 --- a/app/SymfonyRequirements.php +++ b/app/SymfonyRequirements.php @@ -77,7 +77,7 @@ public function getTestMessage() } /** - * Returns the help text for resolving the problem + * Returns the help text for resolving the problem. * * @return string The help text */ @@ -119,10 +119,10 @@ class PhpIniRequirement extends Requirement * * @param string $cfgName The configuration name used for ini_get() * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) @@ -221,10 +221,10 @@ public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText * * @param string $cfgName The configuration name used for ini_get() * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) @@ -239,10 +239,10 @@ public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = * * @param string $cfgName The configuration name used for ini_get() * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) @@ -542,11 +542,22 @@ function_exists('simplexml_import_dom'), /* optional recommendations follow */ - $this->addRecommendation( - file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'), - 'Requirements file should be up-to-date', - 'Your requirements file is outdated. Run composer install and re-check your configuration.' - ); + if (file_exists(__DIR__.'/../vendor/composer')) { + require_once __DIR__.'/../vendor/autoload.php'; + + try { + $r = new \ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); + + $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); + } catch (\ReflectionException $e) { + $contents = ''; + } + $this->addRecommendation( + file_get_contents(__FILE__) === $contents, + 'Requirements file should be up-to-date', + 'Your requirements file is outdated. Run composer install and re-check your configuration.' + ); + } $this->addRecommendation( version_compare($installedPhpVersion, '5.3.4', '>='), @@ -632,15 +643,15 @@ class_exists('Locale'), 'Install and enable the intl extension (used for validators).' ); - if (class_exists('Collator')) { + if (extension_loaded('intl')) { + // in some WAMP server installations, new Collator() returns null $this->addRecommendation( null !== new Collator('fr_FR'), 'intl extension should be correctly configured', 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.' ); - } - if (class_exists('Locale')) { + // check for compatible ICU versions (only done when you have the intl extension) if (defined('INTL_ICU_VERSION')) { $version = INTL_ICU_VERSION; } else { @@ -659,6 +670,14 @@ class_exists('Locale'), 'intl ICU version should be at least 4+', 'Upgrade your intl extension with a newer ICU version (4+).' ); + + $this->addPhpIniRecommendation( + 'intl.error_level', + create_function('$cfgValue', 'return (int) $cfgValue === 0;'), + true, + 'intl.error_level should be 0 in php.ini', + 'Set "intl.error_level" to "0" in php.ini* to inhibit the messages when an error occurs in ICU functions.' + ); } $accelerator = diff --git a/composer.lock b/composer.lock index df2f8a4..f8a54af 100644 --- a/composer.lock +++ b/composer.lock @@ -1,23 +1,23 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "bac14b2d878cb89a93da23dc0ee2d225", + "hash": "3f407f0cd601e00b3b39467d3b8d68f2", "packages": [ { "name": "doctrine/annotations", - "version": "v1.2.3", + "version": "v1.2.6", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "eeda578cbe24a170331a1cfdf78be723412df7a4" + "reference": "f4a91702ca3cd2e568c3736aa031ed00c3752af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/eeda578cbe24a170331a1cfdf78be723412df7a4", - "reference": "eeda578cbe24a170331a1cfdf78be723412df7a4", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f4a91702ca3cd2e568c3736aa031ed00c3752af4", + "reference": "f4a91702ca3cd2e568c3736aa031ed00c3752af4", "shasum": "" }, "require": { @@ -72,20 +72,20 @@ "docblock", "parser" ], - "time": "2014-12-20 20:49:38" + "time": "2015-06-17 12:21:22" }, { "name": "doctrine/cache", - "version": "v1.4.0", + "version": "v1.4.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "2346085d2b027b233ae1d5de59b07440b9f288c8" + "reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/2346085d2b027b233ae1d5de59b07440b9f288c8", - "reference": "2346085d2b027b233ae1d5de59b07440b9f288c8", + "url": "https://api.github.com/repos/doctrine/cache/zipball/c9eadeb743ac6199f7eec423cb9426bc518b7b03", + "reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03", "shasum": "" }, "require": { @@ -96,13 +96,13 @@ }, "require-dev": { "phpunit/phpunit": ">=3.7", - "predis/predis": "~0.8", + "predis/predis": "~1.0", "satooshi/php-coveralls": "~0.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -142,25 +142,28 @@ "cache", "caching" ], - "time": "2015-01-15 20:38:55" + "time": "2015-04-15 00:11:59" }, { "name": "doctrine/collections", - "version": "v1.2", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2" + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/b99c5c46c87126201899afe88ec490a25eedd6a2", - "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, "type": "library", "extra": { "branch-alias": { @@ -177,17 +180,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -196,11 +188,17 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, { "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "email": "schmittjoh@gmail.com" } ], "description": "Collections Abstraction library", @@ -210,20 +208,20 @@ "collections", "iterator" ], - "time": "2014-02-03 23:07:43" + "time": "2015-04-14 22:21:58" }, { "name": "doctrine/common", - "version": "v2.4.2", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b" + "reference": "cd8daf2501e10c63dced7b8b9b905844316ae9d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/5db6ab40e4c531f14dad4ca96a394dfce5d4255b", - "reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b", + "url": "https://api.github.com/repos/doctrine/common/zipball/cd8daf2501e10c63dced7b8b9b905844316ae9d3", + "reference": "cd8daf2501e10c63dced7b8b9b905844316ae9d3", "shasum": "" }, "require": { @@ -240,7 +238,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4.x-dev" + "dev-master": "2.6.x-dev" } }, "autoload": { @@ -253,17 +251,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -272,11 +259,17 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, { "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "email": "schmittjoh@gmail.com" } ], "description": "Common Library for Doctrine projects", @@ -288,7 +281,7 @@ "persistence", "spl" ], - "time": "2014-05-21 19:28:51" + "time": "2015-04-02 19:55:44" }, { "name": "doctrine/inflector", @@ -466,16 +459,16 @@ }, { "name": "guzzle/guzzle", - "version": "v3.9.2", + "version": "v3.9.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle3.git", - "reference": "54991459675c1a2924122afbb0e5609ade581155" + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/54991459675c1a2924122afbb0e5609ade581155", - "reference": "54991459675c1a2924122afbb0e5609ade581155", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", "shasum": "" }, "require": { @@ -516,6 +509,9 @@ "zendframework/zend-cache": "2.*,<2.3", "zendframework/zend-log": "2.*,<2.3" }, + "suggest": { + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + }, "type": "library", "extra": { "branch-alias": { @@ -543,7 +539,7 @@ "homepage": "https://github.com/guzzle/guzzle/contributors" } ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", "homepage": "http://guzzlephp.org/", "keywords": [ "client", @@ -554,21 +550,20 @@ "rest", "web service" ], - "time": "2014-08-11 04:32:36" + "time": "2015-03-18 18:23:50" }, { "name": "incenteev/composer-parameter-handler", - "version": "v2.1.0", - "target-dir": "Incenteev/ParameterHandler", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/Incenteev/ParameterHandler.git", - "reference": "143272a0a09c62616a3c8011fc165a10c6b35241" + "reference": "84a205fe80a46101607bafbc423019527893ddd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/143272a0a09c62616a3c8011fc165a10c6b35241", - "reference": "143272a0a09c62616a3c8011fc165a10c6b35241", + "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/84a205fe80a46101607bafbc423019527893ddd0", + "reference": "84a205fe80a46101607bafbc423019527893ddd0", "shasum": "" }, "require": { @@ -587,8 +582,8 @@ } }, "autoload": { - "psr-0": { - "Incenteev\\ParameterHandler": "" + "psr-4": { + "Incenteev\\ParameterHandler\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -606,20 +601,20 @@ "keywords": [ "parameters management" ], - "time": "2013-12-07 10:10:39" + "time": "2015-06-03 08:27:03" }, { "name": "knplabs/github-api", - "version": "1.4.1", + "version": "1.4.14", "source": { "type": "git", "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "c4fb5fe66df44efa83a7236c3e18dca557649217" + "reference": "9010dbe21f4b0bae0edae26bbe031d7d91347938" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/c4fb5fe66df44efa83a7236c3e18dca557649217", - "reference": "c4fb5fe66df44efa83a7236c3e18dca557649217", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/9010dbe21f4b0bae0edae26bbe031d7d91347938", + "reference": "9010dbe21f4b0bae0edae26bbe031d7d91347938", "shasum": "" }, "require": { @@ -636,12 +631,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { - "psr-0": { - "Github\\": "lib/" + "psr-4": { + "Github\\": "lib/Github/" } }, "notification-url": "https://packagist.org/downloads/", @@ -667,7 +662,7 @@ "gist", "github" ], - "time": "2014-12-22 23:59:03" + "time": "2015-07-03 14:59:20" }, { "name": "kriswallsmith/assetic", @@ -745,16 +740,16 @@ }, { "name": "monolog/monolog", - "version": "1.12.0", + "version": "1.15.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "1fbe8c2641f2b163addf49cc5e18f144bec6b19f" + "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1fbe8c2641f2b163addf49cc5e18f144bec6b19f", - "reference": "1fbe8c2641f2b163addf49cc5e18f144bec6b19f", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/dc5150cc608f2334c72c3b6a553ec9668a4156b0", + "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0", "shasum": "" }, "require": { @@ -765,12 +760,15 @@ "psr/log-implementation": "1.0.0" }, "require-dev": { - "aws/aws-sdk-php": "~2.4, >2.4.8", + "aws/aws-sdk-php": "^2.4.9", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", - "phpunit/phpunit": "~4.0", - "raven/raven": "~0.5", - "ruflin/elastica": "0.90.*", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "raven/raven": "~0.8", + "ruflin/elastica": ">=0.90 <3.0", + "swiftmailer/swiftmailer": "~5.3", "videlalvaro/php-amqplib": "~2.4" }, "suggest": { @@ -779,6 +777,7 @@ "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", "ext-mongo": "Allow sending log messages to a MongoDB server", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "php-console/php-console": "Allow sending log messages to Google Chrome", "raven/raven": "Allow sending log messages to a Sentry server", "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server", @@ -787,7 +786,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12.x-dev" + "dev-master": "1.15.x-dev" } }, "autoload": { @@ -813,7 +812,7 @@ "logging", "psr-3" ], - "time": "2014-12-29 21:29:35" + "time": "2015-07-12 13:54:09" }, { "name": "psr/log", @@ -859,51 +858,73 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "8919ab6093ca028bbf54167088b476cc39bf9d3b" + "reference": "4f1925fc351a2f058bb56117203a85c5da8852cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/8919ab6093ca028bbf54167088b476cc39bf9d3b", - "reference": "8919ab6093ca028bbf54167088b476cc39bf9d3b", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/4f1925fc351a2f058bb56117203a85c5da8852cc", + "reference": "4f1925fc351a2f058bb56117203a85c5da8852cc", "shasum": "" }, "conflict": { + "cakephp/cakephp": ">=2.0.0,<2.4.8|>=1.3.0,<1.3.18|>=3.0.0,<3.0.4|>=3.0.0,<3.0.6|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.99|>=2.3.0,<2.3.99|>=2.4.0,<2.4.99|>=2.5.0,<2.5.90|>=2.6.0,<2.6.6", + "contao/core": ">=2.11.0,<2.11.16|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.7|>=2.11.0,<2.11.17|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.9|>=2.11.0,<3.0.0|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.19|>=3.3.0,<3.4.0|>=3.4.0,<3.4.4", "doctrine/dbal": ">=2.0.0,<2.0.8|>=2.1.0,<2.1.2", "doctrine/doctrine-module": "<=0.7.1|<=0.7.1", "doctrine/orm": ">=2.0.0,<2.0.3", "dompdf/dompdf": ">=0.6.0,<0.6.1", + "firebase/php-jwt": "<2.0.0", "friendsofsymfony/rest-bundle": ">=1.2.0,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2.0,<1.2.1|>=1.2.0,<1.2.4|>=1.2.0,<1.3.0|>=1.3.0,<1.3.5|>=1.2.0,<1.2.5|>=1.3.0,<1.3.3", "illuminate/auth": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.26", "illuminate/database": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.29", "laravel/framework": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.26|>=4.0.0,<4.0.99|>=4.1.0,<4.1.29", "monolog/monolog": ">=1.8.0,<1.12.0", - "sabre/dav": ">=1.6.0,<1.6.9|>=1.7.0,<1.7.7|>=1.8.0,<1.8.5", + "namshi/jose": "<1.1.2|<2.0.3|<2.2.0", + "oro/crm": ">=1.7.0,<1.7.4", + "oro/platform": ">=1.7.0,<1.7.4", + "pusher/pusher-php-server": "<2.2.1", + "sabre/dav": ">=1.6.0,<1.6.9|>=1.7.0,<1.7.7|>=1.8.0,<1.8.5|>=1.6.0,<1.6.99|>=1.7.0,<1.7.11|>=1.8.0,<1.8.9", "socalnick/scn-social-auth": "<1.15.2", "swiftmailer/swiftmailer": ">=4.0.0,<4.99.99|>=5.0.0,<5.2.1", "symfony/dependency-injection": ">=2.0.0,<2.0.17", "symfony/framework-bundle": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.18|>=2.4.0,<2.4.8|>=2.5.0,<2.5.2", - "symfony/http-foundation": ">=2.0.0,<2.0.19|>=2.1.0,<2.1.4|>=2.0.0,<2.0.19|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4", - "symfony/http-kernel": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4", + "symfony/http-foundation": ">=2.0.0,<2.0.19|>=2.1.0,<2.1.4|>=2.0.0,<2.0.19|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.27|>=2.4.0,<2.5.0|>=2.5.0,<2.5.11|>=2.6.0,<2.6.6", + "symfony/http-kernel": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.27|>=2.4.0,<2.5.0|>=2.5.0,<2.5.11|>=2.6.0,<2.6.6|>=2.3.19,<2.3.29|>=2.4.9,<2.5.0|>=2.5.4,<2.5.12|>=2.6.0,<2.6.8", "symfony/routing": ">=2.0.0,<2.0.17|>=2.0.0,<2.0.19", "symfony/security": ">=2.0.0,<2.0.19|>=2.0.0,<2.0.25|>=2.1.0,<2.1.13|>=2.2.0,<2.2.9|>=2.3.0,<2.3.6", "symfony/serializer": ">=2.0.0,<2.0.11", - "symfony/symfony": ">=2.0.0,<2.0.6|>=2.0.0,<2.0.11|>=2.0.0,<2.0.17|>=2.0.0,<2.0.19|>=2.1.0,<2.1.4|>=2.0.0,<2.0.19|>=2.0.0,<2.0.20|>=2.1.0,<2.1.5|>=2.0.0,<2.0.22|>=2.0.0,<2.0.22|>=2.1.0,<2.1.7|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.0.25|>=2.1.0,<2.1.13|>=2.2.0,<2.2.9|>=2.3.0,<2.3.6|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4", + "symfony/symfony": ">=2.0.0,<2.0.6|>=2.0.0,<2.0.11|>=2.0.0,<2.0.17|>=2.0.0,<2.0.19|>=2.1.0,<2.1.4|>=2.0.0,<2.0.19|>=2.0.0,<2.0.20|>=2.1.0,<2.1.5|>=2.0.0,<2.0.22|>=2.0.0,<2.0.22|>=2.1.0,<2.1.7|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.0.25|>=2.1.0,<2.1.13|>=2.2.0,<2.2.9|>=2.3.0,<2.3.6|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.27|>=2.4.0,<2.5.0|>=2.5.0,<2.5.11|>=2.6.0,<2.6.6|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.27|>=2.4.0,<2.5.0|>=2.5.0,<2.5.11|>=2.6.0,<2.6.6|>=2.3.19,<2.3.29|>=2.4.9,<2.5.0|>=2.5.4,<2.5.12|>=2.6.0,<2.6.8", "symfony/translation": ">=2.0.0,<2.0.17", "symfony/validator": ">=2.0.0,<2.0.17|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3", "symfony/web-profiler-bundle": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4", "symfony/yaml": ">=2.0.0,<2.0.22|>=2.0.0,<2.0.22|>=2.1.0,<2.1.7", + "thelia/backoffice-default-template": ">=2.1.0,<2.1.2", + "thelia/thelia": ">=2.1.0,<2.1.2|>=2.1.0-beta1,<2.1.3", "twig/twig": ">=1.0.0,<1.12.3", + "typo3/flow": ">=1.0.0,<1.0.4|>=1.1.0,<1.1.1|>=2.0.0,<2.0.1", + "typo3/neos": ">=1.1.0,<1.1.3|>=1.2.0,<1.2.3", "willdurand/js-translation-bundle": "<2.1.1", "yiisoft/yii": ">=1.1.14,<1.1.15", + "yiisoft/yii2": "<2.0.4|<2.0.5", + "yiisoft/yii2-bootstrap": "<2.0.4", + "yiisoft/yii2-dev": "<2.0.4", + "yiisoft/yii2-gii": "<2.0.4", + "yiisoft/yii2-jui": "<2.0.4", + "zendframework/zend-db": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.10|>=2.3.0,<2.3.5", + "zendframework/zend-diactoros": ">=1.0.0,<1.0.4", "zendframework/zend-form": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1", + "zendframework/zend-http": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.3.0,<2.3.8|>=2.4.0,<2.4.1", "zendframework/zend-json": ">=2.1.0,<2.1.6|>=2.2.0,<2.2.6", + "zendframework/zend-ldap": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3", + "zendframework/zend-mail": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.3.0,<2.3.8|>=2.4.0,<2.4.1", "zendframework/zend-navigation": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1", "zendframework/zend-session": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.9|>=2.3.0,<2.3.4", + "zendframework/zend-validator": ">=2.3.0,<2.3.6", "zendframework/zend-view": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1", "zendframework/zend-xmlrpc": ">=2.1.0,<2.1.6|>=2.2.0,<2.2.6", - "zendframework/zendframework": ">=2.0.0,<2.0.1|>=2.0.0,<2.0.5|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.2.0,<2.2.5|>=2.1.0,<2.1.6|>=2.2.0,<2.2.6|>=2.0.0,<2.2.7|>=2.3.0,<2.3.1|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.9|>=2.3.0,<2.3.4", - "zendframework/zendframework1": ">=1.7.0,<1.7.5|>=1.7.0,<1.7.6|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.9.0,<1.9.8|>=1.10.0,<1.10.3|>=1.0.0,<1.11.4|>=1.10.0,<1.10.9|>=1.11.0,<1.11.6|>=1.0.0,<1.11.13|>=1.0.0,<1.11.13|>=1.11.0,<1.11.15|>=1.12.0,<1.12.1|>=1.12.0,<1.12.4|>=1.12.0,<1.12.4|>=1.12.0,<1.12.7|>=1.12.0,<1.12.9|>=1.12.0,<1.12.9", + "zendframework/zendframework": ">=2.0.0,<2.0.1|>=2.0.0,<2.0.5|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.2.0,<2.2.5|>=2.1.0,<2.1.6|>=2.2.0,<2.2.6|>=2.0.0,<2.2.7|>=2.3.0,<2.3.1|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.9|>=2.3.0,<2.3.4|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.10|>=2.3.0,<2.3.5|>=2.3.0,<2.3.6|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.3.0,<2.3.8|>=2.4.0,<2.4.1", + "zendframework/zendframework1": ">=1.7.0,<1.7.5|>=1.7.0,<1.7.6|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.9.0,<1.9.8|>=1.10.0,<1.10.3|>=1.0.0,<1.11.4|>=1.10.0,<1.10.9|>=1.11.0,<1.11.6|>=1.0.0,<1.11.13|>=1.0.0,<1.11.13|>=1.11.0,<1.11.15|>=1.12.0,<1.12.1|>=1.12.0,<1.12.4|>=1.12.0,<1.12.4|>=1.12.0,<1.12.7|>=1.12.0,<1.12.9|>=1.12.0,<1.12.9|>=1.12.0,<1.12.12", "zendframework/zendopenid": ">=2.0.0,<2.0.2", "zf-commons/zfc-user": "<1.2.2", "zfr/zfr-oauth2-server-module": "<0.1.2" @@ -921,33 +942,40 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2015-01-16 16:20:00" + "time": "2015-07-12 17:29:58" }, { "name": "sensio/distribution-bundle", - "version": "v3.0.15", + "version": "v3.0.30", "target-dir": "Sensio/Bundle/DistributionBundle", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", - "reference": "0692cd6a8fcf645abce8ea45f7cbbd1942e2b23c" + "reference": "f1758b30096202aeede61f79a1dffd69da091517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/0692cd6a8fcf645abce8ea45f7cbbd1942e2b23c", - "reference": "0692cd6a8fcf645abce8ea45f7cbbd1942e2b23c", + "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/f1758b30096202aeede61f79a1dffd69da091517", + "reference": "f1758b30096202aeede61f79a1dffd69da091517", "shasum": "" }, "require": { "php": ">=5.3.3", "sensiolabs/security-checker": "~2.0", "symfony/class-loader": "~2.2", - "symfony/form": "~2.2", "symfony/framework-bundle": "~2.3", - "symfony/process": "~2.2", + "symfony/process": "~2.2" + }, + "require-dev": { + "symfony/form": "~2.2", "symfony/validator": "~2.2", "symfony/yaml": "~2.2" }, + "suggest": { + "symfony/form": "If you want to use the configurator", + "symfony/validator": "If you want to use the configurator", + "symfony/yaml": "If you want to use the configurator" + }, "type": "symfony-bundle", "extra": { "branch-alias": { @@ -974,21 +1002,20 @@ "configuration", "distribution" ], - "time": "2015-01-07 07:13:43" + "time": "2015-06-05 22:32:22" }, { "name": "sensio/framework-extra-bundle", - "version": "v3.0.4", - "target-dir": "Sensio/Bundle/FrameworkExtraBundle", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", - "reference": "b3bc3e67c8b6b68b18d727012183520d35ee762a" + "reference": "0616fd568da051adc19ca63006cc808531ba2da4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/b3bc3e67c8b6b68b18d727012183520d35ee762a", - "reference": "b3bc3e67c8b6b68b18d727012183520d35ee762a", + "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/0616fd568da051adc19ca63006cc808531ba2da4", + "reference": "0616fd568da051adc19ca63006cc808531ba2da4", "shasum": "" }, "require": { @@ -1001,6 +1028,7 @@ }, "suggest": { "symfony/expression-language": "", + "symfony/psr-http-message-bridge": "To use the PSR-7 converters", "symfony/security-bundle": "" }, "type": "symfony-bundle", @@ -1010,8 +1038,8 @@ } }, "autoload": { - "psr-0": { - "Sensio\\Bundle\\FrameworkExtraBundle": "" + "psr-4": { + "Sensio\\Bundle\\FrameworkExtraBundle\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1029,20 +1057,20 @@ "annotations", "controllers" ], - "time": "2014-12-02 09:52:52" + "time": "2015-06-05 13:59:21" }, { "name": "sensiolabs/security-checker", - "version": "v2.0.0", + "version": "v2.0.5", "source": { "type": "git", "url": "https://github.com/sensiolabs/security-checker.git", - "reference": "5b4eb4743ebe68276c911c84101ecdf4a9ae76ee" + "reference": "2c2a71f1c77d9765c12638c4724d9ca23658a810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/5b4eb4743ebe68276c911c84101ecdf4a9ae76ee", - "reference": "5b4eb4743ebe68276c911c84101ecdf4a9ae76ee", + "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/2c2a71f1c77d9765c12638c4724d9ca23658a810", + "reference": "2c2a71f1c77d9765c12638c4724d9ca23658a810", "shasum": "" }, "require": { @@ -1074,32 +1102,32 @@ } ], "description": "A security checker for your composer.lock", - "time": "2014-07-19 10:52:35" + "time": "2015-05-28 14:22:40" }, { "name": "swiftmailer/swiftmailer", - "version": "v5.3.1", + "version": "v5.4.1", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "c5f963e7f9d6f6438fda4f22d5cc2db296ec621a" + "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/c5f963e7f9d6f6438fda4f22d5cc2db296ec621a", - "reference": "c5f963e7f9d6f6438fda4f22d5cc2db296ec621a", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1" + "mockery/mockery": "~0.9.1,<0.9.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -1123,39 +1151,41 @@ "description": "Swiftmailer, free feature-rich PHP mailer", "homepage": "http://swiftmailer.org", "keywords": [ + "email", "mail", "mailer" ], - "time": "2014-12-05 14:17:14" + "time": "2015-06-06 14:19:39" }, { "name": "symfony/assetic-bundle", - "version": "v2.5.0", + "version": "v2.6.1", "source": { "type": "git", "url": "https://github.com/symfony/AsseticBundle.git", - "reference": "90ea7fb66d6d5245fd4afc16e4c8070214254fec" + "reference": "422b0add2110f0cf9bc7a873a386ea053f4a89f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/AsseticBundle/zipball/90ea7fb66d6d5245fd4afc16e4c8070214254fec", - "reference": "90ea7fb66d6d5245fd4afc16e4c8070214254fec", + "url": "https://api.github.com/repos/symfony/AsseticBundle/zipball/422b0add2110f0cf9bc7a873a386ea053f4a89f0", + "reference": "422b0add2110f0cf9bc7a873a386ea053f4a89f0", "shasum": "" }, "require": { "kriswallsmith/assetic": "~1.2", "php": ">=5.3.0", - "symfony/console": "~2.1", - "symfony/framework-bundle": "~2.1", - "symfony/yaml": "~2.1" + "symfony/console": "~2.3", + "symfony/dependency-injection": "~2.3", + "symfony/framework-bundle": "~2.3", + "symfony/yaml": "~2.3" }, "require-dev": { "kriswallsmith/spork": "~0.2", "patchwork/jsqueeze": "~1.0", - "symfony/class-loader": "~2.1", - "symfony/css-selector": "~2.1", - "symfony/dom-crawler": "~2.1", - "symfony/twig-bundle": "~2.1" + "symfony/class-loader": "~2.3", + "symfony/css-selector": "~2.3", + "symfony/dom-crawler": "~2.3", + "symfony/twig-bundle": "~2.3" }, "suggest": { "kriswallsmith/spork": "to be able to dump assets in parallel", @@ -1190,7 +1220,7 @@ "compression", "minification" ], - "time": "2014-10-15 12:03:38" + "time": "2015-01-27 12:45:16" }, { "name": "symfony/monolog-bundle", @@ -1310,16 +1340,16 @@ }, { "name": "symfony/symfony", - "version": "v2.6.3", + "version": "v2.6.11", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "c34ef418015793a4653f2670afb69dd167ebf578" + "reference": "c6ab380a577e7bfb8db6e6f3105f470f97c83235" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/c34ef418015793a4653f2670afb69dd167ebf578", - "reference": "c34ef418015793a4653f2670afb69dd167ebf578", + "url": "https://api.github.com/repos/symfony/symfony/zipball/c6ab380a577e7bfb8db6e6f3105f470f97c83235", + "reference": "c6ab380a577e7bfb8db6e6f3105f470f97c83235", "shasum": "" }, "require": { @@ -1383,7 +1413,8 @@ "ircmaxell/password-compat": "~1.0", "monolog/monolog": "~1.11", "ocramius/proxy-manager": "~0.4|~1.0", - "propel/propel1": "~1.6" + "propel/propel1": "~1.6", + "symfony/phpunit-bridge": "~2.7" }, "type": "library", "extra": { @@ -1408,21 +1439,21 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "The Symfony PHP framework", - "homepage": "http://symfony.com", + "homepage": "https://symfony.com", "keywords": [ "framework" ], - "time": "2015-01-07 14:47:29" + "time": "2015-07-26 10:44:22" }, { "name": "twig/extensions", @@ -1478,25 +1509,25 @@ }, { "name": "twig/twig", - "version": "v1.17.0", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "2493970fa4d587eca73f77e6d8bd48a8bdd4c608" + "reference": "edbeaf43b0a606cdaadc32a11d2673614a377b90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/2493970fa4d587eca73f77e6d8bd48a8bdd4c608", - "reference": "2493970fa4d587eca73f77e6d8bd48a8bdd4c608", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/edbeaf43b0a606cdaadc32a11d2673614a377b90", + "reference": "edbeaf43b0a606cdaadc32a11d2673614a377b90", "shasum": "" }, "require": { - "php": ">=5.2.4" + "php": ">=5.2.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.19-dev" } }, "autoload": { @@ -1531,22 +1562,22 @@ "keywords": [ "templating" ], - "time": "2015-01-14 10:15:49" + "time": "2015-07-31 13:45:26" } ], "packages-dev": [ { "name": "behat/behat", - "version": "v3.0.14", + "version": "v3.0.15", "source": { "type": "git", "url": "https://github.com/Behat/Behat.git", - "reference": "3f097cd577feed73e681fa56cd4e4e1dda9c115d" + "reference": "b35ae3d45332d80c532af69cc36f780a9397a996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/3f097cd577feed73e681fa56cd4e4e1dda9c115d", - "reference": "3f097cd577feed73e681fa56cd4e4e1dda9c115d", + "url": "https://api.github.com/repos/Behat/Behat/zipball/b35ae3d45332d80c532af69cc36f780a9397a996", + "reference": "b35ae3d45332d80c532af69cc36f780a9397a996", "shasum": "" }, "require": { @@ -1559,12 +1590,12 @@ "symfony/console": "~2.1", "symfony/dependency-injection": "~2.1", "symfony/event-dispatcher": "~2.1", - "symfony/translation": "~2.1", + "symfony/translation": "~2.3", "symfony/yaml": "~2.1" }, "require-dev": { "phpspec/prophecy-phpunit": "~1.0", - "phpunit/phpunit": "~4.0.7", + "phpunit/phpunit": "~4.0", "symfony/process": "~2.1" }, "suggest": { @@ -1614,7 +1645,7 @@ "symfony", "testing" ], - "time": "2014-09-23 10:47:14" + "time": "2015-02-22 14:10:33" }, { "name": "behat/gherkin", @@ -1676,16 +1707,16 @@ }, { "name": "behat/mink", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", - "url": "https://github.com/Behat/Mink.git", - "reference": "090900a0049c441f1e072bbd837db4079b2250c5" + "url": "https://github.com/minkphp/Mink.git", + "reference": "8b68523a339ec991bcd638b39dc8f04f808da88a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Mink/zipball/090900a0049c441f1e072bbd837db4079b2250c5", - "reference": "090900a0049c441f1e072bbd837db4079b2250c5", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/8b68523a339ec991bcd638b39dc8f04f808da88a", + "reference": "8b68523a339ec991bcd638b39dc8f04f808da88a", "shasum": "" }, "require": { @@ -1705,8 +1736,8 @@ } }, "autoload": { - "psr-0": { - "Behat\\Mink": "src/" + "psr-4": { + "Behat\\Mink\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1720,26 +1751,26 @@ "homepage": "http://everzet.com" } ], - "description": "Web acceptance testing framework for PHP 5.3", + "description": "Browser controller/emulator abstraction for PHP", "homepage": "http://mink.behat.org/", "keywords": [ "browser", "testing", "web" ], - "time": "2014-09-26 09:25:05" + "time": "2015-02-04 17:02:06" }, { "name": "behat/mink-browserkit-driver", "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/Behat/MinkBrowserKitDriver.git", + "url": "https://github.com/minkphp/MinkBrowserKitDriver.git", "reference": "aed8f4a596b79014a75254c3e337511c33e38cbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/MinkBrowserKitDriver/zipball/aed8f4a596b79014a75254c3e337511c33e38cbd", + "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/aed8f4a596b79014a75254c3e337511c33e38cbd", "reference": "aed8f4a596b79014a75254c3e337511c33e38cbd", "shasum": "" }, @@ -1945,16 +1976,16 @@ }, { "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": { @@ -1965,7 +1996,7 @@ "ext-pdo": "*", "ext-phar": "*", "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { @@ -1974,8 +2005,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1995,31 +2026,31 @@ "constructor", "instantiate" ], - "time": "2014-10-13 12:58:55" + "time": "2015-06-14 21:17:01" }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "38743b677965c48a637097b2746a281264ae2347" + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/38743b677965c48a637097b2746a281264ae2347", - "reference": "38743b677965c48a637097b2746a281264ae2347", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "3.7.*@stable" + "phpunit/phpunit": "~4.0" }, "suggest": { - "dflydev/markdown": "1.0.*", - "erusev/parsedown": "~0.7" + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" }, "type": "library", "extra": { @@ -2044,7 +2075,7 @@ "email": "mike.vanriel@naenius.com" } ], - "time": "2014-08-09 10:27:07" + "time": "2015-02-03 12:10:50" }, { "name": "phpspec/php-diff", @@ -2158,21 +2189,22 @@ }, { "name": "phpspec/prophecy", - "version": "v1.3.1", + "version": "v1.4.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9" + "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/9ca52329bcdd1500de24427542577ebf3fc2f1c9", - "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", - "phpdocumentor/reflection-docblock": "~2.0" + "doctrine/instantiator": "^1.0.2", + "phpdocumentor/reflection-docblock": "~2.0", + "sebastian/comparator": "~1.1" }, "require-dev": { "phpspec/phpspec": "~2.0" @@ -2180,7 +2212,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -2204,7 +2236,7 @@ } ], "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "http://phpspec.org", + "homepage": "https://github.com/phpspec/prophecy", "keywords": [ "Double", "Dummy", @@ -2213,20 +2245,20 @@ "spy", "stub" ], - "time": "2014-11-17 16:23:49" + "time": "2015-04-27 22:15:08" }, { "name": "phpunit/php-code-coverage", - "version": "2.0.14", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca158276c1200cc27f5409a5e338486bc0b4fc94" + "reference": "e6577d90f61a9adbe94544a6e9a7ca18b5fd9c8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca158276c1200cc27f5409a5e338486bc0b4fc94", - "reference": "ca158276c1200cc27f5409a5e338486bc0b4fc94", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e6577d90f61a9adbe94544a6e9a7ca18b5fd9c8f", + "reference": "e6577d90f61a9adbe94544a6e9a7ca18b5fd9c8f", "shasum": "" }, "require": { @@ -2234,12 +2266,12 @@ "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", + "sebastian/environment": "~1.3", "sebastian/version": "~1.0" }, "require-dev": { "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4" }, "suggest": { "ext-dom": "*", @@ -2249,7 +2281,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { @@ -2258,9 +2290,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -2278,7 +2307,7 @@ "testing", "xunit" ], - "time": "2014-12-26 13:28:33" + "time": "2015-08-01 05:09:57" }, { "name": "phpunit/php-file-iterator", @@ -2327,16 +2356,16 @@ }, { "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": { @@ -2345,20 +2374,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" } ], @@ -2367,20 +2393,20 @@ "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.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" }, "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/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", "shasum": "" }, "require": { @@ -2389,13 +2415,10 @@ "type": "library", "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -2411,20 +2434,20 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2015-06-21 08:01:12" }, { "name": "phpunit/php-token-stream", - "version": "1.4.0", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74" + "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db32c18eba00b121c145575fcbcd4d4d24e6db74", - "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", + "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", "shasum": "" }, "require": { @@ -2460,7 +2483,7 @@ "keywords": [ "tokenizer" ], - "time": "2015-01-17 09:51:32" + "time": "2015-06-19 03:43:16" }, { "name": "phpunit/phpunit", @@ -2538,25 +2561,26 @@ }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.0", + "version": "2.3.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "c63d2367247365f688544f0d500af90a11a44c65" + "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", - "reference": "c63d2367247365f688544f0d500af90a11a44c65", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42", + "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.1", + "doctrine/instantiator": "~1.0,>=1.0.2", "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "phpunit/phpunit": "~4.3" + "phpunit/phpunit": "~4.4" }, "suggest": { "ext-soap": "*" @@ -2589,34 +2613,34 @@ "mock", "xunit" ], - "time": "2014-10-03 05:12:11" + "time": "2015-07-10 06:54:24" }, { "name": "sebastian/comparator", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "c484a80f97573ab934e37826dba0135a3301b26a" + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/c484a80f97573ab934e37826dba0135a3301b26a", - "reference": "c484a80f97573ab934e37826dba0135a3301b26a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/diff": "~1.1", - "sebastian/exporter": "~1.0" + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -2653,20 +2677,20 @@ "compare", "equality" ], - "time": "2014-11-16 21:32:38" + "time": "2015-07-26 15:48:44" }, { "name": "sebastian/diff", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", "shasum": "" }, "require": { @@ -2678,7 +2702,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2705,32 +2729,32 @@ "keywords": [ "diff" ], - "time": "2014-08-15 10:29:00" + "time": "2015-02-22 15:13:53" }, { "name": "sebastian/environment", - "version": "1.2.1", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" + "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", + "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.3" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -2755,32 +2779,33 @@ "environment", "hhvm" ], - "time": "2014-10-25 08:00:45" + "time": "2015-07-26 06:42:57" }, { "name": "sebastian/exporter", - "version": "1.0.2", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", - "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -2820,20 +2845,73 @@ "export", "exporter" ], - "time": "2014-09-10 00:51:36" + "time": "2015-06-21 07:55:53" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "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": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-06-21 08:04:50" }, { "name": "sebastian/version", - "version": "1.0.4", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b" + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a77d9123f8e809db3fbdea15038c27a95da4058b", - "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, "type": "library", @@ -2855,21 +2933,21 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2014-12-15 14:25:24" + "time": "2015-06-21 13:59:46" }, { "name": "sensio/generator-bundle", - "version": "v2.5.1", + "version": "v2.5.3", "target-dir": "Sensio/Bundle/GeneratorBundle", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git", - "reference": "9e23fc3de265ae013690d84aab98e7a84f46edcd" + "reference": "e50108c2133ee5c9c484555faed50c17a61221d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/9e23fc3de265ae013690d84aab98e7a84f46edcd", - "reference": "9e23fc3de265ae013690d84aab98e7a84f46edcd", + "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/e50108c2133ee5c9c484555faed50c17a61221d3", + "reference": "e50108c2133ee5c9c484555faed50c17a61221d3", "shasum": "" }, "require": { @@ -2903,7 +2981,7 @@ } ], "description": "This bundle generates code for you", - "time": "2015-01-13 07:33:46" + "time": "2015-03-17 06:36:52" } ], "aliases": [], From 39c8c048aeecf347c0135fdabe53ad4339546331 Mon Sep 17 00:00:00 2001 From: everzet Date: Sat, 1 Aug 2015 13:23:41 +0100 Subject: [PATCH 42/59] Add navigation link for Extensions page --- app/Resources/views/layout.html.twig | 3 +++ app/config/routing.yml | 2 ++ .../Symfony/Extension/Controller/ExtensionController.php | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Resources/views/layout.html.twig b/app/Resources/views/layout.html.twig index 6a4c587..d24bb27 100644 --- a/app/Resources/views/layout.html.twig +++ b/app/Resources/views/layout.html.twig @@ -20,6 +20,9 @@ Documentation + + Extensions + Fork us diff --git a/app/config/routing.yml b/app/config/routing.yml index b4b4261..e545175 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -9,6 +9,8 @@ extension: resource: "@ExtensionBundle/Controller/" type: annotation prefix: /extensions + defaults: + section: 'extension' documentation: resource: '@DocumentationBundle/Controller/' diff --git a/src/Integration/Symfony/Extension/Controller/ExtensionController.php b/src/Integration/Symfony/Extension/Controller/ExtensionController.php index bf5289a..7edfdab 100644 --- a/src/Integration/Symfony/Extension/Controller/ExtensionController.php +++ b/src/Integration/Symfony/Extension/Controller/ExtensionController.php @@ -10,7 +10,7 @@ class ExtensionController extends Controller { /** - * @Route("/") + * @Route("/", name="extension_list") * @Template() */ public function listAction() From ecc605233928c0d0b74e28a35fbc64f195178364 Mon Sep 17 00:00:00 2001 From: everzet Date: Sat, 1 Aug 2015 13:24:40 +0100 Subject: [PATCH 43/59] Move extension list template to the bundle root --- .../Symfony/Extension/Controller/ExtensionController.php | 2 +- .../Extension/Resources/views/{Extension => }/list.html.twig | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/Integration/Symfony/Extension/Resources/views/{Extension => }/list.html.twig (100%) diff --git a/src/Integration/Symfony/Extension/Controller/ExtensionController.php b/src/Integration/Symfony/Extension/Controller/ExtensionController.php index 7edfdab..1dbba45 100644 --- a/src/Integration/Symfony/Extension/Controller/ExtensionController.php +++ b/src/Integration/Symfony/Extension/Controller/ExtensionController.php @@ -11,7 +11,7 @@ class ExtensionController extends Controller { /** * @Route("/", name="extension_list") - * @Template() + * @Template("ExtensionBundle::list.html.twig") */ public function listAction() { diff --git a/src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig b/src/Integration/Symfony/Extension/Resources/views/list.html.twig similarity index 100% rename from src/Integration/Symfony/Extension/Resources/views/Extension/list.html.twig rename to src/Integration/Symfony/Extension/Resources/views/list.html.twig From 184e947a6e1a2236982ad33b819ef631dd7325cb Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 2 Aug 2015 11:12:09 +0100 Subject: [PATCH 44/59] Style the extensions list page --- .../Extension/Resources/views/list.html.twig | 16 ++-- web/css/extensions.css | 75 +++++++++++++++++++ 2 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 web/css/extensions.css diff --git a/src/Integration/Symfony/Extension/Resources/views/list.html.twig b/src/Integration/Symfony/Extension/Resources/views/list.html.twig index ed63a3d..3c77181 100644 --- a/src/Integration/Symfony/Extension/Resources/views/list.html.twig +++ b/src/Integration/Symfony/Extension/Resources/views/list.html.twig @@ -1,19 +1,25 @@ {% extends '::layout.html.twig' %} {% block stylesheets %} + {% endblock %} + {% block page %}

Extensions

+ +

Behat is very extensible. Almost every bit of the framework + functionality could be enhanced or even replaced through the powerful + extension system. Here is the list of awesome extensions you might be + interested in:

+ {% for extension in extensions %} - +

{{ extension.description }}

+
{% endfor %}
{% endblock %} diff --git a/web/css/extensions.css b/web/css/extensions.css new file mode 100644 index 0000000..78d2d5c --- /dev/null +++ b/web/css/extensions.css @@ -0,0 +1,75 @@ +section.extensions { + margin: 0px 20px; +} + +section.extensions h1 { + font-family: 'Comfortaa'; + text-transform: lowercase; + color: #000; + font-weight: normal; + font-size: 3.6rem; + margin: 24px 0px 24px; +} + +section.extensions > p { + margin-bottom: 30px; + font-size: 1.6rem; + color: #4f4f4f; + line-height: 2.4rem; +} + +section.extensions .extension { + display: block; + width: 780px; + margin-bottom: 20px; +} + +section.extensions .extension:hover { + background: #f1f1f1; +} + +section.extensions .extension h2 { + display: block; + position: relative; + float: left; + max-width: 400px; + margin-top: 10px; + padding: 3px 10px; + background-color: rgb(192, 192, 192); + font-size: 2.4rem; + line-height: 1.38; + color: rgb(80, 80, 80); +} + +section.extensions .extension .by { + display: block; + position: relative; + float: left; + margin: 21px 0 0 10px; + font: italic 1.4rem Georgia; + color: rgb(161, 159, 159); +} + +section.extensions .extension .author { + display: block; + position: relative; + float: left; + max-width: 260px; + margin: 18px 0 0 7px; + font-size: 1.8rem; + line-height: 1.38; + color: rgb(171, 170, 170); +} + +section.extensions .extension p { + display: block; + width: 100%; + margin: 60px auto 0; + padding-right: 10px; + padding-bottom: 10px; + padding-left: 10px; + font-size: 1.4rem; + font-weight: 400; + line-height: 1.38; + color: rgb(80, 80, 80); +} From b9d0a9e0d228347c963faa51e110f69b492a42d8 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 2 Aug 2015 11:14:34 +0100 Subject: [PATCH 45/59] Properly trim the long extension names w/ CSS --- web/css/extensions.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/css/extensions.css b/web/css/extensions.css index 78d2d5c..e5fc546 100644 --- a/web/css/extensions.css +++ b/web/css/extensions.css @@ -32,13 +32,14 @@ section.extensions .extension h2 { display: block; position: relative; float: left; - max-width: 400px; + max-width: 450px; margin-top: 10px; padding: 3px 10px; background-color: rgb(192, 192, 192); font-size: 2.4rem; line-height: 1.38; color: rgb(80, 80, 80); + overflow: hidden; } section.extensions .extension .by { @@ -58,6 +59,7 @@ section.extensions .extension .author { margin: 18px 0 0 7px; font-size: 1.8rem; line-height: 1.38; + overflow: hidden; color: rgb(171, 170, 170); } From 70eef802aaaa027de835b050a329a9a0a41377e1 Mon Sep 17 00:00:00 2001 From: everzet Date: Sun, 2 Aug 2015 11:18:21 +0100 Subject: [PATCH 46/59] Add page title to the extensions page --- .../Symfony/Extension/Resources/views/list.html.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Integration/Symfony/Extension/Resources/views/list.html.twig b/src/Integration/Symfony/Extension/Resources/views/list.html.twig index 3c77181..1c01765 100644 --- a/src/Integration/Symfony/Extension/Resources/views/list.html.twig +++ b/src/Integration/Symfony/Extension/Resources/views/list.html.twig @@ -1,5 +1,7 @@ {% extends '::layout.html.twig' %} +{% block title %}Behat Extensions{% endblock %} + {% block stylesheets %} {% endblock %} From c2dfe0e300078606c71cbfeea0d155f269a90d4a Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 3 Aug 2015 08:09:41 +0100 Subject: [PATCH 47/59] Move all artifacts under build/ folder --- .gitignore | 10 ++-------- build/{docs => }/.gitkeep | 0 build/repositories/.gitkeep | 0 docs/.gitkeep | 0 extensions/.gitkeep | 0 .../Documentation/Resources/config/services.xml | 2 +- .../Symfony/Extension/Resources/config/services.xml | 2 +- 7 files changed, 4 insertions(+), 10 deletions(-) rename build/{docs => }/.gitkeep (100%) delete mode 100644 build/repositories/.gitkeep delete mode 100644 docs/.gitkeep delete mode 100644 extensions/.gitkeep diff --git a/.gitignore b/.gitignore index 7823183..3a2c6b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,11 @@ vendor/ web/bundles/ -extensions/* -docs/* app/cache/* app/logs/* -build/repositories/* -build/docs/* +build/* !app/cache/.gitkeep !app/logs/.gitkeep -!extensions/.gitkeep -!build/repositories/.gitkeep -!build/docs/.gitkeep -!docs/.gitkeep +!build/.gitkeep app/bootstrap.php.cache app/config/parameters.yml phpunit.xml diff --git a/build/docs/.gitkeep b/build/.gitkeep similarity index 100% rename from build/docs/.gitkeep rename to build/.gitkeep diff --git a/build/repositories/.gitkeep b/build/repositories/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/docs/.gitkeep b/docs/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/extensions/.gitkeep b/extensions/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/Integration/Symfony/Documentation/Resources/config/services.xml b/src/Integration/Symfony/Documentation/Resources/config/services.xml index 201f994..8dce340 100644 --- a/src/Integration/Symfony/Documentation/Resources/config/services.xml +++ b/src/Integration/Symfony/Documentation/Resources/config/services.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - %kernel.root_dir%/../docs + %kernel.root_dir%/../build/published_docs %kernel.root_dir%/../build/docs diff --git a/src/Integration/Symfony/Extension/Resources/config/services.xml b/src/Integration/Symfony/Extension/Resources/config/services.xml index 10ab748..54009fd 100644 --- a/src/Integration/Symfony/Extension/Resources/config/services.xml +++ b/src/Integration/Symfony/Extension/Resources/config/services.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - %kernel.root_dir%/../extensions + %kernel.root_dir%/../build/extensions From f5887a9d835c18ff69cc386ca865819cd31b2cf1 Mon Sep 17 00:00:00 2001 From: everzet Date: Mon, 3 Aug 2015 20:23:04 +0100 Subject: [PATCH 48/59] Properly handle invalid composer authors sections --- .../Composer/ComposerExtractorSpec.php | 6 +- .../Release/Composer/AuthorSpec.php | 53 ++++++++++++++ .../Release/Composer/ComposerPackageSpec.php | 9 +-- .../Exception/AuthorNameIsNotDefinedSpec.php | 21 ++++++ .../Extension/Composer/ComposerExtractor.php | 2 +- src/Integration/Release/Composer/Author.php | 71 +++++++++++++++++++ .../Release/Composer/ComposerPackage.php | 36 ++++++++-- .../Exception/AuthorNameIsNotDefined.php | 10 +++ 8 files changed, 196 insertions(+), 12 deletions(-) create mode 100644 spec/Integration/Release/Composer/AuthorSpec.php create mode 100644 spec/Integration/Release/Composer/Exception/AuthorNameIsNotDefinedSpec.php create mode 100644 src/Integration/Release/Composer/Author.php create mode 100644 src/Integration/Release/Composer/Exception/AuthorNameIsNotDefined.php diff --git a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php index b2e8c7e..7acae99 100644 --- a/spec/Integration/Extension/Composer/ComposerExtractorSpec.php +++ b/spec/Integration/Extension/Composer/ComposerExtractorSpec.php @@ -35,11 +35,15 @@ function it_extracts_extension_if_provided_composer_package_is_of_type_behat_ext { $package = new ComposerPackage([ 'name' => 'behat/symfony2-extension', - 'type' => 'behat-extension' + 'type' => 'behat-extension', + 'authors' => [ + ['name' => 'everzet'] + ] ]); $extension = $this->extract($package); $extension->shouldHaveType(Extension::class); $extension->name()->shouldReturn('symfony2-extension'); + $extension->author()->shouldReturn('everzet'); } } diff --git a/spec/Integration/Release/Composer/AuthorSpec.php b/spec/Integration/Release/Composer/AuthorSpec.php new file mode 100644 index 0000000..47edc41 --- /dev/null +++ b/spec/Integration/Release/Composer/AuthorSpec.php @@ -0,0 +1,53 @@ +beConstructedWith('everzet', 'ever.zet@gmail.com'); + } + + function it_has_a_name() + { + $this->name()->shouldReturn('everzet'); + } + + function it_has_an_email() + { + $this->email()->shouldReturn('ever.zet@gmail.com'); + } + + function its_email_is_optional() + { + $this->beConstructedWith('everzet'); + + $this->email()->shouldBe(null); + } + + function it_can_be_constructed_from_array() + { + $withEmail = $this->fromArray(['name' => 'everzet', 'email' => 'ever.zet@gmail.com']); + $withEmail->name()->shouldReturn('everzet'); + $withEmail->email()->shouldReturn('ever.zet@gmail.com'); + + $justAName = $this->fromArray(['name' => 'everzet']); + $justAName->name()->shouldReturn('everzet'); + $justAName->email()->shouldBe(null); + } + + function it_can_not_be_constructed_from_empty_array() + { + $this->shouldThrow(InvalidArgumentException::class)->duringFromArray([]); + } + + function it_can_not_be_constructed_from_array_without_name() + { + $this->shouldThrow(InvalidArgumentException::class)->duringFromArray(['email' => 'ever.zet@gmail.com']); + } +} diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index e860d7d..2d8feed 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -2,6 +2,7 @@ namespace spec\Behat\Borg\Integration\Release\Composer; +use Behat\Borg\Integration\Release\Composer\Author; use Behat\Borg\Release\Package; use PhpSpec\ObjectBehavior; use Prophecy\Argument; @@ -68,17 +69,17 @@ function it_has_a_description() function it_has_authors() { - $this->authors()->shouldReturn( + $this->authors()->shouldBeLike( [ - ['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com'], - ['name' => 'Christophe Coevoet', 'email' => 'stof@notk.org'] + new Author('Konstantin Kudryashov', 'ever.zet@gmail.com'), + new Author('Christophe Coevoet', 'stof@notk.org'), ] ); } function its_primary_author_is_the_first_one() { - $this->primaryAuthor()->shouldReturn(['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com']); + $this->primaryAuthor()->shouldBeLike(new Author('Konstantin Kudryashov', 'ever.zet@gmail.com')); } function its_primary_author_is_null_if_none_authors_found() diff --git a/spec/Integration/Release/Composer/Exception/AuthorNameIsNotDefinedSpec.php b/spec/Integration/Release/Composer/Exception/AuthorNameIsNotDefinedSpec.php new file mode 100644 index 0000000..e1237b7 --- /dev/null +++ b/spec/Integration/Release/Composer/Exception/AuthorNameIsNotDefinedSpec.php @@ -0,0 +1,21 @@ +shouldHaveType(InvalidArgumentException::class); + } + + function it_is_also_a_ReleaseException() + { + $this->shouldHaveType(ReleaseException::class); + } +} diff --git a/src/Integration/Extension/Composer/ComposerExtractor.php b/src/Integration/Extension/Composer/ComposerExtractor.php index 87e1b53..690799b 100644 --- a/src/Integration/Extension/Composer/ComposerExtractor.php +++ b/src/Integration/Extension/Composer/ComposerExtractor.php @@ -41,6 +41,6 @@ private function primaryAuthorName(ComposerPackage $package) return 'Anonymous'; } - return $package->primaryAuthor()['name']; + return $package->primaryAuthor()->name(); } } diff --git a/src/Integration/Release/Composer/Author.php b/src/Integration/Release/Composer/Author.php new file mode 100644 index 0000000..02a373a --- /dev/null +++ b/src/Integration/Release/Composer/Author.php @@ -0,0 +1,71 @@ +name = $name; + $this->email = $email; + } + + /** + * @return string + */ + public function name() + { + return $this->name; + } + + /** + * @return null|string + */ + public function email() + { + return $this->email; + } +} diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index b4fef6f..3c78e16 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -43,9 +43,9 @@ public function __construct(array $data) } $this->name = strtolower($name); - $this->type = $data['type']; - $this->description = isset($data['description']) ? $data['description'] : null; - $this->authors = isset($data['authors']) ? $data['authors'] : []; + $this->type = $this->extractType($data); + $this->description = $this->extractDescription($data); + $this->authors = $this->extractAuthors($data); } /** @@ -87,17 +87,17 @@ public function description() /** * Hash of the primary package author or null if no authors defined. * - * @return array|null + * @return Author|null */ public function primaryAuthor() { - return count($this->authors) ? $this->authors[0] : null; + return count($this->authors) ? current($this->authors) : null; } /** * Returns package authors. * - * @return array + * @return Author[] */ public function authors() { @@ -111,4 +111,28 @@ public function __toString() { return $this->name; } + + private function extractType(array $data) + { + return $data['type']; + } + + private function extractDescription(array $data) + { + return isset($data['description']) ? $data['description'] : null; + } + + private function extractAuthors(array $data) + { + if (!isset($data['authors'])) { + return []; + } + + return array_map([$this, 'extractAuthor'], $data['authors']); + } + + private function extractAuthor(array $author) + { + return Author::fromArray($author); + } } diff --git a/src/Integration/Release/Composer/Exception/AuthorNameIsNotDefined.php b/src/Integration/Release/Composer/Exception/AuthorNameIsNotDefined.php new file mode 100644 index 0000000..04ab780 --- /dev/null +++ b/src/Integration/Release/Composer/Exception/AuthorNameIsNotDefined.php @@ -0,0 +1,10 @@ + Date: Mon, 3 Aug 2015 20:26:22 +0100 Subject: [PATCH 49/59] Properly handle cases where package type is not provided --- .../Release/Composer/ComposerPackageSpec.php | 15 +++++++++++++-- .../Release/Composer/ComposerPackage.php | 4 +++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index 2d8feed..0458d97 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -14,7 +14,6 @@ function let() $this->beConstructedWith( [ 'name' => 'behat/docs', - 'type' => 'library', 'description' => 'behat documentation', 'authors' => [ ['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com'], @@ -57,11 +56,23 @@ function its_name_is_a_second_segment_of_the_composer_package_name() $this->name()->shouldReturn('docs'); } - function it_has_type() + function its_default_type_is_library() { $this->type()->shouldReturn('library'); } + function it_has_a_different_type_if_provided() + { + $this->beConstructedWith( + [ + 'name' => 'behat/docs', + 'type' => 'whatever' + ] + ); + + $this->type()->shouldReturn('whatever'); + } + function it_has_a_description() { $this->description()->shouldReturn('behat documentation'); diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index 3c78e16..854baa2 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -10,6 +10,8 @@ */ final class ComposerPackage implements Package { + const DEFAULT_TYPE = 'library'; + /** * @var string */ @@ -114,7 +116,7 @@ public function __toString() private function extractType(array $data) { - return $data['type']; + return isset($data['type']) ? $data['type'] : self::DEFAULT_TYPE; } private function extractDescription(array $data) From 7ae0028ff62a1401479627300fceaeb9366e73e2 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 4 Aug 2015 08:22:37 +0100 Subject: [PATCH 50/59] Rename and simplify ComposerAuthor --- ...{AuthorSpec.php => ComposerAuthorSpec.php} | 21 +++--------- .../Release/Composer/ComposerPackageSpec.php | 8 ++--- .../{Author.php => ComposerAuthor.php} | 32 +++++-------------- .../Release/Composer/ComposerPackage.php | 8 ++--- 4 files changed, 21 insertions(+), 48 deletions(-) rename spec/Integration/Release/Composer/{AuthorSpec.php => ComposerAuthorSpec.php} (53%) rename src/Integration/Release/Composer/{Author.php => ComposerAuthor.php} (50%) diff --git a/spec/Integration/Release/Composer/AuthorSpec.php b/spec/Integration/Release/Composer/ComposerAuthorSpec.php similarity index 53% rename from spec/Integration/Release/Composer/AuthorSpec.php rename to spec/Integration/Release/Composer/ComposerAuthorSpec.php index 47edc41..cd24527 100644 --- a/spec/Integration/Release/Composer/AuthorSpec.php +++ b/spec/Integration/Release/Composer/ComposerAuthorSpec.php @@ -6,11 +6,11 @@ use PhpSpec\ObjectBehavior; use Prophecy\Argument; -class AuthorSpec extends ObjectBehavior +class ComposerAuthorSpec extends ObjectBehavior { function let() { - $this->beConstructedWith('everzet', 'ever.zet@gmail.com'); + $this->beConstructedWith(['name' => 'everzet', 'email' => 'ever.zet@gmail.com']); } function it_has_a_name() @@ -25,29 +25,18 @@ function it_has_an_email() function its_email_is_optional() { - $this->beConstructedWith('everzet'); + $this->beConstructedWith(['name' => 'everzet']); $this->email()->shouldBe(null); } - function it_can_be_constructed_from_array() - { - $withEmail = $this->fromArray(['name' => 'everzet', 'email' => 'ever.zet@gmail.com']); - $withEmail->name()->shouldReturn('everzet'); - $withEmail->email()->shouldReturn('ever.zet@gmail.com'); - - $justAName = $this->fromArray(['name' => 'everzet']); - $justAName->name()->shouldReturn('everzet'); - $justAName->email()->shouldBe(null); - } - function it_can_not_be_constructed_from_empty_array() { - $this->shouldThrow(InvalidArgumentException::class)->duringFromArray([]); + $this->shouldThrow(InvalidArgumentException::class)->during('__construct', [[]]); } function it_can_not_be_constructed_from_array_without_name() { - $this->shouldThrow(InvalidArgumentException::class)->duringFromArray(['email' => 'ever.zet@gmail.com']); + $this->shouldThrow(InvalidArgumentException::class)->during('__construct', [['email' => 'ever.zet@gmail.com']]); } } diff --git a/spec/Integration/Release/Composer/ComposerPackageSpec.php b/spec/Integration/Release/Composer/ComposerPackageSpec.php index 0458d97..79d6a63 100644 --- a/spec/Integration/Release/Composer/ComposerPackageSpec.php +++ b/spec/Integration/Release/Composer/ComposerPackageSpec.php @@ -2,7 +2,7 @@ namespace spec\Behat\Borg\Integration\Release\Composer; -use Behat\Borg\Integration\Release\Composer\Author; +use Behat\Borg\Integration\Release\Composer\ComposerAuthor; use Behat\Borg\Release\Package; use PhpSpec\ObjectBehavior; use Prophecy\Argument; @@ -82,15 +82,15 @@ function it_has_authors() { $this->authors()->shouldBeLike( [ - new Author('Konstantin Kudryashov', 'ever.zet@gmail.com'), - new Author('Christophe Coevoet', 'stof@notk.org'), + new ComposerAuthor(['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com']), + new ComposerAuthor(['name' => 'Christophe Coevoet', 'email' => 'stof@notk.org']), ] ); } function its_primary_author_is_the_first_one() { - $this->primaryAuthor()->shouldBeLike(new Author('Konstantin Kudryashov', 'ever.zet@gmail.com')); + $this->primaryAuthor()->shouldBeLike(new ComposerAuthor(['name' => 'Konstantin Kudryashov', 'email' => 'ever.zet@gmail.com'])); } function its_primary_author_is_null_if_none_authors_found() diff --git a/src/Integration/Release/Composer/Author.php b/src/Integration/Release/Composer/ComposerAuthor.php similarity index 50% rename from src/Integration/Release/Composer/Author.php rename to src/Integration/Release/Composer/ComposerAuthor.php index 02a373a..ca3d074 100644 --- a/src/Integration/Release/Composer/Author.php +++ b/src/Integration/Release/Composer/ComposerAuthor.php @@ -7,7 +7,7 @@ /** * Represents individual package author from composer.json */ -final class Author +final class ComposerAuthor { /** * @var string @@ -19,38 +19,22 @@ final class Author private $email; /** - * Initializes author from the composer array. + * Initializes author from the composer authors meta. * - * @param array $unserializedComposerAuthor + * @param array $meta * - * @return Author + * @return ComposerAuthor * * @throws AuthorNameIsNotDefined */ - public static function fromArray(array $unserializedComposerAuthor) + public function __construct(array $meta) { - if (!isset($unserializedComposerAuthor['name'])) { + if (!isset($meta['name'])) { throw new AuthorNameIsNotDefined('Composer authors should have a name.'); } - $author = new Author( - $unserializedComposerAuthor['name'], - isset($unserializedComposerAuthor['email']) ? $unserializedComposerAuthor['email'] : null - ); - - return $author; - } - - /** - * Initializes author. - * - * @param string $name - * @param string $email - */ - public function __construct($name, $email = null) - { - $this->name = $name; - $this->email = $email; + $this->name = $meta['name']; + $this->email = isset($meta['email']) ? $meta['email'] : null; } /** diff --git a/src/Integration/Release/Composer/ComposerPackage.php b/src/Integration/Release/Composer/ComposerPackage.php index 854baa2..fa51dd3 100644 --- a/src/Integration/Release/Composer/ComposerPackage.php +++ b/src/Integration/Release/Composer/ComposerPackage.php @@ -89,7 +89,7 @@ public function description() /** * Hash of the primary package author or null if no authors defined. * - * @return Author|null + * @return ComposerAuthor|null */ public function primaryAuthor() { @@ -99,7 +99,7 @@ public function primaryAuthor() /** * Returns package authors. * - * @return Author[] + * @return ComposerAuthor[] */ public function authors() { @@ -133,8 +133,8 @@ private function extractAuthors(array $data) return array_map([$this, 'extractAuthor'], $data['authors']); } - private function extractAuthor(array $author) + private function extractAuthor(array $meta) { - return Author::fromArray($author); + return new ComposerAuthor($meta); } } From 611ab9316fb6d7d79cba6ea9dc1a77ba2b4d5143 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 15:49:08 +0100 Subject: [PATCH 51/59] Align rules in features for symmetry --- features/behat_documentation_is_published.feature | 4 ++-- features/current_documentation_is_available.feature | 6 +++--- features/documentation_meta_is_generated.feature | 6 +++--- features/extension_documentation_is_published.feature | 4 ++-- features/extensions_are_catalogued.feature | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/features/behat_documentation_is_published.feature b/features/behat_documentation_is_published.feature index ca05f28..c81039e 100644 --- a/features/behat_documentation_is_published.feature +++ b/features/behat_documentation_is_published.feature @@ -4,8 +4,8 @@ Feature: Behat documentation is published I want behat documentation to be published after we release a new version of it Rules: - - Documentation for Behat should be published - - Documentation for both versions should be published + - Documentation for Behat should be published + - Documentation for both versions should be published @critical Scenario: Publishing behat 3.0 documentation diff --git a/features/current_documentation_is_available.feature b/features/current_documentation_is_available.feature index 2af659d..798fcad 100644 --- a/features/current_documentation_is_available.feature +++ b/features/current_documentation_is_available.feature @@ -4,9 +4,9 @@ Feature: Current documentation is available I want latest most stable version of documentation to be available as current Rules: - - Use the latest stable release (v2.0.1) if there are some - - If there are no stable releases, but there are some dev releases (v2.0.x) - use the latest - - If there are no stable or dev releases, then use branches in this order: master, develop + - Use the latest stable release (v2.0.1) if there are some + - If there are no stable releases, but there are some dev releases (v2.0.x) - use the latest + - If there are no stable or dev releases, then use branches in this order: master, develop @critical Scenario: Having some stable versions published diff --git a/features/documentation_meta_is_generated.feature b/features/documentation_meta_is_generated.feature index 79edd4d..8266a71 100644 --- a/features/documentation_meta_is_generated.feature +++ b/features/documentation_meta_is_generated.feature @@ -4,9 +4,9 @@ Feature: Documentation meta is generated I want documentation meta to be available after publishing Meta: - - Documentation package name and update time - - Links to other published versions of documentation - - Link to the current documentation page editor + - Documentation package name and update time + - Links to other published versions of documentation + - Link to the current documentation page editor Scenario: Getting documentation package name and edit time Given "behat/symfony2-extension" version "v2.0.0" was documented in "Behat/Symfony2Extension" on "04.09.2014, 22:10:45" diff --git a/features/extension_documentation_is_published.feature b/features/extension_documentation_is_published.feature index 20149e4..6c602d0 100644 --- a/features/extension_documentation_is_published.feature +++ b/features/extension_documentation_is_published.feature @@ -4,8 +4,8 @@ Feature: Extension documentation is published I want extensions documentation to be published after contributors release a new versions of them Rules: - - Extensions documentation is published - - `master` and `develop` branches documentation should also be published (if documented) + - Extensions documentation is published + - `master` and `develop` branches documentation should also be published (if documented) Scenario: Publishing extension release documentation Given "behat/symfony2-extension" version "v2.0.0" was documented in "Behat/Symfony2Extension" diff --git a/features/extensions_are_catalogued.feature b/features/extensions_are_catalogued.feature index d0e6a34..5d31931 100644 --- a/features/extensions_are_catalogued.feature +++ b/features/extensions_are_catalogued.feature @@ -4,9 +4,9 @@ Feature: Extensions are catalogued I want my extensions to be catalogued when I release a new versions of them Rules: - - Extension repository release causes extension to be added to the extension catalogue - - If repository has no extensions, releasing it doesn't change the catalogue - - If repository has documentation, but no extensions, releasing it still doesn't change the catalogue + - Extension repository release causes extension to be added to the extension catalogue + - If repository has no extensions, releasing it doesn't change the catalogue + - If repository has documentation, but no extensions, releasing it still doesn't change the catalogue Scenario: Releasing a stable extension Given "behat/symfony2-extension" extension package was created in "Behat/Symfony2Extension" From e04ecc240a049687c938ef77a1bf4b8014392f6f Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 16:28:16 +0100 Subject: [PATCH 52/59] Cleanup the borg paths config --- app/config/config_test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/config/config_test.yml b/app/config/config_test.yml index 6f763e2..11e6e22 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -19,7 +19,8 @@ twig: exception_controller: Behat\Borg\Integration\Symfony\Debug\Controller\ExceptionController::showAction parameters: - package.release_downloader.path: %kernel.cache_dir%/build/repositories - documentation.build.path: %kernel.cache_dir%/build/docs - documentation.publisher.path: %kernel.cache_dir%/docs - extension.repo.path: %kernel.cache_dir%/extensions + borg.cache_dir: %kernel.cache_dir%/build + package.release_downloader.path: %borg.cache_dir%/releases + documentation.build.path: %borg.cache_dir%/built_docs + documentation.publisher.path: %borg.cache_dir%/published_docs + extension.repo.path: %borg.cache_dir%/extensions From aa1195f3a3dd74802e0cc986902be24617ccaf7e Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 16:28:47 +0100 Subject: [PATCH 53/59] Make sure that cache is cleaned between scenarios --- .../bootstrap/Smoke/DocumentationUIContext.php | 2 ++ features/bootstrap/Smoke/ExtensionUIContext.php | 2 ++ features/bootstrap/Smoke/ReleaseUIContext.php | 10 +--------- .../bootstrap/Transformation/CleanBuildCache.php | 16 ++++++++++++++++ 4 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 features/bootstrap/Transformation/CleanBuildCache.php diff --git a/features/bootstrap/Smoke/DocumentationUIContext.php b/features/bootstrap/Smoke/DocumentationUIContext.php index 545a258..4ba768c 100644 --- a/features/bootstrap/Smoke/DocumentationUIContext.php +++ b/features/bootstrap/Smoke/DocumentationUIContext.php @@ -15,6 +15,8 @@ */ class DocumentationUIContext extends RawMinkContext implements Context { + use Transformation\CleanBuildCache; + private $publisher; private $client; diff --git a/features/bootstrap/Smoke/ExtensionUIContext.php b/features/bootstrap/Smoke/ExtensionUIContext.php index 3ebf0c7..353b9cc 100644 --- a/features/bootstrap/Smoke/ExtensionUIContext.php +++ b/features/bootstrap/Smoke/ExtensionUIContext.php @@ -13,6 +13,8 @@ */ class ExtensionUIContext extends RawMinkContext implements Context { + use Transformation\CleanBuildCache; + private $client; /** diff --git a/features/bootstrap/Smoke/ReleaseUIContext.php b/features/bootstrap/Smoke/ReleaseUIContext.php index 9485257..7df9252 100644 --- a/features/bootstrap/Smoke/ReleaseUIContext.php +++ b/features/bootstrap/Smoke/ReleaseUIContext.php @@ -4,7 +4,6 @@ use Behat\Behat\Context\Context; use PHPUnit_Framework_Assert as PHPUnit; -use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\Process; use Transformation; @@ -13,14 +12,7 @@ */ class ReleaseUIContext implements Context { - /** - * @BeforeScenario - */ - public function cleanBuildAndWebFolders() - { - $cacheDir = __DIR__ . '/../../../app/cache/test'; - (new Filesystem())->remove(["{$cacheDir}/build", "{$cacheDir}/docs"]); - } + use Transformation\CleanBuildCache; /** * @When I release :repository version :version diff --git a/features/bootstrap/Transformation/CleanBuildCache.php b/features/bootstrap/Transformation/CleanBuildCache.php new file mode 100644 index 0000000..f19ff75 --- /dev/null +++ b/features/bootstrap/Transformation/CleanBuildCache.php @@ -0,0 +1,16 @@ +remove(__DIR__ . '/../../../app/cache/test/build'); + } +} From c21e63ef22ee726c4f203bef66b6c01c1d43759d Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 16:29:04 +0100 Subject: [PATCH 54/59] Mark releasing a stable extension scenario critical --- features/extensions_are_catalogued.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/extensions_are_catalogued.feature b/features/extensions_are_catalogued.feature index 5d31931..8f9d161 100644 --- a/features/extensions_are_catalogued.feature +++ b/features/extensions_are_catalogued.feature @@ -8,6 +8,7 @@ Feature: Extensions are catalogued - If repository has no extensions, releasing it doesn't change the catalogue - If repository has documentation, but no extensions, releasing it still doesn't change the catalogue + @critical Scenario: Releasing a stable extension Given "behat/symfony2-extension" extension package was created in "Behat/Symfony2Extension" When I release "Behat/Symfony2Extension" version "v2.0.0" From 4278c029bd707a30228eed02eb6a69997b8cfa98 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 16:31:25 +0100 Subject: [PATCH 55/59] Generate step definition for missing step --- features/bootstrap/Smoke/ExtensionUIContext.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/features/bootstrap/Smoke/ExtensionUIContext.php b/features/bootstrap/Smoke/ExtensionUIContext.php index 353b9cc..2522fe3 100644 --- a/features/bootstrap/Smoke/ExtensionUIContext.php +++ b/features/bootstrap/Smoke/ExtensionUIContext.php @@ -2,6 +2,7 @@ namespace Smoke; +use Behat\Behat\Tester\Exception\PendingException; use Behat\Behat\Context\Context; use Behat\MinkExtension\Context\RawMinkContext; use Github\Client; @@ -46,6 +47,14 @@ public function extensionCatalogueShouldHaveCount($count = 0) $this->assertSession()->elementsCount('css', '.extension', $count); } + /** + * @Then :name extension should be in the catalogue + */ + public function extensionShouldBeInTheCatalogue($name) + { + throw new PendingException(); + } + private function repositoryExtensionIs($repository, $extension) { $content = $this->contentInRepository($repository, 'composer.json'); From 57f149c9e72b16d931c725d6b52a7165001b339a Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 16:34:37 +0100 Subject: [PATCH 56/59] Write failing test for the pending step --- features/bootstrap/Smoke/ExtensionUIContext.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/features/bootstrap/Smoke/ExtensionUIContext.php b/features/bootstrap/Smoke/ExtensionUIContext.php index 2522fe3..aa55b05 100644 --- a/features/bootstrap/Smoke/ExtensionUIContext.php +++ b/features/bootstrap/Smoke/ExtensionUIContext.php @@ -2,7 +2,6 @@ namespace Smoke; -use Behat\Behat\Tester\Exception\PendingException; use Behat\Behat\Context\Context; use Behat\MinkExtension\Context\RawMinkContext; use Github\Client; @@ -52,7 +51,9 @@ public function extensionCatalogueShouldHaveCount($count = 0) */ public function extensionShouldBeInTheCatalogue($name) { - throw new PendingException(); + $this->visitPath('/extensions'); + $this->getSession()->getPage()->clickLink($name); + $this->assertSession()->elementContains('css', 'h1', $name); } private function repositoryExtensionIs($repository, $extension) From e5415452b69bb95a2e4bfb1e08089235e89bd7ec Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 16:41:37 +0100 Subject: [PATCH 57/59] Introduce individual extension page --- .../Extension/Controller/ExtensionController.php | 9 +++++++++ .../Extension/Resources/views/extension.html.twig | 14 ++++++++++++++ .../Extension/Resources/views/list.html.twig | 5 ++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/Integration/Symfony/Extension/Resources/views/extension.html.twig diff --git a/src/Integration/Symfony/Extension/Controller/ExtensionController.php b/src/Integration/Symfony/Extension/Controller/ExtensionController.php index 1dbba45..23df3be 100644 --- a/src/Integration/Symfony/Extension/Controller/ExtensionController.php +++ b/src/Integration/Symfony/Extension/Controller/ExtensionController.php @@ -18,6 +18,15 @@ public function listAction() return ['extensions' => $this->catalogue()->all()]; } + /** + * @Route("/{organisation}/{name}", name="extension_index") + * @Template("ExtensionBundle::extension.html.twig") + */ + public function indexAction($organisation, $name) + { + return ['extension' => $this->catalogue()->extension($organisation . '/' . $name)]; + } + /** * @return ExtensionCatalogue */ diff --git a/src/Integration/Symfony/Extension/Resources/views/extension.html.twig b/src/Integration/Symfony/Extension/Resources/views/extension.html.twig new file mode 100644 index 0000000..5256c81 --- /dev/null +++ b/src/Integration/Symfony/Extension/Resources/views/extension.html.twig @@ -0,0 +1,14 @@ +{% extends '::layout.html.twig' %} + +{% block title %}{{ extension.name }} — Behat Extensions{% endblock %} + +{% block stylesheets %} + +{% endblock %} + + +{% block page %} +
+

{{ extension.organisationName }}/{{ extension.name }}

+
+{% endblock %} diff --git a/src/Integration/Symfony/Extension/Resources/views/list.html.twig b/src/Integration/Symfony/Extension/Resources/views/list.html.twig index 1c01765..3647d05 100644 --- a/src/Integration/Symfony/Extension/Resources/views/list.html.twig +++ b/src/Integration/Symfony/Extension/Resources/views/list.html.twig @@ -17,7 +17,10 @@ interested in:

{% for extension in extensions %} - +

{{ extension }}

by {{ extension.author }}

{{ extension.description }}

From 4083d00bb9ff8a9a71922b1a13a06901338a16d5 Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 16:56:24 +0100 Subject: [PATCH 58/59] Style the extension page --- .../Resources/views/extension.html.twig | 10 ++- web/css/extensions.css | 68 +++++++++++++++++++ 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/src/Integration/Symfony/Extension/Resources/views/extension.html.twig b/src/Integration/Symfony/Extension/Resources/views/extension.html.twig index 5256c81..dca6beb 100644 --- a/src/Integration/Symfony/Extension/Resources/views/extension.html.twig +++ b/src/Integration/Symfony/Extension/Resources/views/extension.html.twig @@ -1,6 +1,6 @@ {% extends '::layout.html.twig' %} -{% block title %}{{ extension.name }} — Behat Extensions{% endblock %} +{% block title %}{{ extension }} — Behat Extensions{% endblock %} {% block stylesheets %} @@ -8,7 +8,11 @@ {% block page %} -
-

{{ extension.organisationName }}/{{ extension.name }}

+
+
+

{{ extension }}

+ by {{ extension.author }} +

{{ extension.description }}

+
{% endblock %} diff --git a/web/css/extensions.css b/web/css/extensions.css index e5fc546..e985d8c 100644 --- a/web/css/extensions.css +++ b/web/css/extensions.css @@ -1,3 +1,71 @@ +section.extension { + margin: 0px 20px; +} + +section.extension header { + display: block; + width: 780px; + margin-bottom: 20px; + border: none; +} + +section.extension header h1 { + font-family: 'Comfortaa'; + display: block; + position: relative; + float: left; + max-width: 450px; + margin-top: 10px; + padding: 3px 0px; + font-size: 2.4rem; + line-height: 1.38; + overflow: hidden; + color: #000; +} + +section.extension header .by { + display: block; + position: relative; + float: left; + margin: 21px 0 0 10px; + font: italic 1.4rem Georgia; + color: rgb(161, 159, 159); +} + +section.extension header .author { + display: block; + position: relative; + float: left; + max-width: 260px; + margin: 18px 0 0 7px; + font-size: 1.8rem; + line-height: 1.38; + overflow: hidden; + color: rgb(161, 159, 159); +} + +section.extension header p { + display: block; + width: 100%; + margin: 60px auto 0; + padding-right: 10px; + padding-bottom: 10px; + font-size: 1.4rem; + font-weight: 400; + line-height: 1.38; + color: rgb(80, 80, 80); +} + + + + + + + + + + + section.extensions { margin: 0px 20px; } From 0c702e747882785365fc4ffe002c35a7a7f9251b Mon Sep 17 00:00:00 2001 From: everzet Date: Tue, 11 Aug 2015 17:05:44 +0100 Subject: [PATCH 59/59] Abstract documentation URL generation into private --- features/bootstrap/Smoke/DocumentationUIContext.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/features/bootstrap/Smoke/DocumentationUIContext.php b/features/bootstrap/Smoke/DocumentationUIContext.php index 4ba768c..1a179bc 100644 --- a/features/bootstrap/Smoke/DocumentationUIContext.php +++ b/features/bootstrap/Smoke/DocumentationUIContext.php @@ -66,7 +66,7 @@ public function packageWasNotDocumented() { } */ public function packageDocumentationShouldHaveBeenPublished($project, $versionString) { - $this->visitPath("/docs/$project/$versionString/index.html"); + $this->visitPath($this->documentationPagePath($project, $versionString, 'index.html')); $this->assertSession()->pageTextContains($project); $this->assertSession()->pageTextContains($versionString); @@ -77,7 +77,7 @@ public function packageDocumentationShouldHaveBeenPublished($project, $versionSt */ public function packageDocumentationShouldNotBePublished($project, $versionString) { - $this->visitPath("/docs/$project/$versionString/index.html"); + $this->visitPath($this->documentationPagePath($project, $versionString, 'index.html')); $this->assertSession()->statusCodeEquals(404); } @@ -87,11 +87,16 @@ public function packageDocumentationShouldNotBePublished($project, $versionStrin */ public function currentVersionOfDocumentationShouldPointToVersion($project, $versionString) { - $this->visitPath("/docs/$project/current/index.html"); + $this->visitPath($this->documentationPagePath($project, $versionString, 'index.html')); $this->assertSession()->elementTextContains('css', '.version.current', $versionString); } + private function documentationPagePath($project, $versionString, $page) + { + return "/docs/$project/$versionString/$page"; + } + private function repositoryContainsDocs($repository, $version) { return $this->existsInRepositoryVersion($repository, $version, 'index.rst')