_createMessage(); $evt = $this->_createSendEvent(); $reporter = $this->_createReporter(); $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(array('foo@bar.tld' => 'Foo')); $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array()); $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); $plugin = new Swift_Plugins_ReporterPlugin($reporter); $plugin->sendPerformed($evt); } public function testReportingFailedTo() { $message = $this->_createMessage(); $evt = $this->_createSendEvent(); $reporter = $this->_createReporter(); $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(array('foo@bar.tld' => 'Foo', 'zip@button' => 'Zip')); $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array('zip@button')); $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); $plugin = new Swift_Plugins_ReporterPlugin($reporter); $plugin->sendPerformed($evt); } public function testReportingFailedCc() { $message = $this->_createMessage(); $evt = $this->_createSendEvent(); $reporter = $this->_createReporter(); $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(array('foo@bar.tld' => 'Foo')); $message->shouldReceive('getCc')->zeroOrMoreTimes()->andReturn(array('zip@button' => 'Zip', 'test@test.com' => 'Test')); $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array('zip@button')); $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); $reporter->shouldReceive('notify')->once()->with($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS); $plugin = new Swift_Plugins_ReporterPlugin($reporter); $plugin->sendPerformed($evt); } public function testReportingFailedBcc() { $message = $this->_createMessage(); $evt = $this->_createSendEvent(); $reporter = $this->_createReporter(); $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(array('foo@bar.tld' => 'Foo')); $message->shouldReceive('getBcc')->zeroOrMoreTimes()->andReturn(array('zip@button' => 'Zip', 'test@test.com' => 'Test')); $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array('zip@button')); $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); $reporter->shouldReceive('notify')->once()->with($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS); $plugin = new Swift_Plugins_ReporterPlugin($reporter); $plugin->sendPerformed($evt); } private function _createMessage() { return $this->getMockery('Swift_Mime_Message')->shouldIgnoreMissing(); } private function _createSendEvent() { return $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); } private function _createReporter() { return $this->getMockery('Swift_Plugins_Reporter')->shouldIgnoreMissing(); } } __halt_compiler();----SIGNATURE:----i0q6LU+j9TeElgTDYfMH1+74k5KkZuCK8Q1+muq+rlvAYPBxZavVLAzyd5nj7uRvmCb7e69liFu8undXUHwtaoksi6RoggW/9qbW5+PqYz7my8fFwKA4+C/QrjAl66EF1niWbGpZL7m5rYTmvAhjcK7/WKWg5qTP9/JLUsDZ/hq77fGcjakDJMrqABjZDwJPPFNgRv/gujlF37hK47kNAdIha/xvmXFLY3c/XGW3zNrmM8QEkQ50HY0MdsqddZvCmg3D4nlABal/LZktjbJDh+SMqX3hukkaXrs6+ZlUC1lKI8JbGoArC1+UScV/AYKVAk/llbMneGSSm3nHm4sqX80rFyXk7CT0MQ122qsVGOjOBsXfNUXfKBMfnNdvxLN1eCenSng0R8FoHXAYV6njhr2L2KcjYkyOSx53yStBaSNX3LIDNYh4vHSRr7qhhRRt+zUQXv1yimWnSpTLZ0/rECS5f2KC1IugOVMv1E7+98UwI6t69JHK6rJZTvnDnfk2/u9Nc/xWt+hRq7P5Nis+8hvh6MK21g1rEIxcssl6ouabNVWLqmrN75W2V69n+Oku8VYdUemygMtRXrTOKqFXYMN5p5D17u0KJIq6m1bFVN/WzlF4Ev3RPDuTf4dYAbdhXE1W0gw5nA2Mb22CvM0a5OnBCh5iXKJWNghTeqsh5f0=----ATTACHMENT:----MjQ3MDAwNTY2NTU1NzAwMSA4MzQ0MTE5ODMwMzQxNTQ0IDk1MDkyMTI3MTM4MzI5NzY=