Location: PHPKode > projects > PHPTAL > PHPTAL-1.2.2/tests/TalesPhpTest.php
<?php
/**
 * PHPTAL templating engine
 *
 * PHP Version 5
 *
 * @category HTML
 * @package  PHPTAL
 * @author   Laurent Bedubourg <hide@address.com>
 * @author   Kornel Lesiński <hide@address.com>
 * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
 * @version  SVN: $Id: TalesPhpTest.php 888 2010-06-08 09:48:33Z kornel $
 * @link     http://phptal.org/
 */


class TalesPhpTest extends PHPTAL_TestCase {

    function testMix()
    {
        $tpl = $this->newPHPTAL('input/php.html');
        $tpl->real = 'real value';
        $tpl->foo = 'real';
        $res = normalize_html($tpl->execute());
        $exp = normalize_html_file('output/php.html');
        $this->assertEquals($exp, $res);
    }

    function testPHPAttribute()
    {
        $tpl = $this->newPHPTAL();
        $tpl->setSource('<foo bar="<?php  echo  \'baz\' ; ?>"/>');
        $this->assertEquals('<foo bar="baz"></foo>', $tpl->execute());
    }
}

Return current item: PHPTAL