function it_returns_association_type_field_names($managerRegistry, AssociationTypeRepository $repository, AssociationType $assocType1, AssociationType $assocType2) { $assocType1->getCode()->willReturn("ASSOC_TYPE_1"); $assocType2->getCode()->willReturn("ASSOC_TYPE_2"); $repository->findAll()->willReturn([$assocType1, $assocType2]); $managerRegistry->getRepository(self::ASSOC_TYPE_CLASS)->willReturn($repository); $this->getAssociationFieldNames()->shouldReturn(["ASSOC_TYPE_1-groups", "ASSOC_TYPE_1-products", "ASSOC_TYPE_2-groups", "ASSOC_TYPE_2-products"]); }
/** * Get association types * * @return array */ public function getAssociationTypes() { return $this->repository->findAll(); }