From 94b8a15614a7cb300753f1f5861cc8822dde4b8e Mon Sep 17 00:00:00 2001 From: Laurent Clouet Date: Sat, 5 Jan 2019 22:25:49 +0100 Subject: [PATCH 1/8] #9699 Fix for viewing products when they belong to a taxon and to one of children taxon --- ...g_products_from_taxon_and_children.feature | 38 +++++++++++++++++++ .../Doctrine/ORM/ProductRepository.php | 1 + 2 files changed, 39 insertions(+) create mode 100644 features/product/viewing_products/viewing_products_from_taxon_and_children.feature diff --git a/features/product/viewing_products/viewing_products_from_taxon_and_children.feature b/features/product/viewing_products/viewing_products_from_taxon_and_children.feature new file mode 100644 index 00000000000..e6a78fc4f19 --- /dev/null +++ b/features/product/viewing_products/viewing_products_from_taxon_and_children.feature @@ -0,0 +1,38 @@ +@viewing_products +Feature: Viewing products from taxon children + In order to browse products from general taxons + As a Visitor + I want to be able to view products from taxon and from taxon children + + Background: + Given the store has currency "Euro" + And the store operates on a channel named "Poland" + And the store classifies its products as "T-Shirts" + And the "T-Shirts" taxon has children taxon "Men" and "Women" + And the store has a product "T-Shirt Banana" available in "Poland" channel + And this product belongs to "T-Shirts" + And the store has a product "T-Shirt Banana For Men" available in "Poland" channel + And this product belongs to "T-Shirts" + And this product belongs to "Men" + And the store has a product "T-Shirt Apple" available in "Poland" channel + And this product belongs to "T-Shirts" + And this product belongs to "Men" + And the store has a product "T-Shirt Pear" available in "Poland" channel + And this product belongs to "T-Shirts" + And this product belongs to "Men" + And the store has a product "T-Shirt Watermelon" available in "Poland" channel + And this product belongs to "T-Shirts" + And this product belongs to "Men" + And the store has a product "T-Shirt Lemon" available in "Poland" channel + And this product belongs to "T-Shirts" + And this product belongs to "Men" + + @ui + Scenario: Viewing products from taxon children + When I browse products from taxon "T-Shirts" + Then I should see the product "T-Shirt Banana" + And I should see the product "T-Shirt Banana For Men" + And I should see the product "T-Shirt Apple" + And I should see the product "T-Shirt Pear" + And I should see the product "T-Shirt Watermelon" + And I should see the product "T-Shirt Lemon" diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php index 63800cfa330..e184c6719bb 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php @@ -70,6 +70,7 @@ public function createShopListQueryBuilder( array $sorting = [] ): QueryBuilder { $queryBuilder = $this->createQueryBuilder('o') + ->distinct() ->addSelect('translation') ->innerJoin('o.translations', 'translation', 'WITH', 'translation.locale = :locale') ->innerJoin('o.productTaxons', 'productTaxon') From bb9e147cef6fc5f7b04e94d3411ff7b1eb31f78f Mon Sep 17 00:00:00 2001 From: Stefan Doorn Date: Sun, 9 Dec 2018 18:07:41 +0100 Subject: [PATCH 2/8] Behat test for assigning main taxon on new product --- .../select_taxons_for_new_product.feature | 34 ++++++++++++++++++ .../select_taxons_for_product.feature | 5 +-- .../Product/CreateConfigurableProductPage.php | 36 +++++++++++++++++-- ...CreateConfigurableProductPageInterface.php | 10 +++--- .../Admin/Product/CreateSimpleProductPage.php | 33 ++++++++++++++++- .../CreateSimpleProductPageInterface.php | 10 +++--- 6 files changed, 115 insertions(+), 13 deletions(-) create mode 100644 features/product/managing_products/select_taxons_for_new_product.feature diff --git a/features/product/managing_products/select_taxons_for_new_product.feature b/features/product/managing_products/select_taxons_for_new_product.feature new file mode 100644 index 00000000000..42cbff0dc7e --- /dev/null +++ b/features/product/managing_products/select_taxons_for_new_product.feature @@ -0,0 +1,34 @@ +@managing_products +Feature: Select taxon for a new product + In order to specify in which taxons a product is available + As an Administrator + I want to be able to select taxons for a new product + + Background: + Given the store operates on a single channel in "United States" + And the store classifies its products as "T-Shirts", "Accessories", "Funny" and "Sad" + And I am logged in as an administrator + And I am using "English (United Kingdom)" locale for my panel + + @ui @javascript + Scenario: Specifying main taxon for configurable product + Given I want to create a new configurable product + When I choose main taxon "Sad" + And I specify its code as "WHISKEY_GENTLEMEN" + And I name it "Gentleman Jack" in "English (United States)" + And I set its slug to "whiskey/gentleman-jack" in "English (United States)" + And I add it + Then I should be notified that it has been successfully created + And this product main taxon should be "Sad" + + @ui @javascript + Scenario: Specifying main taxon for simple product + Given I want to create a new simple product + When I choose main taxon "Sad" + And I name it "Mansion of Madness" in "English (United States)" + And I specify its code as "BOARD_MANSION_OF_MADNESS" + And I set its price to "$100.00" for "United States" channel + And I set its slug to "mom-board-game" in "English (United States)" + And I add it + Then I should be notified that it has been successfully created + And this product main taxon should be "Sad" diff --git a/features/product/managing_products/select_taxons_for_product.feature b/features/product/managing_products/select_taxons_for_product.feature index 8f0d74f55dc..e5a831ca7db 100644 --- a/features/product/managing_products/select_taxons_for_product.feature +++ b/features/product/managing_products/select_taxons_for_product.feature @@ -1,8 +1,8 @@ @managing_products -Feature: Select taxon for a product +Feature: Select taxon for an existing product In order to specify in which taxons a product is available As an Administrator - I want to be able to select taxons for a product + I want to be able to select taxons for an existing product Background: Given the store operates on a single channel in "United States" @@ -27,3 +27,4 @@ Feature: Select taxon for a product And I save my changes Then I should be notified that it has been successfully edited And this product main taxon should be "Sad" + diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php b/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php index 43484ad1ca8..2ac0289933d 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php @@ -18,6 +18,7 @@ use Sylius\Behat\Behaviour\SpecifiesItsCode; use Sylius\Behat\Page\Admin\Crud\CreatePage as BaseCreatePage; use Sylius\Behat\Service\SlugGenerationHelper; +use Sylius\Component\Core\Model\TaxonInterface; use Webmozart\Assert\Assert; class CreateConfigurableProductPage extends BaseCreatePage implements CreateConfigurableProductPageInterface @@ -35,12 +36,35 @@ public function nameItIn(string $name, string $localeCode): void } } - public function selectOption(string $optionName): void + public function isMainTaxonChosen(string $taxonName): bool + { + $this->openTaxonBookmarks(); + Assert::notNull($this->getDocument()->find('css', '.search > .text')); + + return $taxonName === $this->getDocument()->find('css', '.search > .text')->getText(); + } + + public function selectMainTaxon(TaxonInterface $taxon): void + { + $this->openTaxonBookmarks(); + + Assert::isInstanceOf($this->getDriver(), Selenium2Driver::class); + + $this->getDriver()->executeScript(sprintf('$(\'input.search\').val(\'%s\')', $taxon->getName())); + $this->getElement('search')->click(); + $this->getElement('search')->waitFor(10, function () { + return $this->hasElement('search_item_selected'); + }); + $itemSelected = $this->getElement('search_item_selected'); + $itemSelected->click(); + } + + public function selectOption($optionName) { $this->getDocument()->selectFieldOption('Options', $optionName); } - public function attachImage(string $path, string $type = null): void + public function attachImage(string $path, ?string $type = null): void { $this->clickTabIfItsNotActive('media'); @@ -63,10 +87,18 @@ protected function getDefinedElements(): array 'images' => '#sylius_product_images', 'name' => '#sylius_product_translations_en_US_name', 'slug' => '#sylius_product_translations_en_US_slug', + 'search' => '.ui.fluid.search.selection.dropdown', + 'search_item_selected' => 'div.menu > div.item.selected', 'tab' => '.menu [data-tab="%name%"]', + 'taxonomy' => 'a[data-tab="taxonomy"]', ]); } + private function openTaxonBookmarks(): void + { + $this->getElement('taxonomy')->click(); + } + private function clickTabIfItsNotActive(string $tabName): void { $attributesTab = $this->getElement('tab', ['%name%' => $tabName]); diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPageInterface.php b/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPageInterface.php index 4ed111fef2c..bce40dc1c33 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPageInterface.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPageInterface.php @@ -14,6 +14,7 @@ namespace Sylius\Behat\Page\Admin\Product; use Sylius\Behat\Page\Admin\Crud\CreatePageInterface as BaseCreatePageInterface; +use Sylius\Component\Core\Model\TaxonInterface; interface CreateConfigurableProductPageInterface extends BaseCreatePageInterface { @@ -23,8 +24,9 @@ public function specifyCode(string $code): void; public function nameItIn(string $name, string $localeCode): void; - /** - * @param string $type - */ - public function attachImage(string $path, string $type = null): void; + public function isMainTaxonChosen(string $taxonName): bool; + + public function selectMainTaxon(TaxonInterface $taxon): void; + + public function attachImage(string $path, ?string $type = null): void; } diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php index 882df65d7a6..b2bd164c347 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php @@ -17,7 +17,9 @@ use Behat\Mink\Element\NodeElement; use Sylius\Behat\Behaviour\SpecifiesItsCode; use Sylius\Behat\Page\Admin\Crud\CreatePage as BaseCreatePage; +use Sylius\Behat\Service\AutocompleteHelper; use Sylius\Behat\Service\SlugGenerationHelper; +use Sylius\Component\Core\Model\TaxonInterface; use Sylius\Component\Product\Model\ProductAssociationTypeInterface; use Webmozart\Assert\Assert; @@ -91,6 +93,28 @@ public function removeAttribute(string $attributeName, string $localeCode): void $this->getElement('attribute_delete_button', ['%attributeName%' => $attributeName, '%localeCode%' => $localeCode])->press(); } + public function checkAttributeErrors($attributeName, $localeCode): void + { + $this->clickTabIfItsNotActive('attributes'); + $this->clickLocaleTabIfItsNotActive($localeCode); + } + + public function selectMainTaxon(TaxonInterface $taxon): void + { + $this->openTaxonBookmarks(); + + $mainTaxonElement = $this->getElement('main_taxon')->getParent(); + + AutocompleteHelper::chooseValue($this->getSession(), $mainTaxonElement, $taxon->getName()); + } + + public function isMainTaxonChosen(string $taxonName): bool + { + $this->openTaxonBookmarks(); + + return $taxonName === $this->getDocument()->find('css', '.search > .text')->getText(); + } + public function attachImage(string $path, string $type = null): void { $this->clickTabIfItsNotActive('media'); @@ -209,6 +233,7 @@ protected function getDefinedElements(): array 'images' => '#sylius_product_images', 'language_tab' => '[data-locale="%locale%"] .title', 'locale_tab' => '#attributesContainer .menu [data-tab="%localeCode%"]', + 'main_taxon' => '#sylius_product_mainTaxon', 'name' => '#sylius_product_translations_%locale%_name', 'price' => '#sylius_product_variant_channelPricings > .field:contains("%channelName%") input[name$="[price]"]', 'original_price' => '#sylius_product_variant_channelPricings > .field:contains("%channelName%") input[name$="[originalPrice]"]', @@ -217,11 +242,17 @@ protected function getDefinedElements(): array 'shipping_required' => '#sylius_product_variant_shippingRequired', 'slug' => '#sylius_product_translations_%locale%_slug', 'tab' => '.menu [data-tab="%name%"]', + 'taxonomy' => 'a[data-tab="taxonomy"]', 'toggle_slug_modification_button' => '.toggle-product-slug-modification', ]); } - private function selectElementFromAttributesDropdown(string $id): void + private function openTaxonBookmarks(): void + { + $this->getElement('taxonomy')->click(); + } + + private function selectElementFromAttributesDropdown(int $id): void { /** @var Selenium2Driver $driver */ $driver = $this->getDriver(); diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPageInterface.php b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPageInterface.php index 65c779867b0..9188bcad42d 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPageInterface.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPageInterface.php @@ -14,6 +14,7 @@ namespace Sylius\Behat\Page\Admin\Product; use Sylius\Behat\Page\Admin\Crud\CreatePageInterface as BaseCreatePageInterface; +use Sylius\Component\Core\Model\TaxonInterface; use Sylius\Component\Product\Model\ProductAssociationTypeInterface; interface CreateSimpleProductPageInterface extends BaseCreatePageInterface @@ -38,10 +39,11 @@ public function getAttributeValidationErrors(string $attributeName, string $loca public function removeAttribute(string $attributeName, string $localeCode): void; - /** - * @param string $type - */ - public function attachImage(string $path, string $type = null): void; + public function isMainTaxonChosen(string $taxonName): bool; + + public function selectMainTaxon(TaxonInterface $taxon): void; + + public function attachImage(string $path, ?string $type = null): void; /** * @param string[] $productsNames From 94881405718124e865fce8477a9156631472d20f Mon Sep 17 00:00:00 2001 From: Mateusz Zalewski Date: Tue, 18 Dec 2018 13:03:04 +0100 Subject: [PATCH 3/8] Fix build --- .../select_taxons_for_new_product.feature | 6 +++--- .../Context/Ui/Admin/ManagingProductsContext.php | 1 + .../Product/CreateConfigurableProductPage.php | 16 +++++++--------- .../Admin/Product/CreateSimpleProductPage.php | 1 + 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/features/product/managing_products/select_taxons_for_new_product.feature b/features/product/managing_products/select_taxons_for_new_product.feature index 42cbff0dc7e..770251ac29a 100644 --- a/features/product/managing_products/select_taxons_for_new_product.feature +++ b/features/product/managing_products/select_taxons_for_new_product.feature @@ -14,12 +14,12 @@ Feature: Select taxon for a new product Scenario: Specifying main taxon for configurable product Given I want to create a new configurable product When I choose main taxon "Sad" - And I specify its code as "WHISKEY_GENTLEMEN" And I name it "Gentleman Jack" in "English (United States)" + And I specify its code as "WHISKEY_GENTLEMEN" And I set its slug to "whiskey/gentleman-jack" in "English (United States)" And I add it Then I should be notified that it has been successfully created - And this product main taxon should be "Sad" + And main taxon of product "Gentleman Jack" should be "Sad" @ui @javascript Scenario: Specifying main taxon for simple product @@ -31,4 +31,4 @@ Feature: Select taxon for a new product And I set its slug to "mom-board-game" in "English (United States)" And I add it Then I should be notified that it has been successfully created - And this product main taxon should be "Sad" + And main taxon of product "Mansion of Madness" should be "Sad" diff --git a/src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php b/src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php index a00cf6d0ffd..16261d3affe 100644 --- a/src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php +++ b/src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php @@ -579,6 +579,7 @@ public function productSlugShouldBe(ProductInterface $product, $slug, $locale = /** * @Then /^(this product) main taxon should be "([^"]+)"$/ + * @Then /^main taxon of (product "[^"]+") should be "([^"]+)"$/ */ public function thisProductMainTaxonShouldBe(ProductInterface $product, $taxonName) { diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php b/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php index 2ac0289933d..122db638458 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php @@ -17,6 +17,7 @@ use Behat\Mink\Element\NodeElement; use Sylius\Behat\Behaviour\SpecifiesItsCode; use Sylius\Behat\Page\Admin\Crud\CreatePage as BaseCreatePage; +use Sylius\Behat\Service\AutocompleteHelper; use Sylius\Behat\Service\SlugGenerationHelper; use Sylius\Component\Core\Model\TaxonInterface; use Webmozart\Assert\Assert; @@ -27,6 +28,8 @@ class CreateConfigurableProductPage extends BaseCreatePage implements CreateConf public function nameItIn(string $name, string $localeCode): void { + $this->clickTabIfItsNotActive('details'); + $this->getDocument()->fillField( sprintf('sylius_product_translations_%s_name', $localeCode), $name ); @@ -48,15 +51,9 @@ public function selectMainTaxon(TaxonInterface $taxon): void { $this->openTaxonBookmarks(); - Assert::isInstanceOf($this->getDriver(), Selenium2Driver::class); + $mainTaxonElement = $this->getElement('main_taxon')->getParent(); - $this->getDriver()->executeScript(sprintf('$(\'input.search\').val(\'%s\')', $taxon->getName())); - $this->getElement('search')->click(); - $this->getElement('search')->waitFor(10, function () { - return $this->hasElement('search_item_selected'); - }); - $itemSelected = $this->getElement('search_item_selected'); - $itemSelected->click(); + AutocompleteHelper::chooseValue($this->getSession(), $mainTaxonElement, $taxon->getName()); } public function selectOption($optionName) @@ -85,10 +82,11 @@ protected function getDefinedElements(): array return array_merge(parent::getDefinedElements(), [ 'code' => '#sylius_product_code', 'images' => '#sylius_product_images', + 'main_taxon' => '#sylius_product_mainTaxon', 'name' => '#sylius_product_translations_en_US_name', - 'slug' => '#sylius_product_translations_en_US_slug', 'search' => '.ui.fluid.search.selection.dropdown', 'search_item_selected' => 'div.menu > div.item.selected', + 'slug' => '#sylius_product_translations_en_US_slug', 'tab' => '.menu [data-tab="%name%"]', 'taxonomy' => 'a[data-tab="taxonomy"]', ]); diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php index b2bd164c347..2f0ced62aa1 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php @@ -34,6 +34,7 @@ public function getRouteName(): string public function nameItIn(string $name, string $localeCode): void { + $this->clickTabIfItsNotActive('details'); $this->activateLanguageTab($localeCode); $this->getElement('name', ['%locale%' => $localeCode])->setValue($name); From b3b5f3e3f25283810047d04559df87b4901561a4 Mon Sep 17 00:00:00 2001 From: Kamil Kokot Date: Wed, 2 Jan 2019 15:39:07 +0100 Subject: [PATCH 4/8] Make tests passing --- .../Behat/Page/Admin/Product/CreateConfigurableProductPage.php | 2 +- src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php b/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php index 122db638458..2ba2aacf7cf 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateConfigurableProductPage.php @@ -56,7 +56,7 @@ public function selectMainTaxon(TaxonInterface $taxon): void AutocompleteHelper::chooseValue($this->getSession(), $mainTaxonElement, $taxon->getName()); } - public function selectOption($optionName) + public function selectOption(string $optionName): void { $this->getDocument()->selectFieldOption('Options', $optionName); } diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php index 2f0ced62aa1..dbbef3acbf3 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php @@ -69,7 +69,7 @@ public function addAttribute(string $attributeName, string $value, string $local $this->clickLocaleTabIfItsNotActive($localeCode); $attributeOption = $this->getElement('attributes_choice')->find('css', sprintf('option:contains("%s")', $attributeName)); - $this->selectElementFromAttributesDropdown($attributeOption->getAttribute('value')); + $this->selectElementFromAttributesDropdown((int) $attributeOption->getAttribute('value')); $this->getDocument()->pressButton('Add attributes'); $this->waitForFormElement(); From 6847692f0c5fafe88c991b346989f3121c358c9a Mon Sep 17 00:00:00 2001 From: Stefan Doorn Date: Fri, 11 Jan 2019 11:58:09 +0100 Subject: [PATCH 5/8] Revert int strictness to just pass strings --- .../Behat/Page/Admin/Product/CreateSimpleProductPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php index dbbef3acbf3..65d47e57e4e 100644 --- a/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php +++ b/src/Sylius/Behat/Page/Admin/Product/CreateSimpleProductPage.php @@ -69,7 +69,7 @@ public function addAttribute(string $attributeName, string $value, string $local $this->clickLocaleTabIfItsNotActive($localeCode); $attributeOption = $this->getElement('attributes_choice')->find('css', sprintf('option:contains("%s")', $attributeName)); - $this->selectElementFromAttributesDropdown((int) $attributeOption->getAttribute('value')); + $this->selectElementFromAttributesDropdown($attributeOption->getAttribute('value')); $this->getDocument()->pressButton('Add attributes'); $this->waitForFormElement(); @@ -253,7 +253,7 @@ private function openTaxonBookmarks(): void $this->getElement('taxonomy')->click(); } - private function selectElementFromAttributesDropdown(int $id): void + private function selectElementFromAttributesDropdown(string $id): void { /** @var Selenium2Driver $driver */ $driver = $this->getDriver(); From 954dbddef5d058b93131184cce5e00d23a67dc05 Mon Sep 17 00:00:00 2001 From: Laurent Clouet Date: Sun, 13 Jan 2019 13:22:11 +0100 Subject: [PATCH 6/8] =?UTF-8?q?#9699=20=F0=9F=8D=8C=20->=20=F0=9F=A5=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../viewing_products_from_taxon_and_children.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/product/viewing_products/viewing_products_from_taxon_and_children.feature b/features/product/viewing_products/viewing_products_from_taxon_and_children.feature index e6a78fc4f19..c8c2358b6b9 100644 --- a/features/product/viewing_products/viewing_products_from_taxon_and_children.feature +++ b/features/product/viewing_products/viewing_products_from_taxon_and_children.feature @@ -9,7 +9,7 @@ Feature: Viewing products from taxon children And the store operates on a channel named "Poland" And the store classifies its products as "T-Shirts" And the "T-Shirts" taxon has children taxon "Men" and "Women" - And the store has a product "T-Shirt Banana" available in "Poland" channel + And the store has a product "T-Shirt Coconut" available in "Poland" channel And this product belongs to "T-Shirts" And the store has a product "T-Shirt Banana For Men" available in "Poland" channel And this product belongs to "T-Shirts" @@ -30,7 +30,7 @@ Feature: Viewing products from taxon children @ui Scenario: Viewing products from taxon children When I browse products from taxon "T-Shirts" - Then I should see the product "T-Shirt Banana" + Then I should see the product "T-Shirt Coconut" And I should see the product "T-Shirt Banana For Men" And I should see the product "T-Shirt Apple" And I should see the product "T-Shirt Pear" From 5da58b99bc77dfc59d9d59dee3b5ec4885940718 Mon Sep 17 00:00:00 2001 From: Kamil Kokot Date: Sun, 13 Jan 2019 15:18:45 +0100 Subject: [PATCH 7/8] Apply coding standard fixes --- app/config/router_test_cached.php | 15 ++++++++++++-- app/migrations/Version20161202011555.php | 17 ++++++++++------ app/migrations/Version20161209095131.php | 25 ++++++++++++------------ app/migrations/Version20161214153137.php | 25 +++++++++++++----------- app/migrations/Version20161215103325.php | 17 ++++++++++------ app/migrations/Version20161219160441.php | 25 +++++++++++++----------- app/migrations/Version20161220092422.php | 17 ++++++++++------ app/migrations/Version20161221133514.php | 17 ++++++++++------ app/migrations/Version20161223091334.php | 17 ++++++++++------ app/migrations/Version20161223164558.php | 17 ++++++++++------ app/migrations/Version20170103120334.php | 17 ++++++++++------ app/migrations/Version20170109143010.php | 23 ++++++++++++---------- app/migrations/Version20170110120125.php | 17 ++++++++++------ app/migrations/Version20170116215417.php | 17 ++++++++++------ app/migrations/Version20170117075436.php | 17 ++++++++++------ app/migrations/Version20170120164250.php | 17 ++++++++++------ app/migrations/Version20170124221955.php | 17 ++++++++++------ app/migrations/Version20170201094058.php | 17 ++++++++++------ app/migrations/Version20170206122839.php | 17 ++++++++++------ app/migrations/Version20170206141520.php | 17 ++++++++++------ app/migrations/Version20170208102345.php | 17 ++++++++++------ app/migrations/Version20170208103250.php | 17 ++++++++++------ app/migrations/Version20170214095710.php | 17 ++++++++++------ app/migrations/Version20170214104908.php | 17 ++++++++++------ app/migrations/Version20170215143031.php | 17 ++++++++++------ app/migrations/Version20170217141621.php | 17 ++++++++++------ app/migrations/Version20170220150813.php | 17 ++++++++++------ app/migrations/Version20170223071604.php | 17 ++++++++++------ app/migrations/Version20170301135010.php | 17 ++++++++++------ app/migrations/Version20170303170201.php | 17 ++++++++++------ app/migrations/Version20170313125424.php | 17 ++++++++++------ app/migrations/Version20170321131352.php | 17 ++++++++++------ app/migrations/Version20170327135945.php | 17 ++++++++++------ app/migrations/Version20170401200415.php | 17 ++++++++++------ app/migrations/Version20170518123056.php | 17 ++++++++++------ app/migrations/Version20170711151342.php | 17 ++++++++++------ app/migrations/Version20170824124122.php | 17 ++++++++++------ app/migrations/Version20170913125128.php | 17 ++++++++++------ app/migrations/Version20171003103916.php | 21 +++++++++++--------- app/migrations/Version20180102140039.php | 11 +++++++++++ app/migrations/Version20180226142349.php | 13 +++++++++++- web/app.php | 2 +- web/app_dev.php | 8 ++++---- web/app_staging.php | 2 +- web/app_test.php | 6 +++--- web/app_test_cached.php | 6 +++--- 46 files changed, 476 insertions(+), 267 deletions(-) diff --git a/app/config/router_test_cached.php b/app/config/router_test_cached.php index d79636f7fab..236a1dd5d80 100644 --- a/app/config/router_test_cached.php +++ b/app/config/router_test_cached.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_api_refresh_token ADD CONSTRAINT FK_44578525A76ED395 FOREIGN KEY (user_id) REFERENCES sylius_admin_user (id)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20161209095131.php b/app/migrations/Version20161209095131.php index 7bab685bcb2..d9d1aa18f1c 100644 --- a/app/migrations/Version20161209095131.php +++ b/app/migrations/Version20161209095131.php @@ -1,15 +1,22 @@ container = $container; } - /** - * @param Schema $schema - */ public function up(Schema $schema) { // this up() migration is auto-generated, please modify it to your needs @@ -46,9 +48,6 @@ public function up(Schema $schema) $entityManager->flush(); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20161214153137.php b/app/migrations/Version20161214153137.php index 87ace03fd26..bb857e0f6d3 100644 --- a/app/migrations/Version20161214153137.php +++ b/app/migrations/Version20161214153137.php @@ -1,5 +1,16 @@ container = $container; } - /** - * @param Schema $schema - */ public function up(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); @@ -33,13 +39,10 @@ public function up(Schema $schema) $this->addSql('CREATE TABLE sylius_product_variant_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_8DC18EDC2C2AC5D3 (translatable_id), UNIQUE INDEX sylius_product_variant_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE sylius_product_variant_translation ADD CONSTRAINT FK_8DC18EDC2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_product_variant (id) ON DELETE CASCADE'); - $this->addSql('INSERT INTO sylius_product_variant_translation (translatable_id, name, locale) SELECT id, name, "'.$defaultLocale.'" from sylius_product_variant WHERE sylius_product_variant.name IS NOT null'); + $this->addSql('INSERT INTO sylius_product_variant_translation (translatable_id, name, locale) SELECT id, name, "' . $defaultLocale . '" from sylius_product_variant WHERE sylius_product_variant.name IS NOT null'); $this->addSql('ALTER TABLE sylius_product_variant DROP name'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { $defaultLocale = $this->container->getParameter('locale'); @@ -47,7 +50,7 @@ public function down(Schema $schema) $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE sylius_product_variant ADD name VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci'); - $this->addSql('UPDATE sylius_product_variant SET name = (SELECT name FROM sylius_product_variant_translation WHERE sylius_product_variant_translation.translatable_id = sylius_product_variant.id AND sylius_product_variant_translation.locale = "'.$defaultLocale.'")'); + $this->addSql('UPDATE sylius_product_variant SET name = (SELECT name FROM sylius_product_variant_translation WHERE sylius_product_variant_translation.translatable_id = sylius_product_variant.id AND sylius_product_variant_translation.locale = "' . $defaultLocale . '")'); $this->addSql('DROP TABLE sylius_product_variant_translation'); } } diff --git a/app/migrations/Version20161215103325.php b/app/migrations/Version20161215103325.php index 5f648fbdebd..3e5241c8b92 100644 --- a/app/migrations/Version20161215103325.php +++ b/app/migrations/Version20161215103325.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_channel ADD contact_email VARCHAR(255) DEFAULT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20161219160441.php b/app/migrations/Version20161219160441.php index 0a95e704bdb..c4b48dac2c5 100644 --- a/app/migrations/Version20161219160441.php +++ b/app/migrations/Version20161219160441.php @@ -1,5 +1,16 @@ container = $container; } - /** - * @param Schema $schema - */ public function up(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); @@ -33,13 +39,10 @@ public function up(Schema $schema) $this->addSql('CREATE TABLE sylius_product_association_type_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_4F618E52C2AC5D3 (translatable_id), UNIQUE INDEX sylius_product_association_type_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE sylius_product_association_type_translation ADD CONSTRAINT FK_4F618E52C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_product_association_type (id) ON DELETE CASCADE'); - $this->addSql('INSERT INTO sylius_product_association_type_translation (translatable_id, name, locale) SELECT id, name, "'.$defaultLocale.'" from sylius_product_association_type WHERE sylius_product_association_type.name IS NOT null'); + $this->addSql('INSERT INTO sylius_product_association_type_translation (translatable_id, name, locale) SELECT id, name, "' . $defaultLocale . '" from sylius_product_association_type WHERE sylius_product_association_type.name IS NOT null'); $this->addSql('ALTER TABLE sylius_product_association_type DROP name'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); @@ -47,7 +50,7 @@ public function down(Schema $schema) $defaultLocale = $this->container->getParameter('locale'); $this->addSql('ALTER TABLE sylius_product_association_type ADD name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci'); - $this->addSql('UPDATE sylius_product_association_type SET name = (SELECT name FROM sylius_product_association_type_translation WHERE sylius_product_association_type_translation.translatable_id = sylius_product_association_type.id AND sylius_product_association_type_translation.locale = "'.$defaultLocale.'")'); + $this->addSql('UPDATE sylius_product_association_type SET name = (SELECT name FROM sylius_product_association_type_translation WHERE sylius_product_association_type_translation.translatable_id = sylius_product_association_type.id AND sylius_product_association_type_translation.locale = "' . $defaultLocale . '")'); $this->addSql('DROP TABLE sylius_product_association_type_translation'); } } diff --git a/app/migrations/Version20161220092422.php b/app/migrations/Version20161220092422.php index de1efb3f562..905c37021f8 100644 --- a/app/migrations/Version20161220092422.php +++ b/app/migrations/Version20161220092422.php @@ -1,5 +1,16 @@ addSql('CREATE TABLE sylius_address_log_entries (id INT AUTO_INCREMENT NOT NULL, action VARCHAR(255) NOT NULL, loggedAt DATETIME NOT NULL, objectId VARCHAR(64) DEFAULT NULL, objectClass VARCHAR(255) NOT NULL, version INT NOT NULL, data LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', username VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20161221133514.php b/app/migrations/Version20161221133514.php index 9cd2e353990..cd9e2510f01 100644 --- a/app/migrations/Version20161221133514.php +++ b/app/migrations/Version20161221133514.php @@ -1,5 +1,16 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); @@ -19,9 +27,6 @@ public function up(Schema $schema) $this->addSql('UPDATE sylius_product_option SET position = @row_number := @row_number + 1'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); diff --git a/app/migrations/Version20161223091334.php b/app/migrations/Version20161223091334.php index 3e2fa71e196..ff8f988951b 100644 --- a/app/migrations/Version20161223091334.php +++ b/app/migrations/Version20161223091334.php @@ -1,5 +1,16 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); @@ -31,9 +39,6 @@ public function up(Schema $schema) ); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); diff --git a/app/migrations/Version20161223164558.php b/app/migrations/Version20161223164558.php index 4654b6e1f6f..3e8b2d0a513 100644 --- a/app/migrations/Version20161223164558.php +++ b/app/migrations/Version20161223164558.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_shipping_method ADD archived_at DATETIME DEFAULT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170103120334.php b/app/migrations/Version20170103120334.php index 0436de17eec..ef8e7b55a34 100644 --- a/app/migrations/Version20170103120334.php +++ b/app/migrations/Version20170103120334.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_product_attribute_value ADD json_value LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\''); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170109143010.php b/app/migrations/Version20170109143010.php index 066178eb492..fb2ea81ff87 100644 --- a/app/migrations/Version20170109143010.php +++ b/app/migrations/Version20170109143010.php @@ -1,5 +1,16 @@ container = $container; } - /** - * @param Schema $schema - */ public function up(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); @@ -32,12 +38,9 @@ public function up(Schema $schema) $defaultLocale = $this->container->getParameter('locale'); $this->addSql('ALTER TABLE sylius_product_attribute_value ADD locale_code VARCHAR(255) NOT NULL'); - $this->addSql('UPDATE sylius_product_attribute_value SET locale_code = "'.$defaultLocale.'"'); + $this->addSql('UPDATE sylius_product_attribute_value SET locale_code = "' . $defaultLocale . '"'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); diff --git a/app/migrations/Version20170110120125.php b/app/migrations/Version20170110120125.php index 04756c67c4e..bb06ff12c77 100644 --- a/app/migrations/Version20170110120125.php +++ b/app/migrations/Version20170110120125.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_payment ADD CONSTRAINT FK_D9191BD419883967 FOREIGN KEY (method_id) REFERENCES sylius_payment_method (id)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170116215417.php b/app/migrations/Version20170116215417.php index 8a8ed150c0a..98ad326880e 100644 --- a/app/migrations/Version20170116215417.php +++ b/app/migrations/Version20170116215417.php @@ -1,5 +1,16 @@ addSql('CREATE INDEX IDX_A75B0B0DF23D6140 ON sylius_payment_method (gateway_config_id)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170117075436.php b/app/migrations/Version20170117075436.php index df2fb212b17..056e97ba262 100644 --- a/app/migrations/Version20170117075436.php +++ b/app/migrations/Version20170117075436.php @@ -1,5 +1,16 @@ addSql('UPDATE sylius_product_variant SET shipping_required = 1'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170120164250.php b/app/migrations/Version20170120164250.php index e98a633ff9f..865d4eb3dbc 100644 --- a/app/migrations/Version20170120164250.php +++ b/app/migrations/Version20170120164250.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_payment DROP credit_card_id'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170124221955.php b/app/migrations/Version20170124221955.php index d56a61e1c75..5c64d332f4f 100644 --- a/app/migrations/Version20170124221955.php +++ b/app/migrations/Version20170124221955.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_locale DROP enabled'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170201094058.php b/app/migrations/Version20170201094058.php index aef94f0ccaf..a4569861a1b 100644 --- a/app/migrations/Version20170201094058.php +++ b/app/migrations/Version20170201094058.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_taxon_image CHANGE code `type` VARCHAR(255)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170206122839.php b/app/migrations/Version20170206122839.php index 79e56df51f1..6264a14d10a 100644 --- a/app/migrations/Version20170206122839.php +++ b/app/migrations/Version20170206122839.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_order_sequence ADD version INT DEFAULT 1 NOT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170206141520.php b/app/migrations/Version20170206141520.php index 32617da589b..8040d9a387a 100644 --- a/app/migrations/Version20170206141520.php +++ b/app/migrations/Version20170206141520.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_product_variant ADD version INT DEFAULT 1 NOT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170208102345.php b/app/migrations/Version20170208102345.php index 1f743484de3..47412a6de3a 100644 --- a/app/migrations/Version20170208102345.php +++ b/app/migrations/Version20170208102345.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_product DROP available_on, DROP available_until'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170208103250.php b/app/migrations/Version20170208103250.php index 273e9d1ad54..e2c1bc77dd4 100644 --- a/app/migrations/Version20170208103250.php +++ b/app/migrations/Version20170208103250.php @@ -1,5 +1,16 @@ addSql('CREATE UNIQUE INDEX product_taxon_idx ON sylius_product_taxon (product_id, taxon_id)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170214095710.php b/app/migrations/Version20170214095710.php index c2d1f8140b2..9d0e3dacb38 100644 --- a/app/migrations/Version20170214095710.php +++ b/app/migrations/Version20170214095710.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_product_review ADD CONSTRAINT FK_C7056A99F675F31B FOREIGN KEY (author_id) REFERENCES sylius_customer (id) ON DELETE CASCADE'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170214104908.php b/app/migrations/Version20170214104908.php index aad6a0b9823..50238e1039a 100644 --- a/app/migrations/Version20170214104908.php +++ b/app/migrations/Version20170214104908.php @@ -1,5 +1,16 @@ addSql('UPDATE sylius_channel SET skipping_shipping_step_allowed = 0'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170215143031.php b/app/migrations/Version20170215143031.php index 75becebf943..5672e795f2d 100644 --- a/app/migrations/Version20170215143031.php +++ b/app/migrations/Version20170215143031.php @@ -1,5 +1,16 @@ addSql('CREATE UNIQUE INDEX UNIQ_105A9084180C698989D9B62 ON sylius_product_translation (locale, slug)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170217141621.php b/app/migrations/Version20170217141621.php index d290969dc13..7a2f90b080e 100644 --- a/app/migrations/Version20170217141621.php +++ b/app/migrations/Version20170217141621.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_exchange_rate MODIFY created_at DATETIME NOT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170220150813.php b/app/migrations/Version20170220150813.php index c604dfb65c9..95902edb45a 100644 --- a/app/migrations/Version20170220150813.php +++ b/app/migrations/Version20170220150813.php @@ -1,5 +1,16 @@ addSql('UPDATE sylius_channel SET account_verification_required = 1'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170223071604.php b/app/migrations/Version20170223071604.php index c0ebf2c20f9..9d340e29697 100644 --- a/app/migrations/Version20170223071604.php +++ b/app/migrations/Version20170223071604.php @@ -1,5 +1,16 @@ addSql('CREATE UNIQUE INDEX product_variant_channel_idx ON sylius_channel_pricing (product_variant_id, channel_code)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170301135010.php b/app/migrations/Version20170301135010.php index cae2f7302e9..4e67fd7b2c7 100644 --- a/app/migrations/Version20170301135010.php +++ b/app/migrations/Version20170301135010.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_product_image_product_variants ADD CONSTRAINT FK_8FFDAE8D3B69A9AF FOREIGN KEY (variant_id) REFERENCES sylius_product_variant (id) ON DELETE CASCADE'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170303170201.php b/app/migrations/Version20170303170201.php index 6b276a33177..36ca5a5f10a 100644 --- a/app/migrations/Version20170303170201.php +++ b/app/migrations/Version20170303170201.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_channel_pricing ADD original_price INT'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170313125424.php b/app/migrations/Version20170313125424.php index afe70d9d943..7a30fa0881c 100644 --- a/app/migrations/Version20170313125424.php +++ b/app/migrations/Version20170313125424.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_admin_api_refresh_token ADD CONSTRAINT FK_9160E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES sylius_admin_user (id)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170321131352.php b/app/migrations/Version20170321131352.php index dfe7af8e79d..340e3468336 100644 --- a/app/migrations/Version20170321131352.php +++ b/app/migrations/Version20170321131352.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_product_variant DROP available_on, DROP available_until'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170327135945.php b/app/migrations/Version20170327135945.php index b43f3fa1b37..b8cf2f402c1 100644 --- a/app/migrations/Version20170327135945.php +++ b/app/migrations/Version20170327135945.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_taxon MODIFY created_at DATETIME NOT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170401200415.php b/app/migrations/Version20170401200415.php index 1d165810ace..ba866ee4407 100644 --- a/app/migrations/Version20170401200415.php +++ b/app/migrations/Version20170401200415.php @@ -1,5 +1,16 @@ addSql('UPDATE sylius_channel SET skipping_payment_step_allowed = 0'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170518123056.php b/app/migrations/Version20170518123056.php index 67d78e61e71..12f14e35804 100644 --- a/app/migrations/Version20170518123056.php +++ b/app/migrations/Version20170518123056.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_address_log_entries CHANGE loggedat logged_at DATETIME NOT NULL, CHANGE objectid object_id VARCHAR(64) DEFAULT NULL, CHANGE objectclass object_class VARCHAR(255) NOT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170711151342.php b/app/migrations/Version20170711151342.php index b29e8d090a1..bd2a564de46 100644 --- a/app/migrations/Version20170711151342.php +++ b/app/migrations/Version20170711151342.php @@ -1,5 +1,16 @@ abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); @@ -36,9 +44,6 @@ public function up(Schema $schema) $this->addSql('ALTER TABLE sylius_admin_api_refresh_token ADD CONSTRAINT FK_9160E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES sylius_admin_user (id)'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { } diff --git a/app/migrations/Version20170824124122.php b/app/migrations/Version20170824124122.php index 6fc6ae4e1a9..972670e10b3 100644 --- a/app/migrations/Version20170824124122.php +++ b/app/migrations/Version20170824124122.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_order CHANGE notes notes LONGTEXT DEFAULT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20170913125128.php b/app/migrations/Version20170913125128.php index 8ddd520d375..14deca6a863 100644 --- a/app/migrations/Version20170913125128.php +++ b/app/migrations/Version20170913125128.php @@ -1,5 +1,16 @@ addSql('ALTER TABLE sylius_order_item CHANGE product_name product_name VARCHAR(255) DEFAULT NULL, CHANGE variant_name variant_name VARCHAR(255) DEFAULT NULL'); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20171003103916.php b/app/migrations/Version20171003103916.php index 8a07632ee3b..ab6db61e067 100644 --- a/app/migrations/Version20171003103916.php +++ b/app/migrations/Version20171003103916.php @@ -1,5 +1,16 @@ container = $container; } - /** - * @param Schema $schema - */ public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs @@ -63,9 +69,6 @@ public function up(Schema $schema): void } } - /** - * @param Schema $schema - */ public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs diff --git a/app/migrations/Version20180102140039.php b/app/migrations/Version20180102140039.php index 8e52bac47f4..56b9ffc3d23 100644 --- a/app/migrations/Version20180102140039.php +++ b/app/migrations/Version20180102140039.php @@ -1,5 +1,16 @@ Date: Sun, 13 Jan 2019 15:21:57 +0100 Subject: [PATCH 8/8] Apply coding standard fixes --- app/AppKernel.php | 2 +- app/TestAppKernel.php | 2 +- config/bundles.php | 13 ++++++++++++- public/index.php | 15 +++++++++++++-- src/Kernel.php | 1 - .../Tests/Functional/TemplatingTest.php | 3 --- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/AppKernel.php b/app/AppKernel.php index 411beb4c8c6..f7a457f67fc 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -15,6 +15,6 @@ declare(strict_types=1); -@trigger_error('The "AppKernel" class located at "app/AppKernel.php" is deprecated since Sylius 1.3. Use "Kernel" class located at "src/Kernel.php" instead.', E_USER_DEPRECATED); +@trigger_error('The "AppKernel" class located at "app/AppKernel.php" is deprecated since Sylius 1.3. Use "Kernel" class located at "src/Kernel.php" instead.', \E_USER_DEPRECATED); class_alias(Kernel::class, AppKernel::class); diff --git a/app/TestAppKernel.php b/app/TestAppKernel.php index aa87dd3c8f3..b12a75a8263 100644 --- a/app/TestAppKernel.php +++ b/app/TestAppKernel.php @@ -15,6 +15,6 @@ declare(strict_types=1); -@trigger_error('The "TestAppKernel" class located at "app/TestAppKernel.php" is deprecated since Sylius 1.3. Use "Kernel" class located at "src/Kernel.php" instead.', E_USER_DEPRECATED); +@trigger_error('The "TestAppKernel" class located at "app/TestAppKernel.php" is deprecated since Sylius 1.3. Use "Kernel" class located at "src/Kernel.php" instead.', \E_USER_DEPRECATED); class_alias(Kernel::class, TestAppKernel::class); diff --git a/config/bundles.php b/config/bundles.php index 7e4ff0cddb3..bd719d17cd9 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -1,5 +1,16 @@ ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], @@ -56,5 +67,5 @@ Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], - Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true] + Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], ]; diff --git a/public/index.php b/public/index.php index e6296baa88b..59130e511b0 100644 --- a/public/index.php +++ b/public/index.php @@ -1,10 +1,21 @@ load($envFile); } diff --git a/src/Kernel.php b/src/Kernel.php index b780a07eee0..0f3e3f41991 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -11,7 +11,6 @@ declare(strict_types=1); -use ProxyManager\Proxy\VirtualProxyInterface; use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\DelegatingLoader; diff --git a/src/Sylius/Bundle/ThemeBundle/Tests/Functional/TemplatingTest.php b/src/Sylius/Bundle/ThemeBundle/Tests/Functional/TemplatingTest.php index 4b5ab50c7fb..0e53428251c 100644 --- a/src/Sylius/Bundle/ThemeBundle/Tests/Functional/TemplatingTest.php +++ b/src/Sylius/Bundle/ThemeBundle/Tests/Functional/TemplatingTest.php @@ -92,9 +92,6 @@ public function it_renders_sylius_plugin_templates_using_namespaced_paths(string $this->assertEquals($contents, trim($crawler->text())); } - /** - * @return array - */ public function getPluginTemplatesUsingNamespacedPaths(): array { return [