mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Dev flags
This commit is contained in:
@@ -18,6 +18,17 @@ class ExtendsTest extends TestCase
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function providerExtendsInvalid()
|
||||
{
|
||||
return array(
|
||||
array('{extends "extends/dynamic/child.3.tpl"} {extends "extends/dynamic/child.3.tpl"}', 'Fenom\Error\CompileException', "Only one {extends} allowed"),
|
||||
array('{if true}{extends "extends/dynamic/child.3.tpl"}{/if}', 'Fenom\Error\CompileException', "Tag {extends} can not be nested"),
|
||||
array('{if true}{use "extends/dynamic/use.tpl"}{/if}', 'Fenom\Error\CompileException', "Tag {use} can not be nested"),
|
||||
array('{use $use_this}', 'Fenom\Error\CompileException', "Invalid template name for tag {use}"),
|
||||
array('{block $use_this}{/block}', 'Fenom\Error\CompileException', "Invalid block name"),
|
||||
);
|
||||
}
|
||||
|
||||
public function testAutoExtendsManual()
|
||||
{
|
||||
$child = $this->fenom->getRawTemplate()->load('extends/auto/child.1.tpl', false);
|
||||
@@ -132,5 +143,14 @@ Before footer
|
||||
Footer from use";
|
||||
$this->assertSame($result, $this->fenom->fetch('extends/dynamic/child.4.tpl', array()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group static-invalid
|
||||
* @dataProvider providerExtendsInvalid
|
||||
*/
|
||||
public function testExtendsInvalid($code, $exception, $message, $options = 0)
|
||||
{
|
||||
$this->execError($code, $exception, $message, $options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user