function it_throws_an_exception_if_channel_not_found($channelRepository, $attributeRepository, AttributeInterface $attribute, FamilyInterface $family) { $data = ['code' => 'mycode', 'requirements' => ['mobile' => ['sku', 'name'], 'print' => ['sku', 'name', 'description']]]; $family->getAttributeRequirements()->willReturn([]); $family->setCode('mycode')->shouldBeCalled(); $attributeRepository->findOneByIdentifier('sku')->willReturn($attribute); $attributeRepository->findOneByIdentifier('name')->willReturn($attribute); $attributeRepository->findOneByIdentifier('description')->willReturn($attribute); $attributeRepository->findOneByIdentifier('price')->willReturn($attribute); $channelRepository->findOneByIdentifier('print')->willReturn(null); $channelRepository->findOneByIdentifier('mobile')->willReturn(null); $this->shouldThrow(new \InvalidArgumentException(sprintf('Channel with "%s" code does not exist', 'mobile')))->during('update', [$family, $data]); }