$expected_headers .= "Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
$line_end";
$expected_headers .= "Content-Transfer-Encoding: 8Bit
$line_end";
$expected_headers .= "X-Mailer: Drupal
$line_end";
$expected_headers .= "From: \"Foo, Bar, and Baz\" <from@example.org>
$line_end";
$expected_headers .= "Reply-to: from@example.org
$line_end";
$mailer->
expects($this->
once())->
method('doMail'
) ->
with( $this->
equalTo('to@example.org'
),
$this->
equalTo("=?utf-8?Q?test?={
$line_end} =?utf-8?Q?subject?="
),
$this->
equalTo(''
),
$this->
stringStartsWith($expected_headers),
) ->
willReturn(TRUE
);
$this->
assertTrue($mailer->
mail($message));
}}