Files
smarty/tests/UnitTests/TemplateSource/X_Scopes/templates/test_function_scope.tpl
Simon Wisselink 17d4d43624 Feature/merge smarty-phpunit into tests subfolder (#580)
* Removed unneeded files and replace dummy.txt with .gitignore files
* Synced unit tests with master codebase, noted TODO's, fixed phpunit scripts and travis config
* fix php7.4 deprecation and remove php7.4 from travis allow_failures since php7.4 is current stable

Co-authored-by: Uwe Tews <uwe.tews@googlemail.com>
Co-authored-by: Uwe Tews <uwe.tews@gmail.com>
Co-authored-by: AnrDaemon <anrdaemon@yandex.ru>
2020-04-13 15:30:52 +02:00

35 lines
727 B
Smarty

{strip}
{function 'a'}
{call 'b'}
{/function}
{function 'b'}
{include 'test_function_scope_include.tpl'}
{/function}
{function c}
{call $scope}
{/function}
{function 'none'}
{$foo = 'newvar'}
{checkvar var=foo}
{/function}
{function 'local'}
{$foo = 'newvar' scope='local'}
{checkvar var=foo}
{/function}
{function 'parent'}
{$foo = 'newvar' scope='parent'}
{checkvar var=foo}
{/function}
{function 'tpl_root'}
{$foo = 'newvar' scope='tpl_root'}
{checkvar var=foo}
{/function}
{function 'smarty'}
{$foo = 'newvar' scope='smarty'}
{checkvar var=foo}
{/function}
{function 'global'}
{$foo = 'newvar' scope='global'}
{checkvar var=foo}
{/function}
{call 'a'}