function it_returns_null_when_unknown_backendtype($context, ProductValueComplete $constraint, ProductValueInterface $productValue, AttributeInterface $attribute) { $constraint->getChannel()->willReturn($this->getChannel()); $metric = new Metric(); $productValue->getMetric()->willReturn($metric); $productValue->getData()->willReturn('data'); $attribute->getBackendType()->willReturn('unknown_metric'); $productValue->getAttribute()->willReturn($attribute); $context->buildViolation(Argument::any())->shouldNotBeCalled(); $this->validate($productValue, $constraint); }
/** * Test get channel */ public function testGetChannel() { $channel1 = new Channel(); $constraint = new ProductValueComplete(array('channel' => $channel1)); $this->assertEquals($channel1, $constraint->getChannel()); }