Skip to content

Commit

Permalink
Use arguments to make sure they are being passed
Browse files Browse the repository at this point in the history
  • Loading branch information
jadb committed May 28, 2015
1 parent 54f6990 commit 2696ff2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/TestCase/Mailer/MailerTest.php
Expand Up @@ -59,22 +59,26 @@ public function testProxies()
$email = $this->getMockForEmail('setHeaders');
$email->expects($this->once())
->method('setHeaders')
->with([]);
$result = (new TestMailer($email))->setHeaders([]);
->with(['X-Something' => 'nice']);
$result = (new TestMailer($email))->setHeaders(['X-Something' => 'nice']);
$this->assertInstanceOf('TestApp\Mailer\TestMailer', $result);

$email = $this->getMockForEmail('addHeaders');
$email->expects($this->once())
->method('addHeaders')
->with([]);
$result = (new TestMailer($email))->addHeaders([]);
->with(['X-Something' => 'very nice', 'X-Other' => 'cool']);
$result = (new TestMailer($email))->addHeaders(['X-Something' => 'very nice', 'X-Other' => 'cool']);
$this->assertInstanceOf('TestApp\Mailer\TestMailer', $result);

$email = $this->getMockForEmail('attachments');
$email->expects($this->once())
->method('attachments')
->with([]);
$result = (new TestMailer($email))->attachments([]);
->with([
['file' => CAKE . 'basics.php', 'mimetype' => 'text/plain']
]);
$result = (new TestMailer($email))->attachments([
['file' => CAKE . 'basics.php', 'mimetype' => 'text/plain']
]);
$this->assertInstanceOf('TestApp\Mailer\TestMailer', $result);
}

Expand Down

0 comments on commit 2696ff2

Please sign in to comment.