function let(VariantInterface $masterVariant) { $masterVariant->setMaster(true)->shouldBeCalled(); $masterVariant->setProduct($this)->shouldBeCalled(); $masterVariant->isMaster()->willReturn(true); $this->setMasterVariant($masterVariant); }
function it_should_inherit_price_from_master_variant(ProductVariantInterface $masterVariant) { $masterVariant->isMaster()->willReturn(true); $masterVariant->getAvailableOn()->willReturn(new \DateTime('yesterday')); $masterVariant->getPrice()->willReturn(499); $this->setDefaults($masterVariant); $this->getPrice()->shouldReturn(499); }