diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..b565f6d58 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +# ignore .git (can be volume-mounted in development environment) +.git + +# ignore directories with meta-data +.idea +nbproject + +# ignore directories that should be created and filled during the image build +node_modules +var +!var/.gitkeep +web/assets/scripts +web/bundles +web/components +web/content +vendor + +# ignore kubernetes manifests +kubernetes + +# ignore docker configs for other images than php-fpm, and the php-fpm's Dockerfile itself +docker +!docker/php-fpm +docker/php-fpm/Dockerfile diff --git a/CHANGELOG.md b/CHANGELOG.md index fd23d727e..26568742c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,9 +26,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [#19 - Table tags and inline styles can be used in ckEditor for email templates](https://github.com/shopsys/demoshop/pull/19) - `ivory_ck_editor.yml` is updated so email templates wysiwyg can parse table tags and inline styles for all elements - datafixtures for email templates are added so demoshop has now customized emails +- [#27 - Upgrade to shopsys framework 7.0.0-beta4](https://github.com/shopsys/demoshop/pull/27) + - renamed Database tests to Functional tests + - content-test directory is used instead of content during the test + - updated coding standards and applied + - registered new form types (OrderItemsType, DisplayOnlyCustomerType) + - OrderFormType in Admin is extended on a class level. No need to extend twig template anymore + - block loading of original data fixtures, if overridden + - Shopsys\FrameworkBundle\DataFixtures\Demo\MailTemplateDataFixture blocked from loading, because its overridden in ShopBundle + - Shopsys\FrameworkBundle\DataFixtures\Demo\MultidomainMailTemplateDataFixture blocked from loading, because its overridden in ShopBundle + - fixed wrong links in mail template data fixtures ### Fixed - [#8 - Category now has second description attribute that is displayed on the product list page above the product list](https://github.com/shopsys/demoshop/pull/8) - GoogleFeedItemFactory: removed unused imports -[@LukasHeinz]:(https://github.com/LukasHeinz) \ No newline at end of file +[@LukasHeinz]:(https://github.com/LukasHeinz) diff --git a/app/Environment.php b/app/Environment.php index 55e82f94c..07311a53e 100644 --- a/app/Environment.php +++ b/app/Environment.php @@ -22,12 +22,11 @@ public static function checkEnvironment(Event $event) $io = $event->getIO(); /* @var $io \Composer\IO\IOInterface */ $environmentFileSetting = self::getEnvironmentFileSetting(); - if ($io->isInteractive() && !$environmentFileSetting->isAnyEnvironmentSet()) { - if ($io->askConfirmation('Build in production environment? (Y/n): ', true)) { - $environmentFileSetting->createFileForEnvironment(EnvironmentType::PRODUCTION); - } else { - $environmentFileSetting->createFileForEnvironment(EnvironmentType::DEVELOPMENT); - } + if (!$environmentFileSetting->isAnyEnvironmentSet()) { + $environment = $event->isDevMode() ? EnvironmentType::DEVELOPMENT : EnvironmentType::PRODUCTION; + $environmentFileSetting->createFileForEnvironment($environment); + $environmentFilePath = $environmentFileSetting->getEnvironmentFilePath($environment); + $io->write(sprintf('Created a file "%s" to set the application environment!', $environmentFilePath)); } self::printEnvironmentInfo($io); } diff --git a/app/Resources/ShopsysFrameworkBundle/views/Admin/Content/Order/edit.html.twig b/app/Resources/ShopsysFrameworkBundle/views/Admin/Content/Order/edit.html.twig deleted file mode 100644 index 4352eff67..000000000 --- a/app/Resources/ShopsysFrameworkBundle/views/Admin/Content/Order/edit.html.twig +++ /dev/null @@ -1,256 +0,0 @@ -{% extends '@!ShopsysFramework/Admin/Content/Order/edit.html.twig' %} -{% import '@ShopsysFramework/Admin/Content/Order/orderItem.html.twig' as orderItemMacro %} -{% block main_content %} - {{ form_start(form) }} - {{ form_errors(form) }} -
Vážený zákaznÃku, - VaÅ¡e objednávka {number} se zpracovává. VÃce informacà o VaÅ¡Ã objednávce naleznete zde. + VaÅ¡e objednávka {number} se zpracovává. VÃce informacà o VaÅ¡Ã objednávce naleznete zde. @@ -319,7 +324,7 @@ public function load(ObjectManager $manager) | Vážený zákaznÃku, na základÄ› vaÅ¡eho zadaného emailu {e-mail}, Vám zasÃláme odkaz na zobrazenà osobnÃch údajů. Klikem na odkaz nÞe se dostanete na stránku s pÅ™ehledem vÅ¡ech osobnÃch údajů, které k VaÅ¡emu e-mailu evidujeme na naÅ¡em e-shopu {domain}. - Pro zobrazenà osobnÃch údajů kliknÄ›te zde. + Pro zobrazenà osobnÃch údajů kliknÄ›te zde. Odkaz je platný 24 hodin. S pozdravem @@ -358,7 +363,7 @@ public function load(ObjectManager $manager) Klikem na odkaz se dostanete na stránku s možnostà staženà tÄ›chto informacÃ, které k VaÅ¡emu e-mailu evidujeme na naÅ¡em eshopu {domain}. - Pro pÅ™echod na staženà údajů, prosÃm, kliknÄ›te zde . + Pro pÅ™echod na staženà údajů, prosÃm, kliknÄ›te zde . Odkaz je platný 24 hodin. S pozdravem diff --git a/src/Shopsys/ShopBundle/Form/Admin/CategoryFormTypeExtension.php b/src/Shopsys/ShopBundle/Form/Admin/CategoryFormTypeExtension.php index 50704541d..34102545c 100644 --- a/src/Shopsys/ShopBundle/Form/Admin/CategoryFormTypeExtension.php +++ b/src/Shopsys/ShopBundle/Form/Admin/CategoryFormTypeExtension.php @@ -37,10 +37,10 @@ public function buildForm(FormBuilderInterface $builder, array $options) } /** - * @param FormBuilderInterface $builder + * @param \Symfony\Component\Form\FormBuilderInterface $builder * @param string $name * @param array $options - * @return FormBuilderInterface + * @return \Symfony\Component\Form\FormBuilderInterface */ protected function rebuildChildWithAdditionalOptions(FormBuilderInterface $builder, string $name, array $options): FormBuilderInterface { diff --git a/src/Shopsys/ShopBundle/Form/Admin/OrderFormTypeExtension.php b/src/Shopsys/ShopBundle/Form/Admin/OrderFormTypeExtension.php new file mode 100644 index 000000000..fd1a2162c --- /dev/null +++ b/src/Shopsys/ShopBundle/Form/Admin/OrderFormTypeExtension.php @@ -0,0 +1,75 @@ +getPickUpPlace() !== null) { + // Place pickup place group before noteGroup and orderItems + $noteGroup = $builder->get('noteGroup'); + $builder->remove('noteGroup'); + $itemsGroup = $builder->get('orderItems'); + $builder->remove('orderItems'); + + $builder->add($this->createPickupPlaceGroup($builder, $order->getPickUpPlace())); + + $builder->add($noteGroup); + $builder->add($itemsGroup); + } + } + + /** + * @param \Symfony\Component\Form\FormBuilderInterface $formBuilder + * @param \Shopsys\ShopBundle\Model\PickUpPlace\PickUpPlace $pickUpPlace + * @return \Symfony\Component\Form\FormBuilderInterface + */ + private function createPickupPlaceGroup(FormBuilderInterface $formBuilder, PickUpPlace $pickUpPlace): FormBuilderInterface + { + $pickupPlaceGroup = $formBuilder->create('pickupPlaceGroup', GroupType::class, [ + 'label' => t('Zasilkovna.cz - dispensing point'), + ]); + + $pickupPlaceGroup + ->add('id', DisplayOnlyType::class, [ + 'label' => t('Id'), + 'data' => $pickUpPlace->getId(), + ]) + ->add('name', DisplayOnlyType::class, [ + 'label' => t('Name'), + 'data' => $pickUpPlace->getName(), + ]) + ->add('address', DisplayOnlyType::class, [ + 'label' => t('Address'), + 'data' => $pickUpPlace->getFullAddress(), + ]) + ->add('description', DisplayOnlyType::class, [ + 'label' => t('Description'), + 'data' => $pickUpPlace->getDescription(), + ]); + + return $pickupPlaceGroup; + } + + /** + * {@inheritdoc} + */ + public function getExtendedType() + { + return OrderFormType::class; + } +} diff --git a/src/Shopsys/ShopBundle/Form/Admin/ProductFormTypeExtension.php b/src/Shopsys/ShopBundle/Form/Admin/ProductFormTypeExtension.php index 09fb89981..303a7ce99 100644 --- a/src/Shopsys/ShopBundle/Form/Admin/ProductFormTypeExtension.php +++ b/src/Shopsys/ShopBundle/Form/Admin/ProductFormTypeExtension.php @@ -15,6 +15,9 @@ class ProductFormTypeExtension extends AbstractTypeExtension */ private $productConditionFacade; + /** + * @param \Shopsys\ShopBundle\Model\Product\ProductConditionFacade $productConditionFacade + */ public function __construct(ProductConditionFacade $productConditionFacade) { $this->productConditionFacade = $productConditionFacade; diff --git a/src/Shopsys/ShopBundle/Form/Front/Customer/BillingAddressFormType.php b/src/Shopsys/ShopBundle/Form/Front/Customer/BillingAddressFormType.php index 0d94ed726..a5eaced31 100644 --- a/src/Shopsys/ShopBundle/Form/Front/Customer/BillingAddressFormType.php +++ b/src/Shopsys/ShopBundle/Form/Front/Customer/BillingAddressFormType.php @@ -23,6 +23,9 @@ class BillingAddressFormType extends AbstractType */ private $countryFacade; + /** + * @param \Shopsys\FrameworkBundle\Model\Country\CountryFacade $countryFacade + */ public function __construct(CountryFacade $countryFacade) { $this->countryFacade = $countryFacade; diff --git a/src/Shopsys/ShopBundle/Form/Front/Customer/CustomerFormType.php b/src/Shopsys/ShopBundle/Form/Front/Customer/CustomerFormType.php index 41e670f39..8eefbfa1a 100644 --- a/src/Shopsys/ShopBundle/Form/Front/Customer/CustomerFormType.php +++ b/src/Shopsys/ShopBundle/Form/Front/Customer/CustomerFormType.php @@ -15,6 +15,9 @@ class CustomerFormType extends AbstractType */ private $customerDataFactory; + /** + * @param \Shopsys\FrameworkBundle\Model\Customer\CustomerDataFactoryInterface $customerDataFactory + */ public function __construct(CustomerDataFactoryInterface $customerDataFactory) { $this->customerDataFactory = $customerDataFactory; diff --git a/src/Shopsys/ShopBundle/Form/Front/Customer/DeliveryAddressFormType.php b/src/Shopsys/ShopBundle/Form/Front/Customer/DeliveryAddressFormType.php index bf4a45def..f275974f2 100644 --- a/src/Shopsys/ShopBundle/Form/Front/Customer/DeliveryAddressFormType.php +++ b/src/Shopsys/ShopBundle/Form/Front/Customer/DeliveryAddressFormType.php @@ -23,6 +23,9 @@ class DeliveryAddressFormType extends AbstractType */ private $countryFacade; + /** + * @param \Shopsys\FrameworkBundle\Model\Country\CountryFacade $countryFacade + */ public function __construct(CountryFacade $countryFacade) { $this->countryFacade = $countryFacade; diff --git a/src/Shopsys/ShopBundle/Form/Front/Order/DomainAwareOrderFlowFactory.php b/src/Shopsys/ShopBundle/Form/Front/Order/DomainAwareOrderFlowFactory.php index c390d5c18..0d958476b 100644 --- a/src/Shopsys/ShopBundle/Form/Front/Order/DomainAwareOrderFlowFactory.php +++ b/src/Shopsys/ShopBundle/Form/Front/Order/DomainAwareOrderFlowFactory.php @@ -38,6 +38,10 @@ class DomainAwareOrderFlowFactory implements OrderFlowFactoryInterface /** * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain + * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher + * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack + * @param \Symfony\Component\Form\FormFactoryInterface $formFactory + * @param \Craue\FormFlowBundle\Storage\DataManager $dataManager */ public function __construct( Domain $domain, diff --git a/src/Shopsys/ShopBundle/Form/Front/Order/OrderFlow.php b/src/Shopsys/ShopBundle/Form/Front/Order/OrderFlow.php index 333b52179..8b19f7364 100644 --- a/src/Shopsys/ShopBundle/Form/Front/Order/OrderFlow.php +++ b/src/Shopsys/ShopBundle/Form/Front/Order/OrderFlow.php @@ -119,7 +119,7 @@ public function bind($formData) } /** - * @return StepInterface|null + * @return \Craue\FormFlowBundle\Form\StepInterface|null */ private function getFirstInvalidStep() { diff --git a/src/Shopsys/ShopBundle/Form/Front/Order/PersonalInfoFormType.php b/src/Shopsys/ShopBundle/Form/Front/Order/PersonalInfoFormType.php index 3436266e9..6388bfc56 100644 --- a/src/Shopsys/ShopBundle/Form/Front/Order/PersonalInfoFormType.php +++ b/src/Shopsys/ShopBundle/Form/Front/Order/PersonalInfoFormType.php @@ -42,6 +42,11 @@ class PersonalInfoFormType extends AbstractType */ private $domain; + /** + * @param \Shopsys\FrameworkBundle\Model\Country\CountryFacade $countryFacade + * @param \Shopsys\FrameworkBundle\Model\Heureka\HeurekaFacade $heurekaFacade + * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain + */ public function __construct(CountryFacade $countryFacade, HeurekaFacade $heurekaFacade, Domain $domain) { $this->countryFacade = $countryFacade; diff --git a/src/Shopsys/ShopBundle/Model/AdminNavigation/SideMenuBuilder.php b/src/Shopsys/ShopBundle/Model/AdminNavigation/SideMenuBuilder.php index cbe204101..10c036052 100644 --- a/src/Shopsys/ShopBundle/Model/AdminNavigation/SideMenuBuilder.php +++ b/src/Shopsys/ShopBundle/Model/AdminNavigation/SideMenuBuilder.php @@ -7,6 +7,9 @@ class SideMenuBuilder extends BaseSideMenuBuilder { + /** + * @return \Knp\Menu\ItemInterface + */ protected function createSettingsMenu(): ItemInterface { $menu = parent::createSettingsMenu(); diff --git a/src/Shopsys/ShopBundle/Model/Category/CurrentCategoryResolver.php b/src/Shopsys/ShopBundle/Model/Category/CurrentCategoryResolver.php index 5f22d3c6a..992eb2a77 100644 --- a/src/Shopsys/ShopBundle/Model/Category/CurrentCategoryResolver.php +++ b/src/Shopsys/ShopBundle/Model/Category/CurrentCategoryResolver.php @@ -18,6 +18,10 @@ class CurrentCategoryResolver */ private $productFacade; + /** + * @param \Shopsys\FrameworkBundle\Model\Category\CategoryFacade $categoryFacade + * @param \Shopsys\FrameworkBundle\Model\Product\ProductFacade $productFacade + */ public function __construct( CategoryFacade $categoryFacade, ProductFacade $productFacade diff --git a/src/Shopsys/ShopBundle/Model/Customer/BillingAddressFacade.php b/src/Shopsys/ShopBundle/Model/Customer/BillingAddressFacade.php index 584303aab..c284e593c 100644 --- a/src/Shopsys/ShopBundle/Model/Customer/BillingAddressFacade.php +++ b/src/Shopsys/ShopBundle/Model/Customer/BillingAddressFacade.php @@ -17,6 +17,7 @@ class BillingAddressFacade protected $billingAddressRepository; /** + * @param \Doctrine\ORM\EntityManagerInterface $em * @param \Shopsys\ShopBundle\Model\Customer\BillingAddressRepository $billingAddressRepository */ public function __construct( diff --git a/src/Shopsys/ShopBundle/Model/Customer/CustomerData.php b/src/Shopsys/ShopBundle/Model/Customer/CustomerData.php index 9ad621761..d235e1de3 100644 --- a/src/Shopsys/ShopBundle/Model/Customer/CustomerData.php +++ b/src/Shopsys/ShopBundle/Model/Customer/CustomerData.php @@ -14,6 +14,11 @@ class CustomerData extends BaseCustomerData */ public $companyUsersData; + /** + * @param \Shopsys\FrameworkBundle\Model\Customer\BillingAddressData $billingAddressData + * @param \Shopsys\FrameworkBundle\Model\Customer\DeliveryAddressData $deliveryAddressData + * @param \Shopsys\FrameworkBundle\Model\Customer\UserData $userData + */ public function __construct( BillingAddressData $billingAddressData, DeliveryAddressData $deliveryAddressData, diff --git a/src/Shopsys/ShopBundle/Model/Customer/CustomerFacade.php b/src/Shopsys/ShopBundle/Model/Customer/CustomerFacade.php index 2f9825fd1..3f6688988 100644 --- a/src/Shopsys/ShopBundle/Model/Customer/CustomerFacade.php +++ b/src/Shopsys/ShopBundle/Model/Customer/CustomerFacade.php @@ -32,6 +32,8 @@ class CustomerFacade extends BaseCustomerFacade * @param \Shopsys\FrameworkBundle\Model\Customer\Mail\CustomerMailFacade $customerMailFacade * @param \Shopsys\FrameworkBundle\Model\Customer\BillingAddressFactoryInterface $billingAddressFactory * @param \Shopsys\FrameworkBundle\Model\Customer\BillingAddressDataFactoryInterface $billingAddressDataFactory + * @param \Shopsys\FrameworkBundle\Model\Customer\CustomerDataFactoryInterface $customerDataFactory + * @param \Shopsys\FrameworkBundle\Model\Customer\UserFactoryInterface $userFactory */ public function __construct( EntityManagerInterface $em, diff --git a/src/Shopsys/ShopBundle/Model/Customer/Exception/DuplicateEmailsException.php b/src/Shopsys/ShopBundle/Model/Customer/Exception/DuplicateEmailsException.php index 3ba107a36..6fabe3014 100644 --- a/src/Shopsys/ShopBundle/Model/Customer/Exception/DuplicateEmailsException.php +++ b/src/Shopsys/ShopBundle/Model/Customer/Exception/DuplicateEmailsException.php @@ -13,6 +13,7 @@ class DuplicateEmailsException extends Exception implements CustomerException private $email; /** + * @param mixed $email * @param string $message * @param \Exception|null $previous */ diff --git a/src/Shopsys/ShopBundle/Model/Order/OrderDataMapper.php b/src/Shopsys/ShopBundle/Model/Order/OrderDataMapper.php index 671f58957..2a1092791 100644 --- a/src/Shopsys/ShopBundle/Model/Order/OrderDataMapper.php +++ b/src/Shopsys/ShopBundle/Model/Order/OrderDataMapper.php @@ -15,6 +15,10 @@ class OrderDataMapper extends BaseOrderDataMapper */ protected $countryFacade; + /** + * @param \Shopsys\FrameworkBundle\Model\Order\OrderDataFactoryInterface $orderDataFactory + * @param \Shopsys\ShopBundle\Model\Country\CountryFacade $countryFacade + */ public function __construct(OrderDataFactoryInterface $orderDataFactory, CountryFacade $countryFacade) { parent::__construct($orderDataFactory); @@ -41,6 +45,10 @@ public function getOrderDataFromFrontOrderData(BaseFrontOrderData $frontOrderDat return $orderData; } + /** + * @param \Shopsys\ShopBundle\Model\Order\OrderData $orderData + * @param \Shopsys\ShopBundle\Model\Order\FrontOrderData $frontOrderData + */ private function fillPickUpPlaceDeliveryData(OrderData $orderData, FrontOrderData $frontOrderData) { $orderData->deliveryFirstName = $frontOrderData->firstName; diff --git a/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceFacade.php b/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceFacade.php index 8b743b254..2d48d09db 100644 --- a/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceFacade.php +++ b/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceFacade.php @@ -29,6 +29,12 @@ class PickUpPlaceFacade */ protected $countryFacade; + /** + * @param \Shopsys\ShopBundle\Model\PickUpPlace\PickUpPlaceRepository $pickUpPlaceRepository + * @param \Doctrine\ORM\EntityManagerInterface $em + * @param \Shopsys\ShopBundle\Model\PickUpPlace\PickUpPlaceLoader $pickUpPlaceLoader + * @param \Shopsys\ShopBundle\Model\Country\CountryFacade $countryFacade + */ public function __construct( PickUpPlaceRepository $pickUpPlaceRepository, EntityManagerInterface $em, diff --git a/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceIdToEntityTransformer.php b/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceIdToEntityTransformer.php index 6fd33adaa..8bd49a0e9 100644 --- a/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceIdToEntityTransformer.php +++ b/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceIdToEntityTransformer.php @@ -12,6 +12,9 @@ class PickUpPlaceIdToEntityTransformer implements DataTransformerInterface */ protected $pickUpPlaceFacade; + /** + * @param \Shopsys\ShopBundle\Model\PickUpPlace\PickUpPlaceFacade $pickUpPlaceFacade + */ public function __construct(PickUpPlaceFacade $pickUpPlaceFacade) { $this->pickUpPlaceFacade = $pickUpPlaceFacade; @@ -19,6 +22,7 @@ public function __construct(PickUpPlaceFacade $pickUpPlaceFacade) /** * @var \Shopsys\ShopBundle\Model\PickUpPlace\PickUpPlace + * @param mixed $pickUpPlace * @return int|null */ public function transform($pickUpPlace) @@ -31,6 +35,7 @@ public function transform($pickUpPlace) /** * @var int|null + * @param mixed $pickUpPlaceId * @return null|\Shopsys\ShopBundle\Model\PickUpPlace\PickUpPlace */ public function reverseTransform($pickUpPlaceId) diff --git a/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceRepository.php b/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceRepository.php index 933cc7ce3..e26269d3a 100644 --- a/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceRepository.php +++ b/src/Shopsys/ShopBundle/Model/PickUpPlace/PickUpPlaceRepository.php @@ -13,6 +13,9 @@ class PickUpPlaceRepository */ protected $em; + /** + * @param \Doctrine\ORM\EntityManagerInterface $em + */ public function __construct( EntityManagerInterface $em ) { @@ -118,6 +121,7 @@ public function deactivateAllPendingByTransportType($transportType) /** * @param string|null $searchQuery + * @param mixed $countryCodes * @param $transportType * @return \Shopsys\ShopBundle\Model\PickUpPlace\PickUpPlace[] */ diff --git a/src/Shopsys/ShopBundle/Model/Product/Feed/Google/GoogleFeedItem.php b/src/Shopsys/ShopBundle/Model/Product/Feed/Google/GoogleFeedItem.php index 4c42f372c..da6cca5c0 100644 --- a/src/Shopsys/ShopBundle/Model/Product/Feed/Google/GoogleFeedItem.php +++ b/src/Shopsys/ShopBundle/Model/Product/Feed/Google/GoogleFeedItem.php @@ -13,6 +13,20 @@ class GoogleFeedItem extends BaseGoogleFeedItem */ private $condition; + /** + * @param int $id + * @param string $name + * @param string|null $brandName + * @param string|null $description + * @param string|null $ean + * @param string|null $partno + * @param string $url + * @param string|null $imgUrl + * @param bool $sellingDenied + * @param \Shopsys\FrameworkBundle\Model\Pricing\Price $price + * @param \Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency $currency + * @param string $condition + */ public function __construct( int $id, string $name, diff --git a/src/Shopsys/ShopBundle/Model/Product/Product.php b/src/Shopsys/ShopBundle/Model/Product/Product.php index 0ab7e12cc..6dcbf50b8 100644 --- a/src/Shopsys/ShopBundle/Model/Product/Product.php +++ b/src/Shopsys/ShopBundle/Model/Product/Product.php @@ -51,6 +51,7 @@ public static function createMainVariant(BaseProductData $productData, array $va /** * @param \Shopsys\FrameworkBundle\Model\Product\ProductCategoryDomainFactoryInterface $productCategoryDomainFactory + * @param \Shopsys\FrameworkBundle\Model\Product\ProductData $productData * @param \Shopsys\ShopBundle\Model\Product\ProductData */ public function edit( diff --git a/src/Shopsys/ShopBundle/Resources/config/forms.yml b/src/Shopsys/ShopBundle/Resources/config/forms.yml index 79383cc9a..7dbd168ee 100644 --- a/src/Shopsys/ShopBundle/Resources/config/forms.yml +++ b/src/Shopsys/ShopBundle/Resources/config/forms.yml @@ -27,6 +27,10 @@ services: tags: - { name: form.type_extension, extended_type: Shopsys\FrameworkBundle\Form\Admin\Customer\CustomerFormType } + Shopsys\ShopBundle\Form\Admin\OrderFormTypeExtension: + tags: + - { name: form.type_extension, extended_type: Shopsys\FrameworkBundle\Form\Admin\Order\OrderFormType } + Shopsys\ShopBundle\Form\Admin\TransportFormTypeExtension: tags: - { name: form.type_extension, extended_type: Shopsys\FrameworkBundle\Form\Admin\Transport\TransportFormType } diff --git a/src/Shopsys/ShopBundle/Resources/config/services.yml b/src/Shopsys/ShopBundle/Resources/config/services.yml index 6ab800c45..e712175dd 100644 --- a/src/Shopsys/ShopBundle/Resources/config/services.yml +++ b/src/Shopsys/ShopBundle/Resources/config/services.yml @@ -40,6 +40,10 @@ services: Shopsys\ShopBundle\Form\Front\Order\DomainAwareOrderFlowFactory: ~ + # Don't load data fixtures from FrameworkBundle, because they are overridden in ShopBundle + Shopsys\FrameworkBundle\DataFixtures\Demo\MailTemplateDataFixture: ~ + Shopsys\FrameworkBundle\DataFixtures\Demo\MultidomainMailTemplateDataFixture: ~ + Shopsys\FrameworkBundle\Model\Order\OrderFlowFactoryInterface: '@Shopsys\ShopBundle\Form\Front\Order\DomainAwareOrderFlowFactory' Shopsys\FrameworkBundle\Model\Article\ArticleFactoryInterface: '@Shopsys\ShopBundle\Model\Article\ArticleFactory' diff --git a/src/Shopsys/ShopBundle/Resources/config/services_test.yml b/src/Shopsys/ShopBundle/Resources/config/services_test.yml index 729757720..af2242454 100644 --- a/src/Shopsys/ShopBundle/Resources/config/services_test.yml +++ b/src/Shopsys/ShopBundle/Resources/config/services_test.yml @@ -12,7 +12,7 @@ services: Shopsys\FrameworkBundle\Model\Localization\IntlCurrencyRepository: ~ Shopsys\FrameworkBundle\Component\EntityExtension\EntityNameResolver: - class: Tests\ShopBundle\Database\EntityExtension\OverwritableEntityNameResolver + class: Tests\ShopBundle\Functional\EntityExtension\OverwritableEntityNameResolver arguments: - "%shopsys.entity_extension.map%" @@ -29,7 +29,7 @@ services: Symfony\Component\Filesystem\Filesystem: ~ joschi127_doctrine_entity_override.event_subscriber.load_orm_metadata: - class: Tests\ShopBundle\Database\EntityExtension\OverwritableLoadORMMetadataSubscriber + class: Tests\ShopBundle\Functional\EntityExtension\OverwritableLoadORMMetadataSubscriber arguments: - "@service_container" - "%shopsys.entity_extension.map%" diff --git a/src/Shopsys/ShopBundle/Resources/views/Admin/Form/displayOnlyCustomer.html.twig b/src/Shopsys/ShopBundle/Resources/views/Admin/Form/displayOnlyCustomer.html.twig new file mode 100644 index 000000000..bdd349759 --- /dev/null +++ b/src/Shopsys/ShopBundle/Resources/views/Admin/Form/displayOnlyCustomer.html.twig @@ -0,0 +1,18 @@ +{% block display_only_customer_widget %} +
+
+{% endblock display_only_customer_widget %}
diff --git a/tests/ShopBundle/Acceptance/acceptance/AdminProductAdvancedSearchCest.php b/tests/ShopBundle/Acceptance/acceptance/AdminProductAdvancedSearchCest.php
index ecaab2580..7320850b4 100644
--- a/tests/ShopBundle/Acceptance/acceptance/AdminProductAdvancedSearchCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/AdminProductAdvancedSearchCest.php
@@ -8,6 +8,11 @@
class AdminProductAdvancedSearchCest
{
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\ProductAdvancedSearchPage $productAdvancedSearchPage
+ */
public function testSearchByCatnum(
AcceptanceTester $me,
LoginPage $loginPage,
diff --git a/tests/ShopBundle/Acceptance/acceptance/AdministratorLoginCest.php b/tests/ShopBundle/Acceptance/acceptance/AdministratorLoginCest.php
index 22ecd6c46..17933d02f 100644
--- a/tests/ShopBundle/Acceptance/acceptance/AdministratorLoginCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/AdministratorLoginCest.php
@@ -7,12 +7,20 @@
class AdministratorLoginCest
{
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ */
public function testSuccessfulLogin(AcceptanceTester $me, LoginPage $loginPage)
{
$me->wantTo('login on admin with valid data');
$loginPage->loginAsAdmin();
}
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ */
public function testLoginWithInvalidUsername(AcceptanceTester $me, LoginPage $loginPage)
{
$me->wantTo('login on admin with nonexistent username');
@@ -20,6 +28,10 @@ public function testLoginWithInvalidUsername(AcceptanceTester $me, LoginPage $lo
$loginPage->assertLoginFailed();
}
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ */
public function testLoginWithInvalidPassword(AcceptanceTester $me, LoginPage $loginPage)
{
$me->wantTo('login on admin with invalid password');
diff --git a/tests/ShopBundle/Acceptance/acceptance/CartCest.php b/tests/ShopBundle/Acceptance/acceptance/CartCest.php
index 51f8c8c0a..588c8b883 100644
--- a/tests/ShopBundle/Acceptance/acceptance/CartCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/CartCest.php
@@ -12,6 +12,13 @@
class CartCest
{
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartPage $cartPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductDetailPage $productDetailPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartBoxPage $cartBoxPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\FloatingWindowPage $floatingWindowPage
+ */
public function testAddingSameProductToCartMakesSum(
CartPage $cartPage,
ProductDetailPage $productDetailPage,
@@ -35,6 +42,13 @@ public function testAddingSameProductToCartMakesSum(
$cartPage->assertProductQuantity('22" Sencor SLE 22F46DM4 HELLO KITTY', 6);
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartPage $cartPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListPage $productListPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartBoxPage $cartBoxPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\FloatingWindowPage $floatingWindowPage
+ */
public function testAddToCartFromProductListPage(
CartPage $cartPage,
ProductListPage $productListPage,
@@ -52,6 +66,13 @@ public function testAddToCartFromProductListPage(
$cartPage->assertProductPrice('Defender 2.0 SPK-480', 'CZK119.00');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartPage $cartPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\HomepagePage $homepagePage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartBoxPage $cartBoxPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\FloatingWindowPage $floatingWindowPage
+ */
public function testAddToCartFromHomepage(
CartPage $cartPage,
HomepagePage $homepagePage,
@@ -69,6 +90,12 @@ public function testAddToCartFromHomepage(
$cartPage->assertProductPrice('22" Sencor SLE 22F46DM4 HELLO KITTY', 'CZK3,499.00');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductDetailPage $productDetailPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartBoxPage $cartBoxPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\FloatingWindowPage $floatingWindowPage
+ */
public function testAddToCartFromProductDetail(
ProductDetailPage $productDetailPage,
CartBoxPage $cartBoxPage,
@@ -86,6 +113,11 @@ public function testAddToCartFromProductDetail(
$me->see('22" Sencor SLE 22F46DM4 HELLO KITTY');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartPage $cartPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductDetailPage $productDetailPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testChangeCartItemAndRecalculatePrice(
CartPage $cartPage,
ProductDetailPage $productDetailPage,
@@ -101,6 +133,11 @@ public function testChangeCartItemAndRecalculatePrice(
$cartPage->assertTotalPriceWithVat('CZK34,990.00');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartPage $cartPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductDetailPage $productDetailPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testRemovingItemsFromCart(
CartPage $cartPage,
ProductDetailPage $productDetailPage,
@@ -124,6 +161,13 @@ public function testRemovingItemsFromCart(
$me->see('Your cart is unfortunately empty.');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartPage $cartPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartBoxPage $cartBoxPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductDetailPage $productDetailPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\FloatingWindowPage $floatingWindowPage
+ */
public function testAddingDistinctProductsToCart(
CartPage $cartPage,
CartBoxPage $cartBoxPage,
@@ -148,6 +192,11 @@ public function testAddingDistinctProductsToCart(
$cartPage->assertProductIsInCartByName('Canon PIXMA iP7250');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\CartPage $cartPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductDetailPage $productDetailPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testPricingInCart(
CartPage $cartPage,
ProductDetailPage $productDetailPage,
diff --git a/tests/ShopBundle/Acceptance/acceptance/CustomerLoginCest.php b/tests/ShopBundle/Acceptance/acceptance/CustomerLoginCest.php
index 8f3cf4cc3..90a8e2014 100644
--- a/tests/ShopBundle/Acceptance/acceptance/CustomerLoginCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/CustomerLoginCest.php
@@ -8,6 +8,11 @@
class CustomerLoginCest
{
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\LoginPage $loginPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\LayoutPage $layoutPage
+ */
public function testLoginAsCustomerFromMainPage(
LoginPage $loginPage,
AcceptanceTester $me,
@@ -23,6 +28,11 @@ public function testLoginAsCustomerFromMainPage(
$me->seeCurrentPageEquals('/');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\LoginPage $loginPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\LayoutPage $layoutPage
+ */
public function testLoginAsCustomerFromCategoryPage(
LoginPage $loginPage,
AcceptanceTester $me,
@@ -38,6 +48,11 @@ public function testLoginAsCustomerFromCategoryPage(
$me->seeCurrentPageEquals('/');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\LoginPage $loginPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\LayoutPage $layoutPage
+ */
public function testLoginAsCustomerFromLoginPage(
LoginPage $loginPage,
AcceptanceTester $me,
diff --git a/tests/ShopBundle/Acceptance/acceptance/CustomerRegistrationCest.php b/tests/ShopBundle/Acceptance/acceptance/CustomerRegistrationCest.php
index 1e1c77dca..b5ae4d275 100644
--- a/tests/ShopBundle/Acceptance/acceptance/CustomerRegistrationCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/CustomerRegistrationCest.php
@@ -10,6 +10,11 @@ class CustomerRegistrationCest
{
const MINIMUM_FORM_SUBMIT_WAIT_TIME = 10;
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\RegistrationPage $registrationPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\LayoutPage $layoutPage
+ */
public function testSuccessfulRegistration(
RegistrationPage $registrationPage,
AcceptanceTester $me,
@@ -25,6 +30,10 @@ public function testSuccessfulRegistration(
$me->see('Log out');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\RegistrationPage $registrationPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testAlreadyUsedEmail(RegistrationPage $registrationPage, AcceptanceTester $me)
{
$me->wantTo('use already used email while registration');
@@ -33,6 +42,10 @@ public function testAlreadyUsedEmail(RegistrationPage $registrationPage, Accepta
$registrationPage->seeEmailError('Email no-reply@shopsys.com is already registered');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\RegistrationPage $registrationPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testPasswordMismatch(RegistrationPage $registrationPage, AcceptanceTester $me)
{
$me->wantTo('use mismatching passwords while registration');
diff --git a/tests/ShopBundle/Acceptance/acceptance/ErrorHandlingCest.php b/tests/ShopBundle/Acceptance/acceptance/ErrorHandlingCest.php
index 764c50c31..643fa2968 100644
--- a/tests/ShopBundle/Acceptance/acceptance/ErrorHandlingCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/ErrorHandlingCest.php
@@ -6,6 +6,9 @@
class ErrorHandlingCest
{
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testDisplayNotice(AcceptanceTester $me)
{
$me->wantTo('display notice error page');
diff --git a/tests/ShopBundle/Acceptance/acceptance/LoginAsCustomerCest.php b/tests/ShopBundle/Acceptance/acceptance/LoginAsCustomerCest.php
index 47404bb5d..d609ea2ec 100644
--- a/tests/ShopBundle/Acceptance/acceptance/LoginAsCustomerCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/LoginAsCustomerCest.php
@@ -8,6 +8,11 @@
class LoginAsCustomerCest
{
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ * @param \Codeception\Scenario $scenario
+ */
public function testLoginAsCustomer(AcceptanceTester $me, LoginPage $loginPage, Scenario $scenario)
{
$me->wantTo('login as a customer from admin');
diff --git a/tests/ShopBundle/Acceptance/acceptance/OrderCest.php b/tests/ShopBundle/Acceptance/acceptance/OrderCest.php
index 3f94f57b4..f0cbe288a 100644
--- a/tests/ShopBundle/Acceptance/acceptance/OrderCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/OrderCest.php
@@ -11,6 +11,11 @@
class OrderCest
{
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListPage $productListPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\OrderPage $orderPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testFormRemembersPaymentAndTransportWhenClickingBack(
ProductListPage $productListPage,
OrderPage $orderPage,
@@ -35,6 +40,11 @@ public function testFormRemembersPaymentAndTransportWhenClickingBack(
$orderPage->assertPaymentIsSelected('Cash on delivery');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListPage $productListPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\OrderPage $orderPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testFormRemembersPaymentAndTransportWhenGoingDirectlyToUrl(
ProductListPage $productListPage,
OrderPage $orderPage,
@@ -59,6 +69,11 @@ public function testFormRemembersPaymentAndTransportWhenGoingDirectlyToUrl(
$orderPage->assertPaymentIsSelected('Cash on delivery');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListPage $productListPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\OrderPage $orderPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
public function testFormRemembersFirstName(ProductListPage $productListPage, OrderPage $orderPage, AcceptanceTester $me)
{
$me->wantTo('have my first name remembered by order');
@@ -80,6 +95,12 @@ public function testFormRemembersFirstName(ProductListPage $productListPage, Ord
$orderPage->assertFirstNameIsFilled('Jan');
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListPage $productListPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\OrderPage $orderPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Test\Codeception\Helper\SymfonyHelper $symfonyHelper
+ */
public function testOrderCanBeCompletedAndHasGoogleAnalyticsTrackingIdInSource(
ProductListPage $productListPage,
OrderPage $orderPage,
@@ -103,6 +124,11 @@ private function setGoogleAnalyticsTrackingId($trackingId, ScriptFacade $scriptF
$scriptFacade->setGoogleAnalyticsTrackingId($trackingId, Domain::FIRST_DOMAIN_ID);
}
+ /**
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListPage $productListPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\OrderPage $orderPage
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ */
private function testOrderCanBeCompleted(
ProductListPage $productListPage,
OrderPage $orderPage,
diff --git a/tests/ShopBundle/Acceptance/acceptance/PageObject/AbstractPage.php b/tests/ShopBundle/Acceptance/acceptance/PageObject/AbstractPage.php
index 0afc7e26e..fc191475a 100644
--- a/tests/ShopBundle/Acceptance/acceptance/PageObject/AbstractPage.php
+++ b/tests/ShopBundle/Acceptance/acceptance/PageObject/AbstractPage.php
@@ -17,6 +17,10 @@ abstract class AbstractPage
*/
protected $tester;
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\Module\StrictWebDriver $strictWebDriver
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $tester
+ */
public function __construct(StrictWebDriver $strictWebDriver, AcceptanceTester $tester)
{
$this->webDriver = $strictWebDriver->webDriver;
diff --git a/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/HomepagePage.php b/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/HomepagePage.php
index 4ecf9da15..27b31e542 100644
--- a/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/HomepagePage.php
+++ b/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/HomepagePage.php
@@ -14,6 +14,11 @@ class HomepagePage extends AbstractPage
*/
private $productListComponent;
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\Module\StrictWebDriver $strictWebDriver
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $tester
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListComponent $productListComponent
+ */
public function __construct(
StrictWebDriver $strictWebDriver,
AcceptanceTester $tester,
diff --git a/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/ProductFilterPage.php b/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/ProductFilterPage.php
index 6a28207e1..4b26756ad 100644
--- a/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/ProductFilterPage.php
+++ b/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/ProductFilterPage.php
@@ -12,6 +12,10 @@ class ProductFilterPage extends AbstractPage
// Product filter waits for more requests before evaluation
const PRE_EVALUATION_WAIT = 2;
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\Module\StrictWebDriver $strictWebDriver
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $tester
+ */
public function __construct(StrictWebDriver $strictWebDriver, AcceptanceTester $tester)
{
parent::__construct($strictWebDriver, $tester);
diff --git a/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/ProductListPage.php b/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/ProductListPage.php
index e08ba4ad1..a6afd378e 100644
--- a/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/ProductListPage.php
+++ b/tests/ShopBundle/Acceptance/acceptance/PageObject/Front/ProductListPage.php
@@ -15,6 +15,11 @@ class ProductListPage extends AbstractPage
*/
private $productListComponent;
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\Module\StrictWebDriver $strictWebDriver
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $tester
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListComponent $productListComponent
+ */
public function __construct(
StrictWebDriver $strictWebDriver,
AcceptanceTester $tester,
diff --git a/tests/ShopBundle/Acceptance/acceptance/PaymentImageUploadCest.php b/tests/ShopBundle/Acceptance/acceptance/PaymentImageUploadCest.php
index d12084d88..0b69a6a14 100644
--- a/tests/ShopBundle/Acceptance/acceptance/PaymentImageUploadCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/PaymentImageUploadCest.php
@@ -15,6 +15,11 @@ class PaymentImageUploadCest
const TEST_IMAGE_NAME = 'paymentTestImage.png';
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\EntityEditPage $entityEditPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ */
public function testSuccessfulImageUpload(AcceptanceTester $me, EntityEditPage $entityEditPage, LoginPage $loginPage)
{
$me->wantTo('Upload an image in admin payment edit page');
diff --git a/tests/ShopBundle/Acceptance/acceptance/ProductFilterCest.php b/tests/ShopBundle/Acceptance/acceptance/ProductFilterCest.php
index 405989b32..93d29c52d 100644
--- a/tests/ShopBundle/Acceptance/acceptance/ProductFilterCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/ProductFilterCest.php
@@ -8,6 +8,11 @@
class ProductFilterCest
{
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductFilterPage $productFilterPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Front\ProductListPage $productListPage
+ */
public function testAllProductFilters(
AcceptanceTester $me,
ProductFilterPage $productFilterPage,
diff --git a/tests/ShopBundle/Acceptance/acceptance/ProductImageUploadCest.php b/tests/ShopBundle/Acceptance/acceptance/ProductImageUploadCest.php
index 3a461dafe..4ed895039 100644
--- a/tests/ShopBundle/Acceptance/acceptance/ProductImageUploadCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/ProductImageUploadCest.php
@@ -15,6 +15,11 @@ class ProductImageUploadCest
const TEST_IMAGE_NAME = 'productTestImage.png';
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\EntityEditPage $entityEditPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ */
public function testSuccessfulImageUpload(AcceptanceTester $me, EntityEditPage $entityEditPage, LoginPage $loginPage)
{
$me->wantTo('upload image in admin product edit page');
diff --git a/tests/ShopBundle/Acceptance/acceptance/PromoCodeInlineEditCest.php b/tests/ShopBundle/Acceptance/acceptance/PromoCodeInlineEditCest.php
index ca80ff72e..9b926fe56 100644
--- a/tests/ShopBundle/Acceptance/acceptance/PromoCodeInlineEditCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/PromoCodeInlineEditCest.php
@@ -8,6 +8,11 @@
class PromoCodeInlineEditCest
{
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\InlineEditPage $inlineEditPage
+ */
public function testPromoCodeEdit(AcceptanceTester $me, LoginPage $loginPage, InlineEditPage $inlineEditPage)
{
$me->wantTo('promo code can be edited via inline edit');
@@ -21,6 +26,11 @@ public function testPromoCodeEdit(AcceptanceTester $me, LoginPage $loginPage, In
$inlineEditPage->assertSeeInColumn(1, 'code', 'test edited');
}
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\InlineEditPage $inlineEditPage
+ */
public function testPromoCodeCreate(AcceptanceTester $me, LoginPage $loginPage, InlineEditPage $inlineEditPage)
{
$me->wantTo('promo code can be created via inline edit');
@@ -38,6 +48,11 @@ public function testPromoCodeCreate(AcceptanceTester $me, LoginPage $loginPage,
$inlineEditPage->assertSeeInColumn($newRowId, 'percent', '5%');
}
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\InlineEditPage $inlineEditPage
+ */
public function testPromoCodeDelete(AcceptanceTester $me, LoginPage $loginPage, InlineEditPage $inlineEditPage)
{
$me->wantTo('promo code can be deleted via inline edit');
diff --git a/tests/ShopBundle/Acceptance/acceptance/TransportImageUploadCest.php b/tests/ShopBundle/Acceptance/acceptance/TransportImageUploadCest.php
index ab468de68..ab526bd07 100644
--- a/tests/ShopBundle/Acceptance/acceptance/TransportImageUploadCest.php
+++ b/tests/ShopBundle/Acceptance/acceptance/TransportImageUploadCest.php
@@ -15,6 +15,11 @@ class TransportImageUploadCest
const TEST_IMAGE_NAME = 'transportTestImage.png';
+ /**
+ * @param \Tests\ShopBundle\Test\Codeception\AcceptanceTester $me
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\EntityEditPage $entityEditPage
+ * @param \Tests\ShopBundle\Acceptance\acceptance\PageObject\Admin\LoginPage $loginPage
+ */
public function testSuccessfulImageUpload(AcceptanceTester $me, EntityEditPage $entityEditPage, LoginPage $loginPage)
{
$me->wantTo('Upload an image in admin transport edit page');
diff --git a/tests/ShopBundle/Database/Component/Javascript/Compiler/Constant/Testclass.php b/tests/ShopBundle/Database/Component/Javascript/Compiler/Constant/Testclass.php
deleted file mode 100644
index 418e17b40..000000000
--- a/tests/ShopBundle/Database/Component/Javascript/Compiler/Constant/Testclass.php
+++ /dev/null
@@ -1,10 +0,0 @@
-em->getConfiguration();
$metadataDriverChain = $configuration->getMetadataDriverImpl();
if ($metadataDriverChain instanceof MappingDriverChain) {
- $metadataDriverChain->addDriver($driver, 'Tests\\ShopBundle\\Database\\EntityExtension');
+ $metadataDriverChain->addDriver($driver, 'Tests\\ShopBundle\\Functional\\EntityExtension');
} else {
$this->fail(sprintf('Metadata driver must be type of %s', MappingDriverChain::class));
}
@@ -110,9 +110,9 @@ public function overwriteEntityExtensionMapInServicesInContainer(array $entityEx
$entityExtensionMap = array_merge($originalEntityExtensionMap, $entityExtensionMap);
$loadORMMetadataSubscriber = $this->getContainer()->get('joschi127_doctrine_entity_override.event_subscriber.load_orm_metadata');
- /* @var $loadORMMetadataSubscriber \Tests\ShopBundle\Database\EntityExtension\OverwritableLoadORMMetadataSubscriber */
+ /* @var $loadORMMetadataSubscriber \Tests\ShopBundle\Functional\EntityExtension\OverwritableLoadORMMetadataSubscriber */
$entityNameResolver = $this->getContainer()->get(EntityNameResolver::class);
- /* @var $entityNameResolver \Tests\ShopBundle\Database\EntityExtension\OverwritableEntityNameResolver */
+ /* @var $entityNameResolver \Tests\ShopBundle\Functional\EntityExtension\OverwritableEntityNameResolver */
$loadORMMetadataSubscriber->overwriteEntityExtensionMap($entityExtensionMap);
$entityNameResolver->overwriteEntityExtensionMap($entityExtensionMap);
@@ -275,7 +275,7 @@ private function doTestExtendedProductPersistence(): void
/**
* @param int $id
- * @return \Tests\ShopBundle\Database\EntityExtension\Model\ExtendedProduct
+ * @return \Tests\ShopBundle\Functional\EntityExtension\Model\ExtendedProduct
*/
private function getProduct(int $id): ExtendedProduct
{
@@ -400,7 +400,7 @@ private function doTestExtendedCategoryPersistence(): void
/**
* @param int $id
- * @return \Tests\ShopBundle\Database\EntityExtension\Model\ExtendedCategory
+ * @return \Tests\ShopBundle\Functional\EntityExtension\Model\ExtendedCategory
*/
public function getCategory(int $id): ExtendedCategory
{
@@ -450,7 +450,7 @@ private function doTestExtendedOrderItemsPersistence(): void
/**
* @param int $id
- * @return \Tests\ShopBundle\Database\EntityExtension\Model\ExtendedCategory
+ * @return \Tests\ShopBundle\Functional\EntityExtension\Model\ExtendedCategory
*/
private function getOrderTransport(int $id): ExtendedOrderTransport
{
@@ -461,7 +461,7 @@ private function getOrderTransport(int $id): ExtendedOrderTransport
/**
* @param int $id
- * @return \Tests\ShopBundle\Database\EntityExtension\Model\ExtendedOrderPayment
+ * @return \Tests\ShopBundle\Functional\EntityExtension\Model\ExtendedOrderPayment
*/
private function getOrderPayment(int $id): ExtendedOrderPayment
{
@@ -472,7 +472,7 @@ private function getOrderPayment(int $id): ExtendedOrderPayment
/**
* @param int $id
- * @return \Tests\ShopBundle\Database\EntityExtension\Model\ExtendedOrderProduct
+ * @return \Tests\ShopBundle\Functional\EntityExtension\Model\ExtendedOrderProduct
*/
private function getOrderProduct(int $id): ExtendedOrderProduct
{
@@ -483,7 +483,7 @@ private function getOrderProduct(int $id): ExtendedOrderProduct
/**
* @param int $id
- * @return \Tests\ShopBundle\Database\EntityExtension\Model\ExtendedOrderItem
+ * @return \Tests\ShopBundle\Functional\EntityExtension\Model\ExtendedOrderItem
*/
private function getOrderItem(int $id): ExtendedOrderItem
{
diff --git a/tests/ShopBundle/Database/EntityExtension/Model/CategoryManyToManyBidirectionalEntity.php b/tests/ShopBundle/Functional/EntityExtension/Model/CategoryManyToManyBidirectionalEntity.php
similarity index 77%
rename from tests/ShopBundle/Database/EntityExtension/Model/CategoryManyToManyBidirectionalEntity.php
rename to tests/ShopBundle/Functional/EntityExtension/Model/CategoryManyToManyBidirectionalEntity.php
index f185771dd..d56f68319 100644
--- a/tests/ShopBundle/Database/EntityExtension/Model/CategoryManyToManyBidirectionalEntity.php
+++ b/tests/ShopBundle/Functional/EntityExtension/Model/CategoryManyToManyBidirectionalEntity.php
@@ -1,6 +1,6 @@
getContainer()->get(ProductDataFactory::class);
- $vatData = new VatData();
- $vatData->name = 'vat';
- $vatData->percent = 21;
- $vat = new Vat($vatData);
- $productData1 = $productDataFactory->create();
- $productData1->name = [];
- $productData1->price = 100;
- $productData1->vat = $vat;
- $productData1->priceCalculationType = Product::PRICE_CALCULATION_TYPE_AUTO;
- $productMock = Product::create($productData1);
+ /** @var \Shopsys\ShopBundle\Model\Product\Product $product */
+ $product = $this->getReference(ProductDataFixture::PRODUCT_PREFIX . '1');
+ /* @var \Shopsys\FrameworkBundle\Model\Product\Pricing\ProductPriceCalculationForUser $productPriceCalculationForUser */
$productPriceCalculationForUser = $this->getContainer()->get(ProductPriceCalculationForUser::class);
- /* @var $productPriceCalculationForUser \Shopsys\FrameworkBundle\Model\Product\Pricing\ProductPriceCalculationForUser */
- $productPrice = $productPriceCalculationForUser->calculatePriceForCurrentUser($productMock);
- $cartItem = new CartItem($customerIdentifier, $productMock, 1, $productPrice->getPriceWithVat());
+
+ $productPrice = $productPriceCalculationForUser->calculatePriceForCurrentUser($product);
+ $cartItem = new CartItem($customerIdentifier, $product, 1, $productPrice->getPriceWithVat());
$cartItems = [$cartItem];
$cart = new Cart($cartItems);
+ /** @var \Shopsys\FrameworkBundle\Model\Cart\Watcher\CartWatcherService $cartWatcherService */
$cartWatcherService = $this->getContainer()->get(CartWatcherService::class);
- /* @var $cartWatcherService \Shopsys\FrameworkBundle\Model\Cart\Watcher\CartWatcherService */
$modifiedItems1 = $cartWatcherService->getModifiedPriceItemsAndUpdatePrices($cart);
$this->assertEmpty($modifiedItems1);
- $productData2 = $productDataFactory->create();
- $productData2->name = [];
- $productData2->price = 200;
- $productData2->vat = $vat;
+ $pricingGroup = $this->getReference(PricingGroupDataFixture::PRICING_GROUP_ORDINARY_DOMAIN_1);
+
+ /** @var \Shopsys\FrameworkBundle\Model\Product\Pricing\ProductManualInputPriceFacade $manualInputPriceFacade */
+ $manualInputPriceFacade = $this->getContainer()->get(ProductManualInputPriceFacade::class);
+ $manualInputPriceFacade->refresh($product, $pricingGroup, '10');
- $productMock->edit(new ProductCategoryDomainFactory(), $productData2);
$modifiedItems2 = $cartWatcherService->getModifiedPriceItemsAndUpdatePrices($cart);
$this->assertNotEmpty($modifiedItems2);
diff --git a/tests/ShopBundle/Database/Model/Category/CategoryDomainTest.php b/tests/ShopBundle/Functional/Model/Category/CategoryDomainTest.php
similarity index 96%
rename from tests/ShopBundle/Database/Model/Category/CategoryDomainTest.php
rename to tests/ShopBundle/Functional/Model/Category/CategoryDomainTest.php
index 885d6d02e..ca72b6615 100644
--- a/tests/ShopBundle/Database/Model/Category/CategoryDomainTest.php
+++ b/tests/ShopBundle/Functional/Model/Category/CategoryDomainTest.php
@@ -1,13 +1,13 @@
name = 'pricing_group_name';
- $pricingGroupData->coefficient = 1;
$domainId = 1;
$pricingGroup = $pricingGroupFacade->create($pricingGroupData, $domainId);
$productPriceRecalculator->runAllScheduledRecalculations();
@@ -39,44 +37,6 @@ public function testCreate()
$this->assertNotNull($productCalculatedPrice);
}
- public function testEdit()
- {
- $em = $this->getEntityManager();
- $product = $this->getReference(ProductDataFixture::PRODUCT_PREFIX . '1');
- /* @var $prodcu \Shopsys\ShopBundle\Model\Product\Product */
- $pricingGroup = $this->getReference(PricingGroupDataFixture::PRICING_GROUP_ORDINARY_DOMAIN_1);
- /* @var $pricingGroup \Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGroup */
- $pricingGroupFacade = $this->getContainer()->get(PricingGroupFacade::class);
- /* @var $pricingGroupFacade \Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGroupFacade */
- $productPriceRecalculator = $this->getContainer()->get(ProductPriceRecalculator::class);
- /* @var $productPriceRecalculator \Shopsys\FrameworkBundle\Model\Product\Pricing\ProductPriceRecalculator */
- $productCalculatedPrice = $em->getRepository(ProductCalculatedPrice::class)->findOneBy([
- 'product' => $product,
- 'pricingGroup' => $pricingGroup,
- ]);
-
- $reflectionClass = new ReflectionClass(ProductCalculatedPrice::class);
- $reflectionProperty = $reflectionClass->getProperty('priceWithVat');
- $reflectionProperty->setAccessible(true);
-
- $productPriceBeforeEdit = $reflectionProperty->getValue($productCalculatedPrice);
-
- $pricingGroupData = new PricingGroupData();
- $pricingGroupData->name = $pricingGroup->getName();
- $pricingGroupData->coefficient = $pricingGroup->getCoefficient() * 2;
- $pricingGroupFacade->edit($pricingGroup->getId(), $pricingGroupData);
- $productPriceRecalculator->runAllScheduledRecalculations();
-
- $newProductCalculatedPrice = $em->getRepository(ProductCalculatedPrice::class)->findOneBy([
- 'product' => $product,
- 'pricingGroup' => $pricingGroup,
- ]);
-
- $productPriceAfterEdit = $reflectionProperty->getValue($newProductCalculatedPrice);
-
- $this->assertSame(round($productPriceBeforeEdit * 2, 6), round($productPriceAfterEdit, 6));
- }
-
public function testDeleteAndReplace()
{
$em = $this->getEntityManager();
diff --git a/tests/ShopBundle/Database/Model/Pricing/InputPriceRecalculationSchedulerTest.php b/tests/ShopBundle/Functional/Model/Pricing/InputPriceRecalculationSchedulerTest.php
similarity index 77%
rename from tests/ShopBundle/Database/Model/Pricing/InputPriceRecalculationSchedulerTest.php
rename to tests/ShopBundle/Functional/Model/Pricing/InputPriceRecalculationSchedulerTest.php
index f6641bac6..657772dde 100644
--- a/tests/ShopBundle/Database/Model/Pricing/InputPriceRecalculationSchedulerTest.php
+++ b/tests/ShopBundle/Functional/Model/Pricing/InputPriceRecalculationSchedulerTest.php
@@ -1,10 +1,9 @@
getContainer()->get(Setting::class);
- /* @var $setting \Shopsys\FrameworkBundle\Component\Setting\Setting */
$inputPriceRecalculatorMock = $this->getMockBuilder(InputPriceRecalculator::class)
->setMethods(['__construct', 'recalculateToInputPricesWithoutVat', 'recalculateToInputPricesWithVat'])
@@ -56,38 +52,11 @@ public function inputPricesTestDataProvider()
];
}
- /**
- * @param string $inputPrice
- * @param string $vatPercent
- * @return \Shopsys\ShopBundle\Model\Product\Product
- */
- private function createProductWithInputPriceAndVatPercentAndAutoCalculationPriceType(
- $inputPrice,
- $vatPercent
- ) {
- $em = $this->getEntityManager();
- $productDataFactory = $this->getContainer()->get(ProductDataFactory::class);
- /* @var $productDataFactory \Shopsys\ShopBundle\Model\Product\ProductDataFactory */
- $productFacade = $this->getContainer()->get(ProductFacade::class);
- /* @var $productFacade \Shopsys\FrameworkBundle\Model\Product\ProductFacade */
-
- $vatData = new VatData();
- $vatData->name = 'vat';
- $vatData->percent = $vatPercent;
- $vat = new Vat($vatData);
- $em->persist($vat);
-
- $templateProduct = $this->getReference(ProductDataFixture::PRODUCT_PREFIX . '1');
- $productData = $productDataFactory->createFromProduct($templateProduct);
- $productData->priceCalculationType = Product::PRICE_CALCULATION_TYPE_AUTO;
- $productData->price = $inputPrice;
- $productData->vat = $vat;
-
- return $productFacade->create($productData);
- }
-
/**
* @dataProvider inputPricesTestDataProvider
+ * @param mixed $inputPriceWithoutVat
+ * @param mixed $inputPriceWithVat
+ * @param mixed $vatPercent
*/
public function testOnKernelResponseRecalculateInputPricesWithoutVat(
$inputPriceWithoutVat,
@@ -96,18 +65,18 @@ public function testOnKernelResponseRecalculateInputPricesWithoutVat(
) {
$em = $this->getEntityManager();
- $setting = $this->getContainer()->get(Setting::class);
/* @var $setting \Shopsys\FrameworkBundle\Component\Setting\Setting */
- $inputPriceRecalculationScheduler = $this->getContainer()->get(InputPriceRecalculationScheduler::class);
+ $setting = $this->getContainer()->get(Setting::class);
/* @var $inputPriceRecalculationScheduler \Shopsys\FrameworkBundle\Model\Pricing\InputPriceRecalculationScheduler */
- $paymentFacade = $this->getContainer()->get(PaymentFacade::class);
+ $inputPriceRecalculationScheduler = $this->getContainer()->get(InputPriceRecalculationScheduler::class);
/* @var $paymentFacade \Shopsys\FrameworkBundle\Model\Payment\PaymentFacade */
- $transportFacade = $this->getContainer()->get(TransportFacade::class);
+ $paymentFacade = $this->getContainer()->get(PaymentFacade::class);
/* @var $transportFacade \Shopsys\FrameworkBundle\Model\Transport\TransportFacade */
+ $transportFacade = $this->getContainer()->get(TransportFacade::class);
+ /** @var \Shopsys\FrameworkBundle\Model\Payment\PaymentDataFactory $paymentDataFactory */
$paymentDataFactory = $this->getContainer()->get(PaymentDataFactory::class);
- /* @var $paymentDataFactory \Shopsys\FrameworkBundle\Model\Payment\PaymentDataFactory */
+ /** @var \Shopsys\ShopBundle\Model\Transport\TransportDataFactory $transportDataFactory */
$transportDataFactory = $this->getContainer()->get(TransportDataFactoryInterface::class);
- /* @var $transportDataFactory \Shopsys\FrameworkBundle\Model\Transport\TransportDataFactory */
$setting->set(PricingSetting::INPUT_PRICE_TYPE, PricingSetting::INPUT_PRICE_TYPE_WITH_VAT);
@@ -115,34 +84,34 @@ public function testOnKernelResponseRecalculateInputPricesWithoutVat(
$vatData->name = 'vat';
$vatData->percent = $vatPercent;
$vat = new Vat($vatData);
+
$availabilityData = new AvailabilityData();
$availabilityData->dispatchTime = 0;
$availability = new Availability($availabilityData);
+
$em->persist($vat);
$em->persist($availability);
+ /** @var $currency1 \Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency */
$currency1 = $this->getReference(CurrencyDataFixture::CURRENCY_CZK);
+ /** @var $currency2 \Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency */
$currency2 = $this->getReference(CurrencyDataFixture::CURRENCY_EUR);
- $product = $this->createProductWithInputPriceAndVatPercentAndAutoCalculationPriceType(
- $inputPriceWithVat,
- $vatPercent
- );
-
$paymentData = $paymentDataFactory->create();
$paymentData->name = ['cs' => 'name'];
$paymentData->pricesByCurrencyId = [$currency1->getId() => $inputPriceWithVat, $currency2->getId() => $inputPriceWithVat];
$paymentData->vat = $vat;
+ /** @var \Shopsys\FrameworkBundle\Model\Payment\Payment $payment */
$payment = $paymentFacade->create($paymentData);
- /* @var $payment \Shopsys\FrameworkBundle\Model\Payment\Payment */
$transportData = $transportDataFactory->create();
$transportData->name = ['cs' => 'name'];
$transportData->description = ['cs' => 'desc'];
$transportData->pricesByCurrencyId = [$currency1->getId() => $inputPriceWithVat, $currency2->getId() => $inputPriceWithVat];
$transportData->vat = $vat;
- $transport = $transportFacade->create($transportData);
/* @var $transport \Shopsys\ShopBundle\Model\Transport\Transport */
+ $transport = $transportFacade->create($transportData);
+
$em->flush();
$filterResponseEventMock = $this->getMockBuilder(FilterResponseEvent::class)
@@ -155,17 +124,18 @@ public function testOnKernelResponseRecalculateInputPricesWithoutVat(
$inputPriceRecalculationScheduler->scheduleSetInputPricesWithoutVat();
$inputPriceRecalculationScheduler->onKernelResponse($filterResponseEventMock);
- $em->refresh($product);
$em->refresh($payment);
$em->refresh($transport);
- $this->assertSame(round($inputPriceWithoutVat, 6), round($product->getPrice(), 6));
$this->assertSame(round($inputPriceWithoutVat, 6), round($payment->getPrice($currency1)->getPrice(), 6));
$this->assertSame(round($inputPriceWithoutVat, 6), round($transport->getPrice($currency1)->getPrice(), 6));
}
/**
* @dataProvider inputPricesTestDataProvider
+ * @param mixed $inputPriceWithoutVat
+ * @param mixed $inputPriceWithVat
+ * @param mixed $vatPercent
*/
public function testOnKernelResponseRecalculateInputPricesWithVat(
$inputPriceWithoutVat,
@@ -174,22 +144,24 @@ public function testOnKernelResponseRecalculateInputPricesWithVat(
) {
$em = $this->getEntityManager();
- $setting = $this->getContainer()->get(Setting::class);
/* @var $setting \Shopsys\FrameworkBundle\Component\Setting\Setting */
- $inputPriceRecalculationScheduler = $this->getContainer()->get(InputPriceRecalculationScheduler::class);
+ $setting = $this->getContainer()->get(Setting::class);
/* @var $inputPriceRecalculationScheduler \Shopsys\FrameworkBundle\Model\Pricing\InputPriceRecalculationScheduler */
- $paymentFacade = $this->getContainer()->get(PaymentFacade::class);
+ $inputPriceRecalculationScheduler = $this->getContainer()->get(InputPriceRecalculationScheduler::class);
/* @var $paymentFacade \Shopsys\FrameworkBundle\Model\Payment\PaymentFacade */
- $transportFacade = $this->getContainer()->get(TransportFacade::class);
+ $paymentFacade = $this->getContainer()->get(PaymentFacade::class);
/* @var $transportFacade \Shopsys\FrameworkBundle\Model\Transport\TransportFacade */
+ $transportFacade = $this->getContainer()->get(TransportFacade::class);
+ /** @var \Shopsys\FrameworkBundle\Model\Payment\PaymentDataFactory $paymentDataFactory */
$paymentDataFactory = $this->getContainer()->get(PaymentDataFactory::class);
- /* @var $paymentDataFactory \Shopsys\FrameworkBundle\Model\Payment\PaymentDataFactory */
+ /** @var \Shopsys\ShopBundle\Model\Transport\TransportDataFactory $transportDataFactory */
$transportDataFactory = $this->getContainer()->get(TransportDataFactoryInterface::class);
- /* @var $transportDataFactory \Shopsys\ShopBundle\Model\Transport\TransportDataFactory */
$setting->set(PricingSetting::INPUT_PRICE_TYPE, PricingSetting::INPUT_PRICE_TYPE_WITHOUT_VAT);
+ /** @var \Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency $currency1 */
$currency1 = $this->getReference(CurrencyDataFixture::CURRENCY_CZK);
+ /** @var \Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency $currency1 */
$currency2 = $this->getReference(CurrencyDataFixture::CURRENCY_EUR);
$vatData = new VatData();
@@ -201,25 +173,19 @@ public function testOnKernelResponseRecalculateInputPricesWithVat(
$availability = new Availability($availabilityData);
$em->persist($vat);
$em->persist($availability);
-
- $product = $this->createProductWithInputPriceAndVatPercentAndAutoCalculationPriceType(
- $inputPriceWithoutVat,
- $vatPercent
- );
-
$paymentData = $paymentDataFactory->create();
$paymentData->name = ['cs' => 'name'];
$paymentData->pricesByCurrencyId = [$currency1->getId() => $inputPriceWithoutVat, $currency2->getId() => $inputPriceWithoutVat];
$paymentData->vat = $vat;
- $payment = $paymentFacade->create($paymentData);
/* @var $payment \Shopsys\FrameworkBundle\Model\Payment\Payment */
+ $payment = $paymentFacade->create($paymentData);
$transportData = $transportDataFactory->create();
$transportData->name = ['cs' => 'name'];
$transportData->pricesByCurrencyId = [$currency1->getId() => $inputPriceWithoutVat, $currency2->getId() => $inputPriceWithoutVat];
$transportData->vat = $vat;
- $transport = $transportFacade->create($transportData);
/* @var $transport \Shopsys\ShopBundle\Model\Transport\Transport */
+ $transport = $transportFacade->create($transportData);
$em->flush();
@@ -233,11 +199,9 @@ public function testOnKernelResponseRecalculateInputPricesWithVat(
$inputPriceRecalculationScheduler->scheduleSetInputPricesWithVat();
$inputPriceRecalculationScheduler->onKernelResponse($filterResponseEventMock);
- $em->refresh($product);
$em->refresh($payment);
$em->refresh($transport);
- $this->assertSame(round($inputPriceWithVat, 6), round($product->getPrice(), 6));
$this->assertSame(round($inputPriceWithVat, 6), round($payment->getPrice($currency1)->getPrice(), 6));
$this->assertSame(round($inputPriceWithVat, 6), round($transport->getPrice($currency1)->getPrice(), 6));
}
diff --git a/tests/ShopBundle/Database/Model/Product/Availability/AvailabilityFacadeTest.php b/tests/ShopBundle/Functional/Model/Product/Availability/AvailabilityFacadeTest.php
similarity index 92%
rename from tests/ShopBundle/Database/Model/Product/Availability/AvailabilityFacadeTest.php
rename to tests/ShopBundle/Functional/Model/Product/Availability/AvailabilityFacadeTest.php
index 77e915017..97f4902b0 100644
--- a/tests/ShopBundle/Database/Model/Product/Availability/AvailabilityFacadeTest.php
+++ b/tests/ShopBundle/Functional/Model/Product/Availability/AvailabilityFacadeTest.php
@@ -1,6 +1,6 @@
getAllListableQueryBuilderTest(148, true);
}
+ /**
+ * @param mixed $productReferenceId
+ * @param mixed $isExpectedInResult
+ */
private function getAllListableQueryBuilderTest($productReferenceId, $isExpectedInResult)
{
$productRepository = $this->getContainer()->get(ProductRepository::class);
@@ -78,6 +82,10 @@ public function testProductMainVariantIsNotSellable()
$this->getAllSellableQueryBuilderTest(148, false);
}
+ /**
+ * @param mixed $productReferenceId
+ * @param mixed $isExpectedInResult
+ */
private function getAllSellableQueryBuilderTest($productReferenceId, $isExpectedInResult)
{
$productRepository = $this->getContainer()->get(ProductRepository::class);
@@ -119,6 +127,10 @@ public function testProductMainVariantIsOfferred()
$this->getAllOfferedQueryBuilderTest(69, true);
}
+ /**
+ * @param mixed $productReferenceId
+ * @param mixed $isExpectedInResult
+ */
private function getAllOfferedQueryBuilderTest($productReferenceId, $isExpectedInResult)
{
$productRepository = $this->getContainer()->get(ProductRepository::class);
diff --git a/tests/ShopBundle/Database/Model/Product/ProductSellingDeniedRecalculatorTest.php b/tests/ShopBundle/Functional/Model/Product/ProductSellingDeniedRecalculatorTest.php
similarity index 97%
rename from tests/ShopBundle/Database/Model/Product/ProductSellingDeniedRecalculatorTest.php
rename to tests/ShopBundle/Functional/Model/Product/ProductSellingDeniedRecalculatorTest.php
index cfcd184b3..946d4d8ec 100644
--- a/tests/ShopBundle/Database/Model/Product/ProductSellingDeniedRecalculatorTest.php
+++ b/tests/ShopBundle/Functional/Model/Product/ProductSellingDeniedRecalculatorTest.php
@@ -1,14 +1,14 @@
getReference(PricingGroupDataFixture::PRICING_GROUP_ORDINARY_DOMAIN_1);
$productData = $producDataFactory->create();
- $productData->price = 1000;
$productData->vat = $vat;
$productData->unit = $this->getReference(UnitDataFixture::UNIT_PIECES);
$product = Product::create($productData);
@@ -43,7 +42,6 @@ public function testRecalculateInputPriceForNewVatPercentWithInputPriceWithoutVa
$productService->recalculateInputPriceForNewVatPercent($product, [$productManualInputPrice], 15);
- $this->assertSame('1052.173913', (string)$product->getPrice());
$this->assertSame('1052.173913', (string)$productManualInputPrice->getInputPrice());
}
@@ -65,7 +63,6 @@ public function testRecalculateInputPriceForNewVatPercentWithInputPriceWithVat()
$pricingGroup = $this->getReference(PricingGroupDataFixture::PRICING_GROUP_ORDINARY_DOMAIN_1);
$productData = $productDataFactory->create();
- $productData->price = 1000;
$productData->vat = $vat;
$productData->unit = $this->getReference(UnitDataFixture::UNIT_PIECES);
$product = Product::create($productData);
@@ -74,7 +71,6 @@ public function testRecalculateInputPriceForNewVatPercentWithInputPriceWithVat()
$productService->recalculateInputPriceForNewVatPercent($product, [$productManualInputPrice], 15);
- $this->assertSame('1000', (string)$product->getPrice());
$this->assertSame('1000', (string)$productManualInputPrice->getInputPrice());
}
}
diff --git a/tests/ShopBundle/Database/Model/Product/ProductVisibilityRepositoryTest.php b/tests/ShopBundle/Functional/Model/Product/ProductVisibilityRepositoryTest.php
similarity index 95%
rename from tests/ShopBundle/Database/Model/Product/ProductVisibilityRepositoryTest.php
rename to tests/ShopBundle/Functional/Model/Product/ProductVisibilityRepositoryTest.php
index 794471381..ee990bd67 100644
--- a/tests/ShopBundle/Database/Model/Product/ProductVisibilityRepositoryTest.php
+++ b/tests/ShopBundle/Functional/Model/Product/ProductVisibilityRepositoryTest.php
@@ -1,6 +1,6 @@
getReference(CategoryDataFixture::CATEGORY_ELECTRONICS);
@@ -41,11 +42,10 @@ private function getDefaultProductData()
$productData = $productDataFactory->create();
$productData->name = ['cs' => 'Name', 'en' => 'Name'];
$productData->vat = $vat;
- $productData->price = 100;
- $productData->priceCalculationType = Product::PRICE_CALCULATION_TYPE_AUTO;
$productData->categoriesByDomainId = [1 => [$category]];
$productData->availability = $this->getReference(AvailabilityDataFixture::AVAILABILITY_IN_STOCK);
$productData->unit = $this->getReference(UnitDataFixture::UNIT_PIECES);
+ $this->setPriceForAllDomains($productData, 100);
return $productData;
}
@@ -215,10 +215,10 @@ public function testIsNotVisibleWhenZeroOrNullPrice()
/* @var $productPriceRecalculator \Shopsys\FrameworkBundle\Model\Product\Pricing\ProductPriceRecalculator */
$productData = $this->getDefaultProductData();
- $productData->price = 0;
+ $this->setPriceForAllDomains($productData, 0);
$product1 = $productFacade->create($productData);
- $productData->price = null;
+ $this->setPriceForAllDomains($productData, null);
$product2 = $productFacade->create($productData);
$productPriceRecalculator->runImmediateRecalculations();
@@ -363,16 +363,10 @@ public function testIsNotVisibleWhenZeroManualPrice()
/* @var $productFacade \Shopsys\FrameworkBundle\Model\Product\ProductFacade */
$productPriceRecalculator = $this->getContainer()->get(ProductPriceRecalculator::class);
/* @var $productPriceRecalculator \Shopsys\FrameworkBundle\Model\Product\Pricing\ProductPriceRecalculator */
- $pricingGroupFacade = $this->getContainer()->get(PricingGroupFacade::class);
- /* @var $pricingGroupFacade \Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGroupFacade */
$productData = $this->getDefaultProductData();
- $productData->priceCalculationType = Product::PRICE_CALCULATION_TYPE_MANUAL;
- $allPricingGroups = $pricingGroupFacade->getAll();
- foreach ($allPricingGroups as $pricingGroup) {
- $productData->manualInputPricesByPricingGroupId[$pricingGroup->getId()] = 10;
- }
+ $this->setPriceForAllDomains($productData, 10);
$pricingGroupWithZeroPriceId = $this->getReference(PricingGroupDataFixture::PRICING_GROUP_ORDINARY_DOMAIN_1)->getId();
@@ -404,16 +398,10 @@ public function testIsNotVisibleWhenNullManualPrice()
/* @var $productFacade \Shopsys\FrameworkBundle\Model\Product\ProductFacade */
$productPriceRecalculator = $this->getContainer()->get(ProductPriceRecalculator::class);
/* @var $productPriceRecalculator \Shopsys\FrameworkBundle\Model\Product\Pricing\ProductPriceRecalculator */
- $pricingGroupFacade = $this->getContainer()->get(PricingGroupFacade::class);
- /* @var $pricingGroupFacade \Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGroupFacade */
$productData = $this->getDefaultProductData();
- $productData->priceCalculationType = Product::PRICE_CALCULATION_TYPE_MANUAL;
- $allPricingGroups = $pricingGroupFacade->getAll();
- foreach ($allPricingGroups as $pricingGroup) {
- $productData->manualInputPricesByPricingGroupId[$pricingGroup->getId()] = 10;
- }
+ $this->setPriceForAllDomains($productData, 10);
$pricingGroupWithNullPriceId = $this->getReference(PricingGroupDataFixture::PRICING_GROUP_ORDINARY_DOMAIN_1)->getId();
$productData->manualInputPricesByPricingGroupId[$pricingGroupWithNullPriceId] = null;
@@ -552,4 +540,21 @@ public function testRefreshProductsVisibilityNotVisibleMainVariant()
$this->assertFalse($variant3->isVisible());
$this->assertFalse($mainVariant->isVisible());
}
+
+ /**
+ * @param \Shopsys\FrameworkBundle\Model\Product\ProductData $productData
+ * @param $price
+ */
+ private function setPriceForAllDomains(ProductData $productData, $price)
+ {
+ /** @var \Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGroupFacade $pricingGroupFacade */
+ $pricingGroupFacade = $this->getContainer()->get(PricingGroupFacade::class);
+
+ $manualInputPrices = [];
+ foreach ($pricingGroupFacade->getAll() as $pricingGroup) {
+ $manualInputPrices[$pricingGroup->getId()] = $price;
+ }
+
+ $productData->manualInputPricesByPricingGroupId = $manualInputPrices;
+ }
}
diff --git a/tests/ShopBundle/Database/Model/Transport/IndependentTransportVisibilityCalculationTest.php b/tests/ShopBundle/Functional/Model/Transport/IndependentTransportVisibilityCalculationTest.php
similarity index 96%
rename from tests/ShopBundle/Database/Model/Transport/IndependentTransportVisibilityCalculationTest.php
rename to tests/ShopBundle/Functional/Model/Transport/IndependentTransportVisibilityCalculationTest.php
index db43dd0c5..48c5d48a1 100644
--- a/tests/ShopBundle/Database/Model/Transport/IndependentTransportVisibilityCalculationTest.php
+++ b/tests/ShopBundle/Functional/Model/Transport/IndependentTransportVisibilityCalculationTest.php
@@ -1,15 +1,15 @@
jmeterCsvReporter = $jmeterCsvReporter;
diff --git a/tests/ShopBundle/Performance/Page/PerformanceResultsCsvExporter.php b/tests/ShopBundle/Performance/Page/PerformanceResultsCsvExporter.php
index 592ba3220..a8ad3e3ee 100644
--- a/tests/ShopBundle/Performance/Page/PerformanceResultsCsvExporter.php
+++ b/tests/ShopBundle/Performance/Page/PerformanceResultsCsvExporter.php
@@ -11,6 +11,9 @@ class PerformanceResultsCsvExporter
*/
private $jmeterCsvReporter;
+ /**
+ * @param \Tests\ShopBundle\Performance\JmeterCsvReporter $jmeterCsvReporter
+ */
public function __construct(JmeterCsvReporter $jmeterCsvReporter)
{
$this->jmeterCsvReporter = $jmeterCsvReporter;
diff --git a/tests/ShopBundle/Performance/Page/PerformanceTestSummaryPrinter.php b/tests/ShopBundle/Performance/Page/PerformanceTestSummaryPrinter.php
index c72f48c16..b8bf37bb1 100644
--- a/tests/ShopBundle/Performance/Page/PerformanceTestSummaryPrinter.php
+++ b/tests/ShopBundle/Performance/Page/PerformanceTestSummaryPrinter.php
@@ -11,6 +11,9 @@ class PerformanceTestSummaryPrinter
*/
private $performanceTestSampleQualifier;
+ /**
+ * @param \Tests\ShopBundle\Performance\Page\PerformanceTestSampleQualifier $performanceTestSampleQualifier
+ */
public function __construct(PerformanceTestSampleQualifier $performanceTestSampleQualifier)
{
$this->performanceTestSampleQualifier = $performanceTestSampleQualifier;
diff --git a/tests/ShopBundle/Smoke/LocalizationListenerTest.php b/tests/ShopBundle/Smoke/LocalizationListenerTest.php
index 1c9675d30..ffc4d2c91 100644
--- a/tests/ShopBundle/Smoke/LocalizationListenerTest.php
+++ b/tests/ShopBundle/Smoke/LocalizationListenerTest.php
@@ -6,9 +6,9 @@
use Shopsys\FrameworkBundle\Component\Router\CurrentDomainRouter;
use Shopsys\FrameworkBundle\Component\Router\DomainRouterFactory;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
-use Tests\ShopBundle\Test\DatabaseTestCase;
+use Tests\ShopBundle\Test\TransactionFunctionalTestCase;
-class LocalizationListenerTest extends DatabaseTestCase
+class LocalizationListenerTest extends TransactionFunctionalTestCase
{
public function testProductDetailOnFirstDomainHasEnglishLocale()
{
diff --git a/tests/ShopBundle/Smoke/NewProductTest.php b/tests/ShopBundle/Smoke/NewProductTest.php
index e3e5a90bc..db5464ad8 100644
--- a/tests/ShopBundle/Smoke/NewProductTest.php
+++ b/tests/ShopBundle/Smoke/NewProductTest.php
@@ -6,6 +6,7 @@
use Shopsys\FrameworkBundle\DataFixtures\Demo\UnitDataFixture;
use Shopsys\FrameworkBundle\DataFixtures\Demo\VatDataFixture;
use Shopsys\FrameworkBundle\Form\Admin\Product\ProductFormType;
+use Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGroupFacade;
use Symfony\Component\DomCrawler\Form;
use Symfony\Component\Security\Csrf\CsrfToken;
use Tests\ShopBundle\Test\FunctionalTestCase;
@@ -19,6 +20,7 @@ public function createOrEditProductProvider()
/**
* @dataProvider createOrEditProductProvider
+ * @param mixed $relativeUrl
*/
public function testCreateOrEditProduct($relativeUrl)
{
@@ -65,7 +67,7 @@ private function fillForm(Form $form)
$form['product_form[basicInformationGroup][partno]'] = '123456';
$form['product_form[basicInformationGroup][ean]'] = '123456';
$form['product_form[descriptionsGroup][descriptions][1]'] = 'test description';
- $form['product_form[pricesGroup][productCalculatedPricesGroup][price]'] = '10000';
+ $this->fillManualInputPrices($form);
$form['product_form[pricesGroup][vat]']->select($this->getReference(VatDataFixture::VAT_ZERO)->getId());
$form['product_form[displayAvailabilityGroup][sellingFrom]'] = '1.1.1990';
$form['product_form[displayAvailabilityGroup][sellingTo]'] = '1.1.2000';
@@ -82,4 +84,19 @@ private function setFormCsrfToken(Form $form, CsrfToken $token)
{
$form['product_form[_token]'] = $token->getValue();
}
+
+ /**
+ * @param \Symfony\Component\DomCrawler\Form $form
+ */
+ private function fillManualInputPrices(Form $form)
+ {
+ $pricingGroupFacade = $this->getContainer()->get(PricingGroupFacade::class);
+ foreach ($pricingGroupFacade->getAll() as $pricingGroup) {
+ $inputName = sprintf(
+ 'product_form[pricesGroup][productCalculatedPricesGroup][manualInputPricesByPricingGroupId][%s]',
+ $pricingGroup->getId()
+ );
+ $form[$inputName] = '10000';
+ }
+ }
}
diff --git a/tests/ShopBundle/Test/Codeception/Module/StrictWebDriver.php b/tests/ShopBundle/Test/Codeception/Module/StrictWebDriver.php
index 5572e7879..e8bfdc9ea 100644
--- a/tests/ShopBundle/Test/Codeception/Module/StrictWebDriver.php
+++ b/tests/ShopBundle/Test/Codeception/Module/StrictWebDriver.php
@@ -55,6 +55,8 @@ protected function findFields($selector)
/**
* @deprecated
+ * @param mixed $link
+ * @param mixed|null $context
*/
public function click($link, $context = null)
{
@@ -67,6 +69,8 @@ public function click($link, $context = null)
/**
* @see click()
+ * @param mixed $link
+ * @param mixed|null $context
*/
private function clickAndWait($link, $context = null)
{
@@ -129,6 +133,8 @@ public function clickByElement(WebDriverElement $element)
/**
* @deprecated
+ * @param mixed $field
+ * @param mixed $value
*/
public function fillField($field, $value)
{
@@ -190,6 +196,7 @@ public function seeInElement($text, WebDriverElement $element)
/**
* @deprecated
+ * @param mixed $checkbox
*/
public function seeCheckboxIsChecked($checkbox)
{
@@ -236,6 +243,7 @@ public function seeCheckboxIsCheckedByLabel($label)
/**
* @deprecated
+ * @param mixed $checkbox
*/
public function dontSeeCheckboxIsChecked($checkbox)
{
@@ -282,6 +290,7 @@ public function dontSeeCheckboxIsCheckedByLabel($label)
/**
* @deprecated
+ * @param mixed $option
*/
public function checkOption($option)
{
@@ -347,6 +356,8 @@ public function countVisibleByCss($css)
/**
* @deprecated
+ * @param mixed $field
+ * @param mixed $value
*/
public function seeInField($field, $value)
{
@@ -390,6 +401,8 @@ public function moveMouseOverByCss($css, $offsetX = null, $offsetY = null)
/**
* @deprecated
+ * @param mixed $element
+ * @param mixed $char
*/
public function pressKey($element, $char)
{
diff --git a/tests/ShopBundle/Test/DatabaseTestCase.php b/tests/ShopBundle/Test/TransactionFunctionalTestCase.php
similarity index 87%
rename from tests/ShopBundle/Test/DatabaseTestCase.php
rename to tests/ShopBundle/Test/TransactionFunctionalTestCase.php
index 4ac56e323..d556fd9ac 100644
--- a/tests/ShopBundle/Test/DatabaseTestCase.php
+++ b/tests/ShopBundle/Test/TransactionFunctionalTestCase.php
@@ -2,7 +2,7 @@
namespace Tests\ShopBundle\Test;
-abstract class DatabaseTestCase extends FunctionalTestCase
+abstract class TransactionFunctionalTestCase extends FunctionalTestCase
{
/**
* @return \Doctrine\ORM\EntityManagerInterface
diff --git a/web/.gitignore b/web/.gitignore
index f5fdf57fe..575b078f7 100644
--- a/web/.gitignore
+++ b/web/.gitignore
@@ -1,4 +1,5 @@
/bundles
/assetic
/content
+/content-test
/components
+ {% if customer is null%}
+ {{ 'unregistered customer'|trans }}
+ {% else %}
+
+ {% if customer.billingAddress.companyCustomer %}
+ {{ customer.billingAddress.companyName }} -
+ {% endif %}
+ {{ customer.lastName }}
+ {{ customer.firstName }}
+
+
+ {% endif %}
+
+ |