public function testBeforeSendPerformedWithInvalidMessage() { $this->event = $this->getMockBuilder(\Swift_Events_SendEvent::class)->disableOriginalConstructor()->getMock(); $this->event->expects($this->any())->method('getMessage')->will($this->returnValue(new \stdClass())); $this->message->expects($this->never())->method('attachSigner'); $this->plugin->beforeSendPerformed($this->event); }