mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 04:24:14 +09:00
Separate compile unit tests for template v2 into several methods
This commit is contained in:
parent
e72336c90c
commit
720193d9b9
1 changed files with 16 additions and 1 deletions
|
|
@ -1108,7 +1108,7 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
||||||
$this->assertEquals($target, $this->_parse($source));
|
$this->assertEquals($target, $this->_parse($source));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCompile()
|
public function testCompileGeneral()
|
||||||
{
|
{
|
||||||
// General example
|
// General example
|
||||||
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2example.html');
|
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2example.html');
|
||||||
|
|
@ -1148,7 +1148,10 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
||||||
$this->assertStringContainsString('/rhymix/common/js/plugins/ckeditor/', array_first($list)['file']);
|
$this->assertStringContainsString('/rhymix/common/js/plugins/ckeditor/', array_first($list)['file']);
|
||||||
$list = \Context::getCssFile();
|
$list = \Context::getCssFile();
|
||||||
$this->assertStringContainsString('/rhymix/tests/_data/template/css/style.scss', array_first($list)['file']);
|
$this->assertStringContainsString('/rhymix/tests/_data/template/css/style.scss', array_first($list)['file']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCompileLang()
|
||||||
|
{
|
||||||
// Lang
|
// Lang
|
||||||
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2lang.html');
|
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2lang.html');
|
||||||
$tmpl->source_type = 'modules';
|
$tmpl->source_type = 'modules';
|
||||||
|
|
@ -1174,7 +1177,10 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
||||||
$this->_normalizeWhitespace($expected),
|
$this->_normalizeWhitespace($expected),
|
||||||
$this->_normalizeWhitespace($executed_output)
|
$this->_normalizeWhitespace($executed_output)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCompileLoopVariable()
|
||||||
|
{
|
||||||
// Loop variable
|
// Loop variable
|
||||||
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2loops.html');
|
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2loops.html');
|
||||||
$tmpl->disableCache();
|
$tmpl->disableCache();
|
||||||
|
|
@ -1186,7 +1192,10 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
||||||
$this->_normalizeWhitespace($expected),
|
$this->_normalizeWhitespace($expected),
|
||||||
$this->_normalizeWhitespace($executed_output)
|
$this->_normalizeWhitespace($executed_output)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCompilePushStack()
|
||||||
|
{
|
||||||
// Push stack
|
// Push stack
|
||||||
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2pushstack.html');
|
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2pushstack.html');
|
||||||
$tmpl->disableCache();
|
$tmpl->disableCache();
|
||||||
|
|
@ -1199,7 +1208,10 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
||||||
$this->_normalizeWhitespace($executed_output)
|
$this->_normalizeWhitespace($executed_output)
|
||||||
);
|
);
|
||||||
$this->assertEquals(4, count($tmpl->getStack('cms')));
|
$this->assertEquals(4, count($tmpl->getStack('cms')));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCompileValidation()
|
||||||
|
{
|
||||||
// Validation error check
|
// Validation error check
|
||||||
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2validation.html');
|
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2validation.html');
|
||||||
$tmpl->disableCache();
|
$tmpl->disableCache();
|
||||||
|
|
@ -1211,7 +1223,10 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
||||||
$this->_normalizeWhitespace($expected),
|
$this->_normalizeWhitespace($expected),
|
||||||
$this->_normalizeWhitespace($executed_output)
|
$this->_normalizeWhitespace($executed_output)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCompileVariableScope()
|
||||||
|
{
|
||||||
// Variable scope check
|
// Variable scope check
|
||||||
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2varscope.html');
|
$tmpl = new \Rhymix\Framework\Template('./tests/_data/template', 'v2varscope.html');
|
||||||
$tmpl->disableCache();
|
$tmpl->disableCache();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue