public function testThatSomething() { $testObject = new PdfSpy(); $testObject->getOutputFromHtml('<html></html>', array('footer-html' => 'footer')); $this->assertRegExp("/emptyBinary --lowquality --footer-html '.*' '.*' '.*'/", $testObject->getLastCommand()); $testObject->getOutputFromHtml('<html></html>', array()); $this->assertRegExp("/emptyBinary --lowquality '.*' '.*'/", $testObject->getLastCommand()); }
public function testOptionsAreCorrectlySavedIfItIsLocalOrRemoteContent() { $testObject = new PdfSpy(); $testObject->setTemporaryFolder(__DIR__); $testObject->getOutputFromHtml('<html></html>', array('footer-html' => 'footer', 'xsl-style-sheet' => 'http://google.com')); $this->assertRegExp("/emptyBinary --lowquality --footer-html '.*.html' --xsl-style-sheet '.*.xsl' '.*.html' '.*.pdf'/", $testObject->getLastCommand()); }
/** * @expectedException PHPUnit_Framework_Error */ public function testThatSomethingUsingWrongTmpFolder() { $testObject = new PdfSpy(); $testObject->setTemporaryFolder(__DIR__ . '/i-dont-exist'); $testObject->getOutputFromHtml('<html></html>', array('footer-html' => 'footer')); }
/** * @dataProvider dataOptions */ public function testOptions(array $options, $expectedRegex) { $testObject = new PdfSpy(); $testObject->getOutputFromHtml('<html></html>', $options); $this->assertRegExp($expectedRegex, $testObject->getLastCommand()); }