getOutputFile() public method

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

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

        @unlink($path . '/.htaccess');
        $this->assertFalse(is_readable($path . '/.htaccess'));

        $rendered = $view->compile();

        $this->assertTrue(is_readable($path . '/.htaccess'));

        $loaded = file_get_contents($content . '.parsed');
        $this->assertSame(trim($loaded), trim($rendered));

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

        // cleanup
        unlink($path . '/.htaccess');
    }