3 class Swift_Plugins_Reporters_HitReporterTest extends \PHPUnit\Framework\TestCase
8 protected function setUp()
10 $this->hitReporter = new Swift_Plugins_Reporters_HitReporter();
11 $this->message = $this->getMockBuilder('Swift_Mime_SimpleMessage')->disableOriginalConstructor()->getMock();
14 public function testReportingFail()
16 $this->hitReporter->notify($this->message, 'foo@bar.tld',
17 Swift_Plugins_Reporter::RESULT_FAIL
19 $this->assertEquals(['foo@bar.tld'],
20 $this->hitReporter->getFailedRecipients()
24 public function testMultipleReports()
26 $this->hitReporter->notify($this->message, 'foo@bar.tld',
27 Swift_Plugins_Reporter::RESULT_FAIL
29 $this->hitReporter->notify($this->message, 'zip@button',
30 Swift_Plugins_Reporter::RESULT_FAIL
32 $this->assertEquals(['foo@bar.tld', 'zip@button'],
33 $this->hitReporter->getFailedRecipients()
37 public function testReportingPassIsIgnored()
39 $this->hitReporter->notify($this->message, 'foo@bar.tld',
40 Swift_Plugins_Reporter::RESULT_FAIL
42 $this->hitReporter->notify($this->message, 'zip@button',
43 Swift_Plugins_Reporter::RESULT_PASS
45 $this->assertEquals(['foo@bar.tld'],
46 $this->hitReporter->getFailedRecipients()
50 public function testBufferCanBeCleared()
52 $this->hitReporter->notify($this->message, 'foo@bar.tld',
53 Swift_Plugins_Reporter::RESULT_FAIL
55 $this->hitReporter->notify($this->message, 'zip@button',
56 Swift_Plugins_Reporter::RESULT_FAIL
58 $this->assertEquals(['foo@bar.tld', 'zip@button'],
59 $this->hitReporter->getFailedRecipients()
61 $this->hitReporter->clear();
62 $this->assertEquals([], $this->hitReporter->getFailedRecipients());