/** @test */ function it_should_generate_options_excluding_the_member_transferring_funds() { Fixtures::load(__DIR__ . '/../../../../_data/fixtures/members.yml', $this->entityManager); /** @var MembersRepository $members */ $members = $this->entityManager->getRepository(Member::class); $configuration = new MembersConfiguration($members); $options = $configuration->getMembersChoicesExcluding(Identifier::fromString('ABC')); $this->assertCount(2, $options); $this->assertArrayNotHasKey('ABC', $options); }
/** * @param MembersConfiguration $configuration * @param Identifier $memberId */ public function configure(MembersConfiguration $configuration, Identifier $memberId) { $this->get('fromMemberId')->setValue($memberId); $this->get('toMemberId')->setChoices($configuration->getMembersChoicesExcluding($memberId)); }