function it_generates_correct_hierarchy_when_product_variant_does_not_have_archetype(ProductVariantInterface $productVariant, ProductInterface $product) { $productVariant->getMetadataIdentifier()->shouldBeCalled()->willReturn('ProductVariant-42'); $product->getMetadataIdentifier()->shouldBeCalled()->willReturn('Product-42'); $product->getMetadataClassIdentifier()->shouldBeCalled()->willReturn('Product'); $productVariant->getProduct()->shouldBeCalled()->willReturn($product); $product->getArchetype()->shouldBeCalled()->willReturn(null); $this->getHierarchyByMetadataSubject($productVariant)->shouldReturn(['ProductVariant-42', 'Product-42', 'Product', 'DefaultPage']); }