public function testCanNotSendMessageWhenHasNotPermission() { $recipient = ParticipantMockBuilder::createParticipant($this, 2); $this->authorizer->expects($this->once())->method('canSendMessageTo')->with($recipient)->will($this->returnValue(false)); $this->assertFalse($this->extension->canSendMessage($recipient)); }