assertSame(0, $result['status'], $result['stderr']); $this->assertCount(1, $result['mails'], $result['stderr']); $this->assertSame('', $result['log']); return $result['mails'][0]; } public function testGoesToTheEditorsFromTheQueue(): void { $mail = $this->send('A title', 'Ann', '
Hello.
'); $this->assertSame('editor@xxx.org.za', $mail['headers']['to']); $this->assertSame('x.x.x Queuex
')['subject']); } public function testBodyIsPlainTextOfTheStory(): void { $mail = $this->send('T', 'Ann', "First & bold.
\nLine one
line two
<b> is text “quoted”
"); $this->assertSame("Please review the queue. Ann has sent the following new submission:\n\n" . "First & bold.\n\nLine one\nline two\n\n is text “quoted”" . "\n\nhttp://xxx.org.za/publish/edit", trim($mail['body'])); } public function testLongLinesAreWrapped(): void { $body = $this->send('T', 'Ann', '' . str_repeat('word ', 40) . '
')['body']; foreach (explode("\n", trim($body)) as $line) $this->assertLessThanOrEqual(75, strlen($line)); } public function testImageSubmissionSaysSo(): void { $body = $this->send('T', 'Ann', '')['body']; $this->assertStringContainsString("new submission:\n\n