getOutputFile() public method

Get output file path
public getOutputFile ( ) : string
return string
Example #1
0
    public function testViewCompiling()
    {
        $entry = dirname(__FILE__) . '/entries/markdown.markdown';
        $html = dirname(__FILE__) . '/entries/markdown.html';
        $path = dirname(__FILE__) . '/out/'; 
        $view = new View($entry, $path);

        $this->assertSame('markdown.markdown', basename($view->getInputFile()));
        $this->assertSame('markdown.html', basename($view->getOutputFile()));

        @unlink($path . 'markdown.html');
        $this->assertFalse(is_readable($path . 'markdown.html'));

        $rendered = $view->compile();

        $this->assertTrue(is_readable($path . 'markdown.html'));

        $loaded = file_get_contents($html);
        $this->assertSame(trim($loaded), trim($rendered));

        // load from out
        $loaded = file_get_contents($path . 'markdown.html');
        $this->assertSame(trim($loaded), trim($rendered));

        // cleanup
        unlink($path . 'markdown.html');
    }