Phalcon\Test\Unit\Mvc\View\Engine\Volt\CompilerTest::testVoltEngineLoopContext PHP Method

testVoltEngineLoopContext() public method

    public function testVoltEngineLoopContext()
    {
        $this->specify("Volt loops don't work", function () {
            $volt = new Compiler();
            $compiled = $volt->compileString('{% for i in 1..5 %}{{ loop.self.index }}{% endfor %}');
            ob_start();
            eval('?>' . $compiled);
            $result = ob_get_clean();
            expect($result)->equals('12345');
        });
    }