_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:----cxGOIJE+LKJjRwE3UgK9jbRJroCk1l56zDZoRFlomSdT6RfQ3yUOFEhaOMEDZCOP09gsQVJw+Qnqrm8QDNuG5SDN4ieQOs7MFDY3FMmxGCxzwLLwKnKCcsD5Q+F7EGY/9EHRfl8PPHWDWPCuxjaXFf7y8Qbwy67rBZ3G+e5UKzyfDR/c0CqaFB34eblB+la3KtHhoD9cUtZOUTKL0Z4ecFKm8IumjuQQ0avfaNC3TNFzvnk/KW2HJqTHiV3lEugDRu8mIVvMBV1RFscNe1d35EdgctixR/oGkHqGLv/EPMdfUZQTeml19+6JSsXgAkup2bAZMpOdhAN4CywJZ7tdQ8cokpkTbA2zl0gLjaYT55ys5k3urg//HSY5GybkpcetNTHFK7VjgBYrfVSAHRh1XRaeBzbNJPKoQxD1H3C3D+cmh5GQ98+s+/tDSfWbe4mW42fQfOcgo2agJKrqb93xRpG9wn+KwhW/ZlkfQk3+bcwZ9/1PISIKOvsK9Xn5uHc/vPZrSIOUnNTC/zwLU8upuFvD71Vu25yy/yp/60hkxy14JRWlhDj7JZX1F8KdhxiTX2Yl1NG3rKcs41J4elreSJB72hdmRN2LO3AyYF3clAPmlyQmYaM8KCejtf8vHSfEfIdlAxu7J44yapfKC4SqHkQPP9s7XABtYFgc/IrwPsw=----ATTACHMENT:----MjYxNTUyMzYyMzExMzEyIDIyMzU0Mjc4ODk5OTQyMDAgNDk3MDU0ODAzNDQzMzk5OQ==