/** * @dataProvider dataForPrepareExceptionViewModel */ public function testPrepareExceptionViewModel($error, $result, $exception, $hasIdentity, $isActive, $expectedSetResultCalled) { $this->event->expects($this->any())->method('getError')->willReturn($error); $this->event->expects($this->any())->method('getResult')->willReturn($result); $this->event->expects($this->any())->method('getParam')->with($this->equalTo('exception'))->willReturn($exception); $this->auth->expects($this->any())->method('hasIdentity')->willReturn($hasIdentity); $this->user->expects($this->any())->method('isActive')->willReturn($isActive); $this->event->expects($this->exactly($expectedSetResultCalled))->method('setResult'); $this->listener->prepareExceptionViewModel($this->event); }