From 539ec42921a673583a0382a200b4a5192b6e7e85 Mon Sep 17 00:00:00 2001 From: taggon Date: Fri, 14 Oct 2011 03:59:34 +0000 Subject: [PATCH] Rename test file git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9648 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../template/TemplateHandlerTest.class.php | 244 ------------------ 1 file changed, 244 deletions(-) delete mode 100644 tests/classes/template/TemplateHandlerTest.class.php diff --git a/tests/classes/template/TemplateHandlerTest.class.php b/tests/classes/template/TemplateHandlerTest.class.php deleted file mode 100644 index 0887ce3c8..000000000 --- a/tests/classes/template/TemplateHandlerTest.class.php +++ /dev/null @@ -1,244 +0,0 @@ -'; - - static public function provider() - { - return array( - // pipe cond - array( - 'Link', - 'cond > 10){ ?> class="active">Link' - ), - // cond - array( - 'Link1say, hello', - 'Link1cond){ ?>say, hello' - ), - // cond - array( - 'Link1Link2', - 'Link1v==$__Context->k){ ?>Link2' - ), - // for loop - array( - '', - '' - ), - // foreach loop - array( - '', - '' - ), - // while loop - array( - '', - '' - ), - // ~ - array( - 'LinkHello, world', - 'Linkcond){ ?>Hello, world' - ), - // ~ - array( - 'LinkHello, {$world}', - 'Linkcond){ ?>Hello, world ?>' - ), - // ~ ~ - array( - 'LinkHello, worldWow', - 'Linkcond){ ?>Hello, worldWow' - ), - // ~ ~ ~ - array( - 'LinkHello, worldHaHaWow', - 'Linkcond){ ?>Hello, worldcond2){ ?>HaHaWow' - ), - // ~ - array( - '
  • Repeat this
  • ', - 'i=0;$__Context->i<$__Context->len;$__Context->i++){ ?>
  • Repeat this
  • ' - ), - // ~ - array( - '
  • item{$key} : {$val}
  • ', - 'arr&&count($__Context->arr))foreach($__Context->arr as $__Context->key=>$__Context->val){ ?>
  • itemkey ?> : val ?>
  • ' - ), - // ~ - array( - '{$v->text}', - 'item=$__Context->list->getItem()){ ?>v->text ?>' - ), - // ~ ~ ~ ~ - array( - 'ABC', - 'var){ ?>ABC' - ), - // invalid block statement - array( - '', - '' - ), - // {@ ...PHP_CODE...} - array( - '{@$list_page = $page_no}', - 'list_page = $__Context->page_no ?>' - ), - // %load_js_plugin - array( - '', - '' - ), - // #include - array( - '
    This is another dummy
    ', - 'compile(\'tests/classes/template\',\'sample.html\') ?>
    This is another dummy
    ' - ), - // - array( - '
    This is another dummy
    ', - 'compile(\'tests/classes\',\'sample.html\') ?>
    This is another dummy
    ' - ), - // - array( - '', - '' - ), - // - array( - '', - '' - ), - // - array( - '', - '' - ), - // - array( - '', - 'compile(); ?>' - ), - // - array( - '', - '' - ), - // - array( - '', - '' - ), - // comment - array( - '', - '' - ), - // self-closing tag - array( - '', - 'foo){ ?>' - ), - // relative path1 - array( - '', - '' - ), - // relative path2 - array( - '', - '' - ), - // error case - array( - 'logo', - 'layout_info->logo_image){ ?>logo' - ), - // error case - ignore stylesheets - array( - '', - '' - ), - // error case - ignore json - array( - '', - '' - ), - // error case - inline javascript - array( - '
    ', - '
    ' - ), - // issue 103 - array( - '', - '' - ), - // issue 135 - array( - '

    {$key}

    Loop block {$val}
    ', - '_m_list_all&&count($__Context->_m_list_all))foreach($__Context->_m_list_all as $__Context->key=>$__Context->val){ ?>

    key ?>

    Loop block val ?>
    ' - ), - // issue 136 - array( - '
    bar', - 'var==\'foo\'){ ?>
    bar' - ), - // issue 188 - array( - '
    Hello, world!
    ', - 'ii < $__Context->nn){ ?>dummy&&count($__Context->dummy))foreach($__Context->dummy as $__Context->k=>$__Context->v){ ?>
    Hello, world!
    ' - ), - // issue 190 - array( - '
    Hello, world!
    ', - 'i >= $__Context->n)){ ?>dummy&&count($__Context->dummy))foreach($__Context->dummy as $__Context->k=>$__Context->v){ ?>
    Hello, world!
    ' - ), - // issue 183 - array( - ''."\n".'
    {$vvv}
    CD
    ', - 'vvvls&&count($__Context->vvvls))foreach($__Context->vvvls as $__Context->vvv){ ?>'."\n".'
    vvv ?>
    CD
    ' - ), - ); - } - - /** - * @dataProvider provider - */ - public function testParse($tpl, $expected) - { - $tmpl = TemplateHandler::getInstance(); - $tmpl->init(dirname(__FILE__), 'sample.html'); - $result = $tmpl->parse($tpl); - - $this->assertEquals($result, $this->prefix.$expected); - } - - public function testParse2() - { - $tmpl = TemplateHandler::getInstance(); - $tmpl->init(dirname(__FILE__), 'no_file.html'); - - $result = $tmpl->parse(); - $this->assertEquals($result, ''); - } - - public function testCompileDirect() - { - $tmpl = TemplateHandler::getInstance(); - $result = $tmpl->compileDirect(dirname(__FILE__), 'sample.html'); - $result = trim($result); - - $this->assertEquals($result, $this->prefix.'has_blog){ ?>Taggon\'s blog'); - } -}