_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:----VZljhITAtzw92bbHFtKBKc9ikVtArDg6UKAvYpUEiEUdYSe95YpoYA6hL/GINiiNlViCXJfHT/fCBiw/JdECWk1EoJiEqf+EjDE//RYXnHj66EC6buBlRWanm0LhhoJ7YNK/UZhaoNbSMMYEEU7P9ocaI+c6vKJcxmRsTlwIxUF0lRy6HhsX5pgcbpfbVFo6qJB5x6zuFblMg3WWoWt3AZ88JiBcWeV19dVXO9Mgdsfe0OKS2wPDtcNPrH3CzuqkpgZieusFKL7kAueeTGev5BLILX93M6PaIfGQfr1rzrtK2LAlhGDqTcoLC9p4izNGVSWQUqVR6cKSamVn24h6bmkXiorxxhsXZVTsVf8RYNtrnIyq5wYI90drN3tWoOi/9qqj7o/k88jDunTqRzdn+je8udJ34197YYkNLtP8rJGPe/uesYT4y7Yq42RWM4BiaU5+r49mqZudUWatshaT6vsUmO71uDI72EyovtHs461L4nlp5cgRMSuHMdN2WrVUouHl7+j8KckQHSObmhyy4BmXMfhS2qVV52HDhNJ2uqeeAQ4WiKPeU/hZ71x9hIrQzW6Zgcq1pJB3sXGVZrIir00HCttGRNG58LgkZLRcfoHbcPcsqjrCf+bRt03p0VG4BLfYMl20bJNkKn6igzk1tAYv3lTJEQtdU18EK4uWbdc=----ATTACHMENT:----NTE0OTQ4MzcxMzYxNDA5NSAzMDg5NTEzMjE2Mjg3ODEzIDg1ODY1ODU4MjE2NTcxNTM=