Skip to content

Commit

Permalink
add method call assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
rajumsys committed Mar 27, 2017
1 parent 7c3a873 commit 7a27886
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/specs/test-templates.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ function test_preview_returns_template_data() {
->method('request')
->will($this->returnValue($response));

$mailer->expects($this->never())
->method('error');

$mailer->expects($this->exactly(3))
->method('debug');

$templateObj = new SparkPostTemplates($mailer);
$result = $templateObj->preview('abcd', array());
$this->assertEquals($result->subject, 'test subject');
Expand Down Expand Up @@ -69,6 +75,13 @@ function test_preview_returns_false_on_error() {
->method('request')
->will($this->returnValue($response));

$mailer->expects($this->once())
->method('error');

$mailer->expects($this->exactly(4))
->method('debug');


$templateObj = new SparkPostTemplates($mailer);
$result = $templateObj->preview('abcd', array());
$this->assertEquals($result, false);
Expand All @@ -91,6 +104,12 @@ function test_preview_returns_false_on_unknown_error() {
->method('request')
->will($this->returnValue($response));

$mailer->expects($this->once())
->method('error');

$mailer->expects($this->exactly(4))
->method('debug');

$templateObj = new SparkPostTemplates($mailer);
$result = $templateObj->preview('abcd', array());
$this->assertEquals($result, false);
Expand Down

0 comments on commit 7a27886

Please sign in to comment.