Skip to content

Commit

Permalink
Merge pull request #5 from jellehenkens/unit-tests
Browse files Browse the repository at this point in the history
Adding unit tests for setting and getting the engine
  • Loading branch information
ceeram committed May 11, 2012
2 parents 73dea75 + 390215c commit 2a8f0b2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Test/Case/Pdf/CakePdfTest.php
Expand Up @@ -34,6 +34,28 @@ public static function provider() {
))));
}

/**
* Tests expection to be thrown for a non existing engine
*
* @expectedException Exception
*/
public function testNonExistingEngineException() {
$config = array('engine' => 'NonExistingEngine');

$pdf = new CakePdf($config);
}

/**
* Tests that engine returns the proper object
*
* @dataProvider provider
*/
public function testEngine($config) {
$pdf = new CakePdf($config);
$engine = $pdf->engine();
$this->assertEqual('PdfTestEngine', get_class($engine));
}

/**
*
* @dataProvider provider
Expand Down

0 comments on commit 2a8f0b2

Please sign in to comment.