entityManager = $this->getContainer()->get('doctrine.orm.entity_manager'); $this->repository = $this->entityManager->getRepository(DraftAttribute::class); } public function test_it_finds_all_draft_attributes_for_given_vendor(): void { $this->loadFixturesFromFile('DraftAttributeRepositoryTest/test_it_finds_all_draft_attributes_for_given_vendor.yaml'); $vendorOliver = $this->getEntityManager()->getRepository(Vendor::class)->findOneBy(['slug' => 'oliver-queen-company']); $vendorBruce = $this->getEntityManager()->getRepository(Vendor::class)->findOneBy(['slug' => 'bruce-wayne-company']); $oliversAttributes = $this->repository->findVendorDraftAttributes($vendorOliver); $brucesAttributes = $this->repository->findVendorDraftAttributes($vendorBruce); self::assertCount(2, $oliversAttributes); self::assertCount(1, $brucesAttributes); } }