/** * @test * @dataProvider objectsData * @param \stdClass $todo * @param \stdClass $user */ public function it_sends_email_to_the_assignee(\stdClass $todo, \stdClass $user) { $this->todoFinder->expects($this->once())->method('findById')->with($todo->id)->will($this->returnValue($todo)); $this->userFinder->expects($this->once())->method('findById')->with($user->id)->will($this->returnValue($user)); $this->mailer->expects($this->once())->method('send')->with($this->isInstanceOf(Message::class)); $action = $this->action; $action($this->getEvent($todo->id)); }