コード例 #1
0
 /** @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);
 }
コード例 #2
0
 /**
  * @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));
 }