function it_adds_violation_when_validates_non_string_product_value($context, string $stringConstraint, ProductValueInterface $productValue, AttributeInterface $attribute) { $productValue->getAttribute()->willReturn($attribute); $attribute->getCode()->willReturn('foo'); $attribute->getBackendType()->willReturn('integer'); $productValue->getInteger()->willReturn(666); $context->addViolation($stringConstraint->message, ['%attribute%' => 'foo', '%givenType%' => 'integer'])->shouldBeCalled(); $this->validate($productValue, $stringConstraint); }