/** @test */ public function it_should_allow_authenticated_speakers_to_submit_talks() { $this->callForProposal->shouldReceive('isOpen')->once()->andReturn(true); $this->identityProvider->shouldReceive('getCurrentUser')->once()->andReturn($this->getSpeaker()); $this->talkRepository->shouldReceive('persist')->with(m::type('OpenCFP\\Domain\\Entity\\Talk'))->once(); $this->dispatcher->shouldReceive('dispatch')->with('opencfp.talk.submit', m::type('OpenCFP\\Domain\\Talk\\TalkWasSubmitted'))->once(); $submission = TalkSubmission::fromNative(['title' => 'Sample Talk', 'description' => 'Some example talk for our submission', 'type' => 'regular', 'category' => 'api', 'level' => 'mid']); /** * This should determine the current authenticated speaker, create a Talk from * the data in the TalkSubmission and then persist that Talk. It should dispatch * an event when a talk is submitted. */ $this->sut->submitTalk($submission); }