function it_sets_date_value_to_a_product_value_with_datetime(AttributeInterface $attribute, ProductInterface $product1, ProductInterface $product2, ProductInterface $product3, $builder, ProductValueInterface $productValue) { $locale = 'fr_FR'; $scope = 'mobile'; $data = new \DateTime(); $attribute->getCode()->willReturn('attributeCode'); $productValue->setData(Argument::type('\\Datetime'))->shouldBeCalled(); $builder->addProductValue($product2, $attribute, $locale, $scope)->willReturn($productValue); $product1->getValue('attributeCode', $locale, $scope)->shouldBeCalled()->willReturn($productValue); $product2->getValue('attributeCode', $locale, $scope)->willReturn(null); $product3->getValue('attributeCode', $locale, $scope)->willReturn($productValue); $products = [$product1, $product2, $product3]; $this->setValue($products, $attribute, $data, $locale, $scope); }