Add XHTMLCompiler_Page->getAbsolutePath() for convenient internal links.
[xhtml-compiler.git] / tests / XHTMLCompilerHarness.php
blobfc9a37d125fbd738a354f05687c07cf1d0b81840
1 <?php
3 class XHTMLCompilerHarness extends UnitTestCase
6 /**
7 * Instances of the XHTMLCompiler and XHTMLCompiler_PHP mocks we
8 * can configure.
9 */
10 protected $php, $xc;
12 /**
13 * The old XHTMLCompiler and XHTMLCompiler_PHP instances that are
14 * restored after testing.
16 protected $oldPhp, $oldXc;
18 function setUp() {
19 $this->xc = new XHTMLCompilerMock();
20 $this->php = new XHTMLCompiler_PHPMock();
21 if (empty($this->oldPhp) && empty($this->oldXc)) {
22 $this->oldXc = XHTMLCompiler::getInstance();
23 $this->oldPhp = XHTMLCompiler::getPHPWrapper();
25 XHTMLCompiler::setInstance($this->xc);
26 XHTMLCompiler::setPHPWrapper($this->php);
29 function tearDown() {
30 $this->xc->tally();
31 $this->php->tally();
32 XHTMLCompiler::setInstance($this->oldXc);
33 XHTMLCompiler::setPHPWrapper($this->oldPhp);