/** @test */ function it_should_exclude_from_choices_the_member_making_the_transfer() { $form = new TransferFundsForm(); $fromMemberId = Identifier::fromString('abc'); $configuration = Mockery::mock(MembersConfiguration::class); $configuration->shouldReceive('getMembersChoicesExcluding')->once()->with($fromMemberId)->andReturn(['lmn' => null, 'xyz' => null]); $form->configure($configuration, $fromMemberId); $view = $form->buildView(); $this->assertCount(2, $view->toMemberId->choices); $this->assertArrayNotHasKey('abc', $view->toMemberId->choices); }
/** * @param Identifier $fromMemberId * @return \Psr\Http\Message\ResponseInterface */ public function respondEnterTransferInformation(Identifier $fromMemberId) { $this->form->configure($this->configuration, $fromMemberId); $html = $this->template->render('member/transfer-funds.html', ['form' => $this->form->buildView()]); $this->response = $this->factory->buildResponse($html); }