public function testReportingFailedBcc() { $message = $this->_createMessage(); $evt = $this->_createSendEvent(); $reporter = $this->_createReporter(); $this->_checking(Expectations::create()->allowing($message)->getTo()->returns(array('*****@*****.**' => 'Foo'))->allowing($message)->getBcc()->returns(array('zip@button' => 'Zip', '*****@*****.**' => 'Test'))->allowing($evt)->getMessage()->returns($message)->allowing($evt)->getFailedRecipients()->returns(array('zip@button'))->one($reporter)->notify($message, '*****@*****.**', Swift_Plugins_Reporter::RESULT_PASS)->one($reporter)->notify($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL)->one($reporter)->notify($message, '*****@*****.**', Swift_Plugins_Reporter::RESULT_PASS)->ignoring($message)->ignoring($evt)); $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')); $message->shouldReceive('getBcc')->zeroOrMoreTimes()->andReturn(array('zip@button' => 'Zip', '*****@*****.**' => 'Test')); $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(array('zip@button')); $reporter->shouldReceive('notify')->once()->with($message, '*****@*****.**', Swift_Plugins_Reporter::RESULT_PASS); $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); $reporter->shouldReceive('notify')->once()->with($message, '*****@*****.**', Swift_Plugins_Reporter::RESULT_PASS); $plugin = new Swift_Plugins_ReporterPlugin($reporter); $plugin->sendPerformed($evt); }