From aa2dcd82cf6a5caac9b1ed51e4bd0283f4dcced7 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Fri, 10 Apr 2026 22:57:32 +0200 Subject: Added AGENTS.md for improved vibe coding experience --- AGENTS.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..44851293 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,75 @@ +# AGENTS.md + +## Project + +Smarty v5 — PHP template engine. Single Composer package (`smarty/smarty`), namespace `Smarty\`, source in `src/`, autoloaded via PSR-4. Supports PHP 7.2–8.5. + +## Commands + +```bash +# Install dependencies +composer install + +# Regenerate lexers and parsers (required before tests; CI runs this) +make -B + +# Run all tests +php ./vendor/phpunit/phpunit/phpunit + +# Run a single test file +php ./vendor/phpunit/phpunit/phpunit tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php + +# Run tests matching a PHPUnit group +php ./vendor/phpunit/phpunit/phpunit --group 20221124 + +# Run tests excluding slow group +php ./vendor/phpunit/phpunit/phpunit --exclude-group slow +``` + +There is no linter or static analysis configured. No typecheck step. + +## Generated code — do not hand-edit + +Four files are generated from grammar/lexer definitions via `make`: + +| Source (edit this) | Generated (do not edit) | +|---|---| +| `src/Lexer/TemplateLexer.plex` | `src/Lexer/TemplateLexer.php` | +| `src/Lexer/ConfigfileLexer.plex` | `src/Lexer/ConfigfileLexer.php` | +| `src/Parser/TemplateParser.y` | `src/Parser/TemplateParser.php` | +| `src/Parser/ConfigfileParser.y` | `src/Parser/ConfigfileParser.php` | + +After editing a `.plex` or `.y` file, run `make -B` to regenerate. The generators require the `smarty/smarty-lexer` dev dependency. + +## Architecture + +- `src/Smarty.php` — main class, extends `TemplateBase`. Version constant: `Smarty::SMARTY_VERSION`. +- `src/Compile/`, `src/Compiler/` — template compilation pipeline. +- `src/Lexer/`, `src/Parser/` — lexer/parser (generated, see above). +- `src/Extension/` — extension system (`ExtensionInterface`, `CoreExtension`, `DefaultExtension`, `BCPluginsAdapter`). +- `src/Runtime/` — runtime helpers (foreach, capture, inheritance, tpl functions). +- `src/Resource/`, `src/Cacheresource/` — template resource and cache resource handlers. +- `src/BlockHandler/`, `src/FunctionHandler/`, `src/Filter/` — built-in tags, functions, and filters. +- `libs/Smarty.class.php` — non-Composer autoload stub. Points to `src/`. Not the main source. +- `src/functions.php` — global helper functions, always loaded via Composer `files` autoload. + +## Tests + +- Framework: PHPUnit 7.5/8.5 (bootstrap: `tests/Bootstrap.php`). +- All tests extend `PHPUnit_Smarty` (defined in `tests/PHPUnit_Smarty.php`), which provides `setUpSmarty($dir)`. +- Test suite root: `tests/UnitTests/`. Typical test `setUp()` calls `$this->setUpSmarty(__DIR__)`. +- Each test directory may have its own `templates/`, `configs/` subdirectories. Compiled output goes to `templates_c/` and `cache/` (auto-created by the test harness). +- Three test files are excluded in `phpunit.xml`: Memcache, APC, and HttpModifiedSince tests (require external services). +- Tests needing MySQL/PDO are gated by constants in `tests/Config.php` (disabled by default). + +## CI + +GitHub Actions (`.github/workflows/ci.yml`): matrix of PHP 7.2–8.5 on ubuntu + windows. Steps: `composer install` → `make -B` → `phpunit`. No deploy step. + +## Docs + +Markdown in `docs/`, built with mkdocs + Material theme. Preview: `mkdocs serve`. Published via `mike deploy 5.x`. + +## Release + +`./make-release.sh ` — only v5.x.x. Updates changelog and version constant, creates a merge commit and tag on `master`. -- cgit v1.3 From ff2ef3b0cb07fd584946254f145f0509a7685f58 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 13 Apr 2026 21:36:33 +0200 Subject: Redirect test temp dirs to system temp directory * Redirect test temp dirs to system temp directory. Fixes #1178 Move all test-generated output (compiled templates, cache files, and temporary template sources) from per-test-directory folders inside the working tree to a parallel structure under sys_get_temp_dir()/smarty-tests/. This removes 215 boilerplate .gitignore files from the repo and ensures running the test suite leaves zero uncommitted files in the working tree. All 2296 tests continue to pass with identical behavior. * Isolate each test class in a unique temp directory getTempDir() now appends a per-class uniqid token to the temp path, so concurrent or sequential test runs never share compiled/cached output. The token is generated lazily on first use and reset in tearDownAfterClass(), giving every test class a fresh isolated directory. As a result, the Bootstrap.php pre-run cleanup of smarty-tests/ is no longer needed for correctness (stale paths are unreachable) and was harmful to concurrent runs, so it has been removed. * Remove individualFolders dead code and spurious assertTrue from cleanDirs() - Remove the never-active individualFolders code path from setUpSmarty() (the constant was always true, making the branch unreachable) - Remove define('individualFolders') from Config.php and the constructor - Remove $this->assertTrue(true) from cleanDirs(): it existed solely to make testInit() count as a passing test; now that cleanDirs() is called from setUpSmarty() and from test methods directly, the assertion was spuriously inflating assertion counts - Add tests/**/templates_c/, cache/, templates_tmp/ to .gitignore to prevent stale test output from appearing as untracked files * Clean up each test class's unique temp dir in tearDownAfterClass() Add a private static removeDir() helper and call it from tearDownAfterClass() to recursively delete the per-class unique temp directory after each test class finishes. Cleanup failures are silently ignored (@ suppression) so they never cause test failures. Set KEEP_SMARTY_TEST_ARTIFACTS=1 in the environment to skip cleanup and keep the artifacts on disk for debugging. * cleanup of unused template files, non-shared files stored in __shared folder, no longer required calls to add template folders et cetera * fixed the unit tests * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * remove useless resetting of static properties in tearDownAfterClass * changed an incorrect doc and formatted some code. * add changelog --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .gitignore | 2 + changelog/1179.md | 1 + tests/Bootstrap.php | 1 - tests/Config.php | 1 - tests/PHPUnit_Smarty.php | 170 +++++++--- .../TemlateDirNormalizationTest.php | 1 + .../A_0/PathNormalization/cache/.gitignore | 2 - .../A_0/PathNormalization/templates_c/.gitignore | 2 - .../A_1/ProtectedFolderVars/cache/.gitignore | 2 - .../UndefinedTemplateVarTest.php | 4 - .../A_2/UndefinedTemplateVar/cache/.gitignore | 2 - .../UndefinedTemplateVar/templates_c/.gitignore | 2 - tests/UnitTests/A_Core/AutoEscape/cache/.gitignore | 2 - .../A_Core/AutoEscape/templates_c/.gitignore | 2 - tests/UnitTests/A_Core/Filter/FilterTest.php | 4 - tests/UnitTests/A_Core/Filter/cache/.gitignore | 2 - .../UnitTests/A_Core/Filter/templates_c/.gitignore | 2 - .../A_Core/GetterSetter/GetterSetterTest.php | 4 - .../UnitTests/A_Core/GetterSetter/cache/.gitignore | 2 - .../A_Core/GetterSetter/templates_c/.gitignore | 2 - .../A_Core/LoadPlugin/DefaultPluginHandlerTest.php | 4 - tests/UnitTests/A_Core/LoadPlugin/cache/.gitignore | 2 - .../A_Core/LoadPlugin/templates_c/.gitignore | 2 - .../ModifiedSince/HttpModifiedSinceTest.php | 4 - .../CacheModify/ModifiedSince/cache/.gitignore | 2 - .../ModifiedSince/templates_c/.gitignore | 2 - .../File/CacheResourceFileTest.php | 5 - .../CacheResourceTests/File/cache/.gitignore | 2 - .../CacheResourceTests/File/templates_c/.gitignore | 2 - .../Memcache/CacheResourceCustomMemcacheTest.php | 4 - .../Memcache/templates_c/.gitignore | 2 - .../Mysql/CacheResourceCustomMysqlTest.php | 6 +- .../CacheResourceTests/Mysql/cache/.gitignore | 2 - .../Mysql/templates_c/.gitignore | 2 - .../PDO/CacheResourceCustomPDOTest.php | 6 +- .../PDO/cacheresource.pdotest.php | 2 +- .../PDOgzip/CacheResourceCustomPDOGzipTest.php | 6 +- .../PDOgzip/cacheresource.pdo_gziptest.php | 2 +- .../CacheResourceCustomRegisteredTest.php | 6 +- .../Registered/templates_c/.gitignore | 2 - .../PHPunitplugins/cacheresource.memcachetest.php | 2 +- .../PHPunitplugins/cacheresource.mysqltest.php | 2 +- .../cacheresources/cacheresource.memcache.php | 101 ++++++ .../_shared/cacheresources/cacheresource.mysql.php | 190 +++++++++++ .../_shared/cacheresources/cacheresource.pdo.php | 347 +++++++++++++++++++++ .../cacheresources/cacheresource.pdo_gzip.php | 42 +++ .../CompilerPlugin/CompileCompilerPluginTest.php | 4 - .../Compiler/CompilerPlugin/cache/.gitignore | 2 - .../Compiler/CompilerPlugin/templates_c/.gitignore | 2 - .../Compiler/Delimiter/AutoLiteralTest.php | 6 +- .../UnitTests/Compiler/Delimiter/DelimiterTest.php | 4 - .../Compiler/Delimiter/UserLiteralTest.php | 4 - .../UnitTests/Compiler/Delimiter/cache/.gitignore | 2 - .../Delimiter/plugins/block.dummyblock.php | 23 ++ .../Compiler/Delimiter/templates_c/.gitignore | 2 - .../defaultHandler/templates_c/.gitignore | 2 - .../ConfigFileTests/file/ConfigVarTest.php | 4 - .../ConfigFileTests/file/templates_c/.gitignore | 2 - .../Ambiguous/CustomResourceAmbiguousTest.php | 4 - .../Custom/Ambiguous/cache/.gitignore | 2 - .../Custom/Ambiguous/templates_c/.gitignore | 2 - .../ResourceExtendsAllPluginTest.php | 6 +- .../Custom/DemoPluginExtendsAll/cache/.gitignore | 2 - .../resources/resource.extendsall.php | 66 ++++ .../DemoPluginExtendsAll/templates_c/.gitignore | 2 - .../DemoPluginMysql/ResourceMysqlPluginTest.php | 10 +- .../Custom/DemoPluginMysql/cache/.gitignore | 2 - .../Custom/DemoPluginMysql/templates_c/.gitignore | 2 - .../DefaultHandler/DefaultTemplateHandlerTest.php | 4 - .../ResourceTests/DefaultHandler/cache/.gitignore | 2 - .../DefaultHandler/templates_c/.gitignore | 2 - .../ResourceTests/Eval/EvalResourceTest.php | 4 - .../UnitTests/ResourceTests/Eval/cache/.gitignore | 2 - .../ResourceTests/Eval/templates_c/.gitignore | 2 - .../ResourceTests/Extends/ExtendsResourceTest.php | 4 - .../ResourceTests/Extends/cache/.gitignore | 2 - .../ResourceTests/Extends/templates_c/.gitignore | 2 - .../ResourceTests/File/FileResourceTest.php | 51 ++- .../UnitTests/ResourceTests/File/cache/.gitignore | 2 - .../ResourceTests/File/templates_c/.gitignore | 2 - .../FileIndexed/FileResourceIndexedTest.php | 5 +- .../ResourceTests/FileIndexed/cache/.gitignore | 2 - .../FileIndexed/templates_c/.gitignore | 2 - .../Registered/RegisteredResourceTest.php | 4 - .../ResourceTests/Registered/cache/.gitignore | 2 - .../Registered/templates_c/.gitignore | 2 - .../ResourcePlugins/ResourcePluginTest.php | 4 - .../ResourceTests/ResourcePlugins/cache/.gitignore | 2 - .../ResourcePlugins/templates_c/.gitignore | 2 - .../ResourceTests/Stream/StreamResourceTest.php | 4 - .../ResourceTests/Stream/cache/.gitignore | 2 - .../ResourceTests/Stream/templates_c/.gitignore | 2 - .../ResourceTests/String/StringResourceTest.php | 4 - .../ResourceTests/String/cache/.gitignore | 2 - .../ResourceTests/String/templates_c/.gitignore | 2 - tests/UnitTests/SecurityTests/FunctionTest.php | 4 - tests/UnitTests/SecurityTests/SecurityTest.php | 4 - tests/UnitTests/SecurityTests/cache/.gitignore | 2 - .../UnitTests/SecurityTests/templates_c/.gitignore | 2 - .../SmartyMethodsTests/Append/AppendTest.php | 4 - .../SmartyMethodsTests/Append/cache/.gitignore | 2 - .../Append/templates_c/.gitignore | 2 - .../SmartyMethodsTests/Assign/AssignTest.php | 4 - .../SmartyMethodsTests/Assign/cache/.gitignore | 2 - .../Assign/templates_c/.gitignore | 2 - .../ClearAllAssign/ClearAllAssignTest.php | 4 - .../ClearAllAssign/cache/.gitignore | 2 - .../ClearAllAssign/templates_c/.gitignore | 2 - .../ClearAssign/cache/.gitignore | 2 - .../ClearAssign/templates_c/.gitignore | 2 - .../ClearCompiledTemplate/ClearCompiledTest.php | 7 +- .../ClearCompiledTemplate/cache/.gitignore | 2 - .../ClearCompiledTemplate/templates_c/.gitignore | 2 - .../CompileCheck/CompileCheckTest.php | 24 +- .../CompileCheck/templates_c/.gitignore | 2 - .../CompileCheck/templates_tmp/.gitignore | 3 - .../RegisterBlock/RegisterBlockTest.php | 4 - .../RegisterBlock/cache/.gitignore | 2 - .../RegisterBlock/templates_c/.gitignore | 2 - .../RegisterCompilerFunctionTest.php | 4 - .../RegisterCompiler/cache/.gitignore | 2 - .../RegisterCompiler/templates_c/.gitignore | 2 - .../RegisterFunction/RegisterFunctionTest.php | 4 - .../RegisterFunction/cache/.gitignore | 2 - .../RegisterFunction/templates_c/.gitignore | 2 - .../RegisterModifierFirstClassCallablesTest.php | 4 - .../RegisterModifier/RegisterModifierTest.php | 4 - .../RegisterModifier/cache/.gitignore | 2 - .../RegisterModifier/templates_c/.gitignore | 2 - .../CompileRegisteredObjectFunctionTest.php | 4 - .../RegisterObject/cache/.gitignore | 2 - .../RegisterObject/templates_c/.gitignore | 2 - .../TemplateExist/TemplateExistsTest.php | 4 - .../TemplateExist/cache/.gitignore | 2 - .../TemplateExist/templates_c/.gitignore | 2 - .../TemplateVars/GetTemplateVarsTest.php | 4 - .../TemplateVars/HasVariableTest.php | 4 - .../TemplateSource/Comments/CommentsTest.php | 5 - .../TemplateSource/Comments/cache/.gitignore | 2 - .../TemplateSource/Comments/templates_c/.gitignore | 2 - .../TemplateSource/Spacing/SpacingTest.php | 5 - .../TemplateSource/Spacing/cache/.gitignore | 2 - .../TemplateSource/Spacing/templates_c/.gitignore | 2 - .../Spacing/templates_tmp/.gitignore | 2 - .../StaticClass/StaticClassAccessTest.php | 4 - .../TemplateSource/StaticClass/cache/.gitignore | 2 - .../StaticClass/templates_c/.gitignore | 2 - .../TagTests/Append/CompileAppendTest.php | 10 - .../TagTests/Append/cache/.gitignore | 2 - .../TagTests/Append/templates_c/.gitignore | 2 - .../TagTests/Append/templates_tmp/.gitignore | 2 - .../TagTests/Assign/CompileAssignTest.php | 10 - .../TagTests/Assign/cache/.gitignore | 2 - .../Assign/templates/test_scope_assignbar.tpl | 1 - .../Assign/templates/test_scope_assignnocache.tpl | 1 - .../TagTests/Assign/templates_c/.gitignore | 2 - .../TagTests/Assign/templates_tmp/.gitignore | 2 - .../BlockPlugin/CompileBlockPluginTest.php | 8 - .../TagTests/BlockPlugin/cache/.gitignore | 2 - .../TagTests/BlockPlugin/templates_c/.gitignore | 2 - .../TagTests/BlockPlugin/templates_tmp/.gitignore | 2 - .../BockExtend/CompileBlockExtendsTest.php | 26 +- .../TagTests/BockExtend/cache/.gitignore | 2 - .../TagTests/BockExtend/templates_c/.gitignore | 2 - .../BockExtend/templates_c/mustcompile/.gitignore | 2 - .../TagTests/BockExtend/templates_tmp/.gitignore | 2 - .../TagTests/Capture/CompileCaptureTest.php | 8 - .../TagTests/Capture/cache/.gitignore | 2 - .../TagTests/Capture/templates_c/.gitignore | 2 - .../TagTests/Capture/templates_tmp/.gitignore | 2 - .../TagTests/CompilerPlugin/CompilerPluginTest.php | 4 - .../TagTests/CompilerPlugin/cache/.gitignore | 2 - .../TagTests/CompilerPlugin/templates_c/.gitignore | 2 - .../TagTests/ConfigLoad/CompileConfigLoadTest.php | 7 - .../TagTests/ConfigLoad/cache/.gitignore | 2 - .../TagTests/ConfigLoad/templates_c/.gitignore | 2 - .../TagTests/Delimiter/CompileDelimiterTest.php | 4 - .../TagTests/Delimiter/cache/.gitignore | 2 - .../TagTests/Delimiter/templates_c/.gitignore | 2 - .../TagTests/Eval/CompileEvalTest.php | 4 - .../TemplateSource/TagTests/Eval/cache/.gitignore | 2 - .../TagTests/Eval/templates_c/.gitignore | 2 - .../TemplateSource/TagTests/For/CompileForTest.php | 6 - .../TemplateSource/TagTests/For/cache/.gitignore | 2 - .../TagTests/For/templates_c/.gitignore | 2 - .../TagTests/For/templates_tmp/.gitignore | 2 - .../TagTests/Foreach/CompileForeachTest.php | 9 - .../TagTests/Foreach/cache/.gitignore | 2 - .../TagTests/Foreach/templates_c/.gitignore | 2 - .../TagTests/Foreach/templates_tmp/.gitignore | 2 - .../FunctionObjectChainTest.php | 4 - .../FunctionPlugin/CompileFunctionPluginTest.php | 7 - .../TagTests/FunctionPlugin/cache/.gitignore | 2 - .../templates/functionplugintestnocache.tpl | 1 - .../TagTests/FunctionPlugin/templates_c/.gitignore | 2 - .../TemplateSource/TagTests/If/CompileIfTest.php | 8 - .../TemplateSource/TagTests/If/cache/.gitignore | 2 - .../TagTests/If/templates/run_code.tpl | 1 + .../TagTests/If/templates/run_code_caching.tpl | 1 + .../TagTests/If/templates_c/.gitignore | 2 - .../TagTests/If/templates_tmp/.gitignore | 2 - .../TagTests/Include/CompileIncludeTest.php | 11 - .../TagTests/Include/cache/.gitignore | 2 - .../TagTests/Include/templates/test_scope.tpl | 1 - .../Include/templates/test_scope_assign.tpl | 1 - .../Include/templates/test_scope_pluginassign.tpl | 1 - .../TagTests/Include/templates_c/.gitignore | 2 - .../TagTests/Include/templates_tmp/.gitignore | 2 - .../TagTests/Literal/LiteralTest.php | 4 - .../TagTests/Literal/cache/.gitignore | 2 - .../TagTests/Literal/templates_c/.gitignore | 2 - .../TagTests/Nocache/CompileNocacheTest.php | 4 - .../TagTests/Nocache/cache/.gitignore | 2 - .../TagTests/Nocache/templates_c/.gitignore | 2 - .../PluginBlock/PluginBlockTextformatTest.php | 4 - .../TagTests/PluginBlock/cache/.gitignore | 2 - .../TagTests/PluginBlock/templates_c/.gitignore | 2 - .../PluginFunction/PluginFunctionFetchTest.php | 4 - .../TagTests/PluginFunction/cache/.gitignore | 2 - .../TagTests/PluginFunction/templates_c/.gitignore | 2 - .../PluginModifierCountSentencesTest.php | 4 - .../TagTests/PluginModifier/cache/.gitignore | 2 - .../TagTests/PluginModifier/templates_c/.gitignore | 2 - .../TagTests/Section/CompileSectionTest.php | 6 - .../TagTests/Section/cache/.gitignore | 2 - .../TagTests/Section/templates_c/.gitignore | 2 - .../TagTests/Section/templates_tmp/.gitignore | 2 - .../TagTests/SetFilter/CompileSetfilterTest.php | 4 - .../TagTests/SetFilter/cache/.gitignore | 2 - .../TagTests/SetFilter/templates_c/.gitignore | 2 - .../TagTests/Strip/CompileStripTest.php | 7 - .../TagTests/Strip/templates_c/.gitignore | 2 - .../TagTests/Strip/templates_tmp/.gitignore | 2 - .../TemplateFunction/CompileFunctionTest.php | 7 - .../TagTests/TemplateFunction/cache/.gitignore | 2 - .../TemplateFunction/templates_c/.gitignore | 2 - .../TemplateFunction/templates_tmp/.gitignore | 2 - .../TagTests/While/CompileWhileTest.php | 6 - .../TemplateSource/TagTests/While/cache/.gitignore | 2 - .../TagTests/While/templates_c/.gitignore | 2 - .../TagTests/While/templates_tmp/.gitignore | 2 - .../TagTests/_Attributes/AttributeTest.php | 6 +- .../TagTests/_Attributes/cache/.gitignore | 2 - .../_Attributes/plugins/function.getparams.php | 22 ++ .../TagTests/_Attributes/templates_c/.gitignore | 2 - .../TagTests/_Error/CompileErrorTest.php | 4 - .../TagTests/_Error/cache/.gitignore | 2 - .../TagTests/_Error/templates_c/.gitignore | 2 - .../TemplateSource/TagTests/_Print/PrintTest.php | 7 - .../TagTests/_Print/cache/.gitignore | 2 - .../TagTests/_Print/templates_c/.gitignore | 2 - .../TagTests/_Print/templates_tmp/.gitignore | 2 - .../TagTests/break/CompileBreakTest.php | 4 - .../TemplateSource/TagTests/break/cache/.gitignore | 2 - .../TagTests/break/templates_c/.gitignore | 2 - .../TemplateSource/ValueTests/Array/ArrayTest.php | 5 - .../ValueTests/Array/cache/.gitignore | 2 - .../ValueTests/Array/templates_c/.gitignore | 2 - .../ValueTests/Array/templates_tmp/.gitignore | 2 - .../ValueTests/BoolenNull/BooleanNullTest.php | 4 - .../ValueTests/BoolenNull/cache/.gitignore | 2 - .../ValueTests/BoolenNull/templates_c/.gitignore | 2 - .../ValueTests/ConstantTests/ConstantsTest.php | 4 - .../ValueTests/ConstantTests/cache/.gitignore | 2 - .../ConstantTests/templates_c/.gitignore | 2 - .../DoubleQuoted/DoubleQuotedStringTest.php | 8 - .../ValueTests/DoubleQuoted/cache/.gitignore | 2 - .../ValueTests/DoubleQuoted/templates_c/.gitignore | 2 - .../DoubleQuoted/templates_tmp/.gitignore | 2 - .../TemplateSource/ValueTests/Math/MathTest.php | 4 - .../ValueTests/Math/cache/.gitignore | 2 - .../ValueTests/Math/templates_c/.gitignore | 2 - .../ValueTests/Modifier/ModifierTest.php | 5 - .../ValueTests/Modifier/cache/.gitignore | 2 - .../ValueTests/Modifier/templates_c/.gitignore | 2 - .../ValueTests/Modifier/templates_tmp/.gitignore | 2 - .../ValueTests/Objects/ObjectVariableTest.php | 4 - .../ValueTests/Objects/cache/.gitignore | 2 - .../ValueTests/Objects/templates_c/.gitignore | 2 - .../ValueTests/Operators/MatchesOperatorTest.php | 4 - .../ValueTests/Operators/OperatorsTest.php | 4 - .../ValueTests/Operators/templates_c/.gitignore | 2 - .../ValueTests/PHPfunctions/PhpFunctionTest.php | 4 - .../ValueTests/PHPfunctions/cache/.gitignore | 2 - .../ValueTests/PHPfunctions/templates_c/.gitignore | 2 - .../SingleQouted/SingleQuotedStringTest.php | 4 - .../ValueTests/SingleQouted/cache/.gitignore | 2 - .../ValueTests/SingleQouted/templates_c/.gitignore | 2 - .../Constant/SmartyConstantTest.php | 4 - .../SmartySpecialVars/Constant/cache/.gitignore | 2 - .../Constant/templates_c/.gitignore | 2 - .../SmartySpecialVars/Cookie/CookieTest.php | 4 - .../SmartySpecialVars/Cookie/cache/.gitignore | 2 - .../Cookie/templates_c/.gitignore | 2 - .../Delimiter/SmartyDelimiterTest.php | 4 - .../SmartySpecialVars/Delimiter/cache/.gitignore | 2 - .../Delimiter/templates_c/.gitignore | 2 - .../SmartySpecialVars/Error/SmartyErrorTest.php | 4 - .../SmartySpecialVars/Error/cache/.gitignore | 2 - .../SmartySpecialVars/Error/templates_c/.gitignore | 2 - .../SmartySpecialVars/Now/SmartyNowTest.php | 4 - .../SmartySpecialVars/Now/cache/.gitignore | 2 - .../SmartySpecialVars/Now/templates_c/.gitignore | 2 - .../ValueTests/SmartySpecialVars/Post/PostTest.php | 4 - .../SmartySpecialVars/Post/cache/.gitignore | 2 - .../SmartySpecialVars/Post/templates_c/.gitignore | 2 - .../TemplateObject/SmartyTemplateObjectTest.php | 4 - .../TemplateObject/cache/.gitignore | 2 - .../TemplateObject/templates_c/.gitignore | 2 - .../Version/SmartyVersionTest.php | 4 - .../SmartySpecialVars/Version/cache/.gitignore | 2 - .../Version/templates_c/.gitignore | 2 - .../Variables/Stream/StreamVariableTest.php | 4 - .../ValueTests/Variables/Stream/cache/.gitignore | 2 - .../Variables/Stream/templates_c/.gitignore | 2 - .../VariableVariable/VariableVariableTest.php | 4 - .../Variables/VariableVariable/cache/.gitignore | 2 - .../VariableVariable/templates_c/.gitignore | 2 - .../TemplateSource/X_Scopes/ScopeTest.php | 8 +- .../TemplateSource/X_Scopes/cache/.gitignore | 2 - .../X_Scopes/plugins/function.checkconfigvar.php | 47 +++ .../X_Scopes/plugins/function.checkvar.php | 47 +++ .../X_Scopes/plugins/function.pluginassign.php | 21 ++ .../X_Scopes/templates/scope_include.tpl | 1 + .../X_Scopes/templates/scope_tag.tpl | 1 + .../TemplateSource/X_Scopes/templates_c/.gitignore | 2 - .../X_Scopes/templates_tmp/.gitignore | 2 - tests/UnitTests/TemplateSource/Xml/XmlTest.php | 4 - .../UnitTests/TemplateSource/Xml/cache/.gitignore | 2 - .../TemplateSource/Xml/templates_c/.gitignore | 2 - .../_Issues/327/ModifierIssue327Test.php | 4 - .../TemplateSource/_Issues/327/cache/.gitignore | 2 - .../_Issues/327/templates_c/.gitignore | 2 - .../_Issues/419/ExtendsIssue419Test.php | 4 - .../TemplateSource/_Issues/419/cache/.gitignore | 2 - .../_Issues/419/templates_c/.gitignore | 2 - .../_Issues/422/NestedLoopIssue422Test.php | 4 - .../TemplateSource/_Issues/422/cache/.gitignore | 2 - .../_Issues/422/templates_c/.gitignore | 2 - .../SectionPropertiesShortSyntaxIssue428Test.php | 4 - .../TemplateSource/_Issues/428/cache/.gitignore | 2 - .../_Issues/428/templates_c/.gitignore | 2 - .../TemplateSource/_Issues/549/cache/.gitignore | 2 - .../_Issues/549/templates_c/.gitignore | 2 - .../_Issues/TooManyShorthandAttributes949Test.php | 6 +- .../_Issues/topic26878/NewlineSpacing.php | 5 - .../_Issues/topic26878/cache/.gitignore | 2 - .../_Issues/topic26878/templates_c/.gitignore | 2 - .../_Issues/topic26878/templates_tmp/.gitignore | 2 - .../__shared/PHPunitplugins/block.dummyblock.php | 23 -- .../PHPunitplugins/compiler.getparamsshort.php | 58 ---- .../PHPunitplugins/function.checkconfigvar.php | 47 --- .../__shared/PHPunitplugins/function.checkvar.php | 47 --- .../__shared/PHPunitplugins/function.getparams.php | 22 -- .../__shared/PHPunitplugins/function.getvar.php | 26 -- .../PHPunitplugins/function.pluginassign.php | 21 -- .../cacheresources/cacheresource.memcache.php | 101 ------ .../cacheresources/cacheresource.mysql.php | 190 ----------- .../__shared/cacheresources/cacheresource.pdo.php | 347 --------------------- .../cacheresources/cacheresource.pdo_gzip.php | 42 --- .../__shared/resources/resource.extendsall.php | 66 ---- tests/UnitTests/__shared/templates/run_code.tpl | 1 - .../__shared/templates/run_code_caching.tpl | 1 - .../UnitTests/__shared/templates/scope_include.tpl | 1 - tests/UnitTests/__shared/templates/scope_tag.tpl | 1 - tests/cache/.gitignore | 2 - tests/templates_c/.gitignore | 2 - 367 files changed, 1102 insertions(+), 2031 deletions(-) create mode 100644 changelog/1179.md delete mode 100644 tests/UnitTests/A_0/PathNormalization/cache/.gitignore delete mode 100644 tests/UnitTests/A_0/PathNormalization/templates_c/.gitignore delete mode 100644 tests/UnitTests/A_1/ProtectedFolderVars/cache/.gitignore delete mode 100644 tests/UnitTests/A_2/UndefinedTemplateVar/cache/.gitignore delete mode 100644 tests/UnitTests/A_2/UndefinedTemplateVar/templates_c/.gitignore delete mode 100644 tests/UnitTests/A_Core/AutoEscape/cache/.gitignore delete mode 100644 tests/UnitTests/A_Core/AutoEscape/templates_c/.gitignore delete mode 100644 tests/UnitTests/A_Core/Filter/cache/.gitignore delete mode 100644 tests/UnitTests/A_Core/Filter/templates_c/.gitignore delete mode 100644 tests/UnitTests/A_Core/GetterSetter/cache/.gitignore delete mode 100644 tests/UnitTests/A_Core/GetterSetter/templates_c/.gitignore delete mode 100644 tests/UnitTests/A_Core/LoadPlugin/cache/.gitignore delete mode 100644 tests/UnitTests/A_Core/LoadPlugin/templates_c/.gitignore delete mode 100644 tests/UnitTests/CacheModify/ModifiedSince/cache/.gitignore delete mode 100644 tests/UnitTests/CacheModify/ModifiedSince/templates_c/.gitignore delete mode 100644 tests/UnitTests/CacheResourceTests/File/cache/.gitignore delete mode 100644 tests/UnitTests/CacheResourceTests/File/templates_c/.gitignore delete mode 100644 tests/UnitTests/CacheResourceTests/Memcache/templates_c/.gitignore delete mode 100644 tests/UnitTests/CacheResourceTests/Mysql/cache/.gitignore delete mode 100644 tests/UnitTests/CacheResourceTests/Mysql/templates_c/.gitignore delete mode 100644 tests/UnitTests/CacheResourceTests/Registered/templates_c/.gitignore create mode 100644 tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.memcache.php create mode 100644 tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.mysql.php create mode 100644 tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.pdo.php create mode 100644 tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.pdo_gzip.php delete mode 100644 tests/UnitTests/Compiler/CompilerPlugin/cache/.gitignore delete mode 100644 tests/UnitTests/Compiler/CompilerPlugin/templates_c/.gitignore delete mode 100644 tests/UnitTests/Compiler/Delimiter/cache/.gitignore create mode 100644 tests/UnitTests/Compiler/Delimiter/plugins/block.dummyblock.php delete mode 100644 tests/UnitTests/Compiler/Delimiter/templates_c/.gitignore delete mode 100644 tests/UnitTests/ConfigFileTests/defaultHandler/templates_c/.gitignore delete mode 100644 tests/UnitTests/ConfigFileTests/file/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Custom/Ambiguous/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Custom/Ambiguous/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/cache/.gitignore create mode 100644 tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/resources/resource.extendsall.php delete mode 100644 tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/DefaultHandler/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/DefaultHandler/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Eval/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Eval/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Extends/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Extends/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/File/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/File/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/FileIndexed/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/FileIndexed/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Registered/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Registered/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/ResourcePlugins/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/ResourcePlugins/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Stream/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/Stream/templates_c/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/String/cache/.gitignore delete mode 100644 tests/UnitTests/ResourceTests/String/templates_c/.gitignore delete mode 100644 tests/UnitTests/SecurityTests/cache/.gitignore delete mode 100644 tests/UnitTests/SecurityTests/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/Append/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/Append/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/Assign/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/Assign/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/ClearAllAssign/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/ClearAllAssign/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/ClearAssign/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/ClearAssign/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/CompileCheck/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/CompileCheck/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterBlock/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterBlock/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterCompiler/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterCompiler/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterFunction/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterFunction/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterModifier/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterModifier/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterObject/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/RegisterObject/templates_c/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/TemplateExist/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/TemplateExist/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/Comments/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/Comments/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/Spacing/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/Spacing/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/Spacing/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/StaticClass/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/StaticClass/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Append/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Append/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Append/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Assign/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Assign/templates/test_scope_assignbar.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Assign/templates/test_scope_assignnocache.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Assign/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Assign/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BlockPlugin/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_c/mustcompile/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Capture/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Capture/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Capture/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/ConfigLoad/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/ConfigLoad/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Delimiter/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Delimiter/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Eval/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Eval/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/For/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/For/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/For/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Foreach/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Foreach/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Foreach/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates/functionplugintestnocache.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/If/cache/.gitignore create mode 100644 tests/UnitTests/TemplateSource/TagTests/If/templates/run_code.tpl create mode 100644 tests/UnitTests/TemplateSource/TagTests/If/templates/run_code_caching.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/If/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/If/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Include/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope_assign.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope_pluginassign.tpl delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Include/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Include/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Literal/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Literal/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Nocache/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Nocache/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/PluginBlock/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/PluginBlock/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/PluginFunction/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/PluginFunction/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/PluginModifier/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/PluginModifier/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Section/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Section/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Section/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/SetFilter/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/SetFilter/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Strip/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/Strip/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/While/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/While/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/While/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/_Attributes/cache/.gitignore create mode 100644 tests/UnitTests/TemplateSource/TagTests/_Attributes/plugins/function.getparams.php delete mode 100644 tests/UnitTests/TemplateSource/TagTests/_Attributes/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/_Error/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/_Error/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/_Print/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/_Print/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/_Print/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/break/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/TagTests/break/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Array/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Array/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Array/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/ConstantTests/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/ConstantTests/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Math/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Math/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Modifier/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Modifier/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Modifier/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Objects/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Objects/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Operators/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SingleQouted/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SingleQouted/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/X_Scopes/cache/.gitignore create mode 100644 tests/UnitTests/TemplateSource/X_Scopes/plugins/function.checkconfigvar.php create mode 100644 tests/UnitTests/TemplateSource/X_Scopes/plugins/function.checkvar.php create mode 100644 tests/UnitTests/TemplateSource/X_Scopes/plugins/function.pluginassign.php create mode 100644 tests/UnitTests/TemplateSource/X_Scopes/templates/scope_include.tpl create mode 100644 tests/UnitTests/TemplateSource/X_Scopes/templates/scope_tag.tpl delete mode 100644 tests/UnitTests/TemplateSource/X_Scopes/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/X_Scopes/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/Xml/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/Xml/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/327/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/327/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/419/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/419/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/422/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/422/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/428/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/428/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/549/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/549/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/topic26878/cache/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/topic26878/templates_c/.gitignore delete mode 100644 tests/UnitTests/TemplateSource/_Issues/topic26878/templates_tmp/.gitignore delete mode 100644 tests/UnitTests/__shared/PHPunitplugins/block.dummyblock.php delete mode 100644 tests/UnitTests/__shared/PHPunitplugins/compiler.getparamsshort.php delete mode 100644 tests/UnitTests/__shared/PHPunitplugins/function.checkconfigvar.php delete mode 100644 tests/UnitTests/__shared/PHPunitplugins/function.checkvar.php delete mode 100644 tests/UnitTests/__shared/PHPunitplugins/function.getparams.php delete mode 100644 tests/UnitTests/__shared/PHPunitplugins/function.getvar.php delete mode 100644 tests/UnitTests/__shared/PHPunitplugins/function.pluginassign.php delete mode 100644 tests/UnitTests/__shared/cacheresources/cacheresource.memcache.php delete mode 100644 tests/UnitTests/__shared/cacheresources/cacheresource.mysql.php delete mode 100644 tests/UnitTests/__shared/cacheresources/cacheresource.pdo.php delete mode 100644 tests/UnitTests/__shared/cacheresources/cacheresource.pdo_gzip.php delete mode 100644 tests/UnitTests/__shared/resources/resource.extendsall.php delete mode 100644 tests/UnitTests/__shared/templates/run_code.tpl delete mode 100644 tests/UnitTests/__shared/templates/run_code_caching.tpl delete mode 100644 tests/UnitTests/__shared/templates/scope_include.tpl delete mode 100644 tests/UnitTests/__shared/templates/scope_tag.tpl delete mode 100644 tests/cache/.gitignore delete mode 100644 tests/templates_c/.gitignore diff --git a/.gitignore b/.gitignore index d0d6b422..5f3c98a9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ phpunit* .phpunit.result.cache vendor/* composer.lock + + diff --git a/changelog/1179.md b/changelog/1179.md new file mode 100644 index 00000000..ed13b417 --- /dev/null +++ b/changelog/1179.md @@ -0,0 +1 @@ +- Moved all unit test-generated output from inside the working tree to tmp files [#1178](https://github.com/smarty-php/smarty/issues/1178) \ No newline at end of file diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 51704c3b..5a941d10 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -15,4 +15,3 @@ if (!ini_get('date.timezone')) { } - diff --git a/tests/Config.php b/tests/Config.php index e2d66127..116c6832 100644 --- a/tests/Config.php +++ b/tests/Config.php @@ -6,7 +6,6 @@ /* * Smarty PHPUnit Config */ -define('individualFolders', true); define('MysqlCacheEnable', false); define('PdoCacheEnable', false); define('PdoGzipCacheEnable', false); diff --git a/tests/PHPUnit_Smarty.php b/tests/PHPUnit_Smarty.php index 39663c1f..90ace63e 100644 --- a/tests/PHPUnit_Smarty.php +++ b/tests/PHPUnit_Smarty.php @@ -49,6 +49,37 @@ class PHPUnit_Smarty extends PHPUnit\Framework\TestCase */ public static $cwd = null; + /** + * Temp directory base for this test class (compile, cache, templates_tmp) + * + * @var string|null + */ + private static $tempBase = null; + + /** + * Unique token for the current test class's temp directory. + * Generated once per class. + * + * @var string|null + */ + private static $tempId = null; + + /** + * Return the temp directory base for the current test class. + * + * @return string + * @throws \LogicException If the temp directory base has not been initialized yet. + */ + public static function getTempBase(): string + { + if (self::$tempBase === null) { + throw new \LogicException( + 'Temp directory base has not been initialized. Call setUpSmarty() before using temp-path helpers.' + ); + } + return self::$tempBase; + } + /** * PDO object for Mysql tests * @@ -75,8 +106,37 @@ class PHPUnit_Smarty extends PHPUnit\Framework\TestCase */ public static function tearDownAfterClass(): void { - //self::$pdo = null; - self::$testNumber = 0; + // Remove the unique temp directory for this test class unless the caller + // wants to inspect the artifacts (e.g. for debugging a failure). + if (!getenv('KEEP_SMARTY_TEST_ARTIFACTS') && self::$tempBase !== null && is_dir(self::$tempBase)) { + self::removeDir(self::$tempBase); + } + } + + /** + * Recursively remove a directory, silently ignoring any errors. + * + * @param string $dir + */ + private static function removeDir(string $dir): void + { + $dir = rtrim($dir, DIRECTORY_SEPARATOR); + $items = @scandir($dir); + if ($items === false) { + return; + } + foreach ($items as $item) { + if ($item === '.' || $item === '..') { + continue; + } + $path = $dir . DIRECTORY_SEPARATOR . $item; + if (is_dir($path) && !is_link($path)) { + self::removeDir($path); + } else { + @unlink($path); + } + } + @rmdir($dir); } /** @@ -89,12 +149,46 @@ class PHPUnit_Smarty extends PHPUnit\Framework\TestCase public function __construct($name = null, array $data = array(), $dataName = '') { date_default_timezone_set('Europe/Berlin'); - if (!defined('individualFolders')) { - define('individualFolders', true); - } parent::__construct($name, $data, $dataName); } + /** + * Compute the temp directory base for a given test directory. + * + * Returns a path unique to this test class run under sys_get_temp_dir(), + * so that concurrent or sequential runs of different test classes never + * share compiled/cached output. The unique token is generated once per + * class lifetime and reset in tearDownAfterClass(). + * + * Example: + * /path/to/smarty/tests/UnitTests/TagTests/If + * → /tmp/smarty-tests/UnitTests/TagTests/If// + * + * @param string $dir absolute test directory + * @return string absolute temp base directory (with trailing separator) + */ + private static function getTempDir($dir) + { + // Lazily generate a unique token for this test class. + if (self::$tempId === null) { + self::$tempId = uniqid('', true); + } + $testsRoot = realpath(__DIR__); + $realDir = realpath($dir) ?: $dir; + // compute relative path from tests/ root + if (strpos($realDir, $testsRoot) === 0) { + $relative = substr($realDir, strlen($testsRoot)); + } else { + // fallback: use full path hash + $relative = DIRECTORY_SEPARATOR . md5($realDir); + } + return rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) + . DIRECTORY_SEPARATOR . 'smarty-tests' + . $relative + . DIRECTORY_SEPARATOR . self::$tempId + . DIRECTORY_SEPARATOR; + } + /** * Setup Smarty instance called for each test * @@ -102,47 +196,37 @@ class PHPUnit_Smarty extends PHPUnit\Framework\TestCase */ public function setUpSmarty($dir) { - static $s_dir; // set up current working directory chdir($dir); self::$cwd = getcwd(); + // compute temp base for this test directory + self::$tempBase = self::getTempDir($dir); // create missing folders for test if (self::$init) { - if (!is_dir($dir . '/templates')) { - mkdir($dir . '/templates'); - } - if (!is_dir($dir . '/configs')) { - mkdir($dir . '/configs'); - } - if (individualFolders != 'true') { - if (!isset($s_dir[ $dir ])) { - $this->cleanDir($dir . '/templates_c'); - $this->cleanDir($dir . '/cache'); - if (is_dir($dir . '/templates_tmp')) { - $this->cleanDir($dir . '/templates_tmp'); - } - $s_dir[ $dir ] = true; - } - $dir = __DIR__; - } - if (!is_dir($dir . '/templates_c')) { - mkdir($dir . '/templates_c'); + if (!is_dir(self::$tempBase . 'templates_c')) { + mkdir(self::$tempBase . 'templates_c', 0775, true); } - chmod($dir . '/templates_c', 0775); - if (!is_dir($dir . '/cache')) { - mkdir($dir . '/cache'); - chmod($dir . '/cache', 0775); + if (!is_dir(self::$tempBase . 'cache')) { + mkdir(self::$tempBase . 'cache', 0775, true); } + if (!is_dir(self::$tempBase . 'templates_tmp')) { + mkdir(self::$tempBase . 'templates_tmp', 0775, true); + } self::$init = false; } clearstatcache(); // instance Smarty class $this->smarty = new \Smarty\Smarty(); - if (individualFolders != 'true') { - $this->smarty->setCompileDir(__DIR__ . '/templates_c'); - $this->smarty->setCacheDir(__DIR__ . '/cache'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache'); + $this->smarty->addTemplateDir(self::getTempBase() . 'templates_tmp'); + + // Clean output dirs once at the start of each test class run + if (self::$testNumber === 0) { + $this->cleanDirs(); } + self::$testNumber++; } @@ -230,24 +314,24 @@ KEY `name` (`name`) { $this->cleanCompileDir(); $this->cleanCacheDir(); - if (is_dir(self::$cwd . '/templates_tmp')) { - $this->cleanDir(self::$cwd . '/templates_tmp'); + $templatesTmpDir = self::getTempBase() . 'templates_tmp'; + if (is_dir($templatesTmpDir)) { + $this->cleanDir($templatesTmpDir); } - $this->assertTrue(true); - } + } /** * Make temporary template file * */ - public function makeTemplateFile($name, $code) + protected function makeTemplateFile($name, $code) { - if (!is_dir(self::$cwd . '/templates_tmp')) { - mkdir(self::$cwd . '/templates_tmp'); - chmod(self::$cwd . '/templates_tmp', 0775); - } - $fileName = self::$cwd . '/templates_tmp/' . "{$name}"; - file_put_contents($fileName, $code); + file_put_contents(self::getTempBase() . 'templates_tmp' . '/' . $name, $code); + } + + protected function removeTemplateFile($name) + { + unlink(self::getTempBase() . 'templates_tmp' . '/' . $name); } /** diff --git a/tests/UnitTests/A_0/PathNormalization/TemlateDirNormalizationTest.php b/tests/UnitTests/A_0/PathNormalization/TemlateDirNormalizationTest.php index f13eb2ff..b1681a48 100644 --- a/tests/UnitTests/A_0/PathNormalization/TemlateDirNormalizationTest.php +++ b/tests/UnitTests/A_0/PathNormalization/TemlateDirNormalizationTest.php @@ -18,6 +18,7 @@ class TemplateNormalizationTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); + $this->smarty->setTemplateDir(__DIR__ . '/templates'); } public function testGetTemplateDir() diff --git a/tests/UnitTests/A_0/PathNormalization/cache/.gitignore b/tests/UnitTests/A_0/PathNormalization/cache/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_0/PathNormalization/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_0/PathNormalization/templates_c/.gitignore b/tests/UnitTests/A_0/PathNormalization/templates_c/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_0/PathNormalization/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_1/ProtectedFolderVars/cache/.gitignore b/tests/UnitTests/A_1/ProtectedFolderVars/cache/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_1/ProtectedFolderVars/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php index e5c6446d..1ac04773 100644 --- a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php +++ b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php @@ -18,10 +18,6 @@ class UndefinedTemplateVarTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test Error suppression template fetched by Smarty object */ diff --git a/tests/UnitTests/A_2/UndefinedTemplateVar/cache/.gitignore b/tests/UnitTests/A_2/UndefinedTemplateVar/cache/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_2/UndefinedTemplateVar/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_2/UndefinedTemplateVar/templates_c/.gitignore b/tests/UnitTests/A_2/UndefinedTemplateVar/templates_c/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_2/UndefinedTemplateVar/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_Core/AutoEscape/cache/.gitignore b/tests/UnitTests/A_Core/AutoEscape/cache/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_Core/AutoEscape/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_Core/AutoEscape/templates_c/.gitignore b/tests/UnitTests/A_Core/AutoEscape/templates_c/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_Core/AutoEscape/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_Core/Filter/FilterTest.php b/tests/UnitTests/A_Core/Filter/FilterTest.php index ad005518..cf8f6712 100644 --- a/tests/UnitTests/A_Core/Filter/FilterTest.php +++ b/tests/UnitTests/A_Core/Filter/FilterTest.php @@ -21,10 +21,6 @@ class FilterTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test loaded filter diff --git a/tests/UnitTests/A_Core/Filter/cache/.gitignore b/tests/UnitTests/A_Core/Filter/cache/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_Core/Filter/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_Core/Filter/templates_c/.gitignore b/tests/UnitTests/A_Core/Filter/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/A_Core/Filter/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/A_Core/GetterSetter/GetterSetterTest.php b/tests/UnitTests/A_Core/GetterSetter/GetterSetterTest.php index 43d622b8..312ae1b8 100644 --- a/tests/UnitTests/A_Core/GetterSetter/GetterSetterTest.php +++ b/tests/UnitTests/A_Core/GetterSetter/GetterSetterTest.php @@ -20,10 +20,6 @@ class GetterSetterTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test setter on Smarty object diff --git a/tests/UnitTests/A_Core/GetterSetter/cache/.gitignore b/tests/UnitTests/A_Core/GetterSetter/cache/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_Core/GetterSetter/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_Core/GetterSetter/templates_c/.gitignore b/tests/UnitTests/A_Core/GetterSetter/templates_c/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_Core/GetterSetter/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_Core/LoadPlugin/DefaultPluginHandlerTest.php b/tests/UnitTests/A_Core/LoadPlugin/DefaultPluginHandlerTest.php index 218cfab8..e04c5a21 100644 --- a/tests/UnitTests/A_Core/LoadPlugin/DefaultPluginHandlerTest.php +++ b/tests/UnitTests/A_Core/LoadPlugin/DefaultPluginHandlerTest.php @@ -24,10 +24,6 @@ class DefaultPluginHandlerTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } public function testDefaultFunctionScript() { $this->assertEquals("scriptfunction foo bar", $this->smarty->fetch('test_default_function_script.tpl')); diff --git a/tests/UnitTests/A_Core/LoadPlugin/cache/.gitignore b/tests/UnitTests/A_Core/LoadPlugin/cache/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_Core/LoadPlugin/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/A_Core/LoadPlugin/templates_c/.gitignore b/tests/UnitTests/A_Core/LoadPlugin/templates_c/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/UnitTests/A_Core/LoadPlugin/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php b/tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php index 5ce70c11..5aedfdea 100644 --- a/tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php +++ b/tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php @@ -21,10 +21,6 @@ class HttpModifiedSinceTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * diff --git a/tests/UnitTests/CacheModify/ModifiedSince/cache/.gitignore b/tests/UnitTests/CacheModify/ModifiedSince/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/CacheModify/ModifiedSince/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/CacheModify/ModifiedSince/templates_c/.gitignore b/tests/UnitTests/CacheModify/ModifiedSince/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/CacheModify/ModifiedSince/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/CacheResourceTests/File/CacheResourceFileTest.php b/tests/UnitTests/CacheResourceTests/File/CacheResourceFileTest.php index 9161e3d0..86411e7d 100644 --- a/tests/UnitTests/CacheResourceTests/File/CacheResourceFileTest.php +++ b/tests/UnitTests/CacheResourceTests/File/CacheResourceFileTest.php @@ -25,11 +25,6 @@ class CacheResourceFileTest extends CacheResourceTestCommon } - public function testInit() - - { - $this->cleanDirs(); - } /** * test getCachedFilepath with configuration['useSubDirs'] enabled diff --git a/tests/UnitTests/CacheResourceTests/File/cache/.gitignore b/tests/UnitTests/CacheResourceTests/File/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/CacheResourceTests/File/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/CacheResourceTests/File/templates_c/.gitignore b/tests/UnitTests/CacheResourceTests/File/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/CacheResourceTests/File/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php b/tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php index 865f427d..5d9f92a0 100644 --- a/tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php +++ b/tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php @@ -32,10 +32,6 @@ class CacheResourceCustomMemcacheTest extends CacheResourceTestCommon $this->smarty->setCachingType('memcachetest'); } - public function testInit() - { - $this->cleanDirs(); - } protected function doClearCacheAssertion($a, $b) { diff --git a/tests/UnitTests/CacheResourceTests/Memcache/templates_c/.gitignore b/tests/UnitTests/CacheResourceTests/Memcache/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/CacheResourceTests/Memcache/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/CacheResourceTests/Mysql/CacheResourceCustomMysqlTest.php b/tests/UnitTests/CacheResourceTests/Mysql/CacheResourceCustomMysqlTest.php index c00a0282..0d1f5819 100644 --- a/tests/UnitTests/CacheResourceTests/Mysql/CacheResourceCustomMysqlTest.php +++ b/tests/UnitTests/CacheResourceTests/Mysql/CacheResourceCustomMysqlTest.php @@ -29,15 +29,11 @@ if (MysqlCacheEnable == true) { $this->getConnection(); } $this->setUpSmarty(__DIR__); + $this->initMysqlCache(); parent::setUp(); $this->smarty->setCachingType('mysqltest'); } - public function testInit() - { - $this->cleanDirs(); - $this->initMysqlCache(); - } } } diff --git a/tests/UnitTests/CacheResourceTests/Mysql/cache/.gitignore b/tests/UnitTests/CacheResourceTests/Mysql/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/CacheResourceTests/Mysql/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/CacheResourceTests/Mysql/templates_c/.gitignore b/tests/UnitTests/CacheResourceTests/Mysql/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/CacheResourceTests/Mysql/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/CacheResourceTests/PDO/CacheResourceCustomPDOTest.php b/tests/UnitTests/CacheResourceTests/PDO/CacheResourceCustomPDOTest.php index 2a372450..9a76afb1 100644 --- a/tests/UnitTests/CacheResourceTests/PDO/CacheResourceCustomPDOTest.php +++ b/tests/UnitTests/CacheResourceTests/PDO/CacheResourceCustomPDOTest.php @@ -28,15 +28,11 @@ class CacheResourceCustomPDOTest extends CacheResourceTestCommon $this->getConnection(); } $this->setUpSmarty(__DIR__); + $this->initMysqlCache(); parent::setUp(); $this->smarty->registerCacheResource('pdo', new Smarty_CacheResource_Pdotest($this->getPDO(), 'output_cache')); } - public function testInit() - { - $this->cleanDirs(); - $this->initMysqlCache(); - } } diff --git a/tests/UnitTests/CacheResourceTests/PDO/cacheresource.pdotest.php b/tests/UnitTests/CacheResourceTests/PDO/cacheresource.pdotest.php index 53ae840a..19feac79 100644 --- a/tests/UnitTests/CacheResourceTests/PDO/cacheresource.pdotest.php +++ b/tests/UnitTests/CacheResourceTests/PDO/cacheresource.pdotest.php @@ -2,7 +2,7 @@ use Smarty\Template\Cached; -require_once __DIR__ . '/../../__shared/cacheresources/cacheresource.pdo.php'; +require_once __DIR__ . '/../_shared/cacheresources/cacheresource.pdo.php'; class Smarty_CacheResource_Pdotest extends Smarty_CacheResource_Pdo { diff --git a/tests/UnitTests/CacheResourceTests/PDOgzip/CacheResourceCustomPDOGzipTest.php b/tests/UnitTests/CacheResourceTests/PDOgzip/CacheResourceCustomPDOGzipTest.php index bcd89b8d..d0bd2d66 100644 --- a/tests/UnitTests/CacheResourceTests/PDOgzip/CacheResourceCustomPDOGzipTest.php +++ b/tests/UnitTests/CacheResourceTests/PDOgzip/CacheResourceCustomPDOGzipTest.php @@ -27,16 +27,12 @@ class CacheResourceCustomPDOGzipTest extends CacheResourceTestCommon $this->getConnection(); } $this->setUpSmarty(__DIR__); + $this->initMysqlCache(); parent::setUp(); $this->smarty->setCachingType('pdo'); $this->smarty->registerCacheResource('pdo', new Smarty_CacheResource_Pdo_Gziptest($this->getPDO(), 'output_cache')); } - public function testInit() - { - $this->cleanDirs(); - $this->initMysqlCache(); - } } diff --git a/tests/UnitTests/CacheResourceTests/PDOgzip/cacheresource.pdo_gziptest.php b/tests/UnitTests/CacheResourceTests/PDOgzip/cacheresource.pdo_gziptest.php index 75745d60..68ba4504 100644 --- a/tests/UnitTests/CacheResourceTests/PDOgzip/cacheresource.pdo_gziptest.php +++ b/tests/UnitTests/CacheResourceTests/PDOgzip/cacheresource.pdo_gziptest.php @@ -2,7 +2,7 @@ use Smarty\Template\Cached; -require_once __DIR__ . '/../../__shared/cacheresources/cacheresource.pdo_gzip.php'; +require_once __DIR__ . '/../_shared/cacheresources/cacheresource.pdo_gzip.php'; class Smarty_CacheResource_Pdo_Gziptest extends Smarty_CacheResource_Pdo_Gzip { diff --git a/tests/UnitTests/CacheResourceTests/Registered/CacheResourceCustomRegisteredTest.php b/tests/UnitTests/CacheResourceTests/Registered/CacheResourceCustomRegisteredTest.php index 03acf270..a30f5126 100644 --- a/tests/UnitTests/CacheResourceTests/Registered/CacheResourceCustomRegisteredTest.php +++ b/tests/UnitTests/CacheResourceTests/Registered/CacheResourceCustomRegisteredTest.php @@ -26,6 +26,7 @@ if (MysqlCacheEnable == true) { $this->getConnection(); } $this->setUpSmarty(__DIR__); + $this->initMysqlCache(); parent::setUp(); if (!class_exists('Smarty_CacheResource_Mysqltest', false)) { require_once(__DIR__ . "/../_shared/PHPunitplugins/cacheresource.mysqltest.php"); @@ -34,11 +35,6 @@ if (MysqlCacheEnable == true) { $this->smarty->registerCacheResource('foobar', new Smarty_CacheResource_Mysqltest()); } - public function testInit() - { - $this->cleanDirs(); - $this->initMysqlCache(); - } } } diff --git a/tests/UnitTests/CacheResourceTests/Registered/templates_c/.gitignore b/tests/UnitTests/CacheResourceTests/Registered/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/CacheResourceTests/Registered/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.memcachetest.php b/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.memcachetest.php index 77f9d5f9..c5a2cdee 100644 --- a/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.memcachetest.php +++ b/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.memcachetest.php @@ -3,7 +3,7 @@ use Smarty\Template; use Smarty\Template\Cached; -require_once __DIR__ . '/../../../__shared/cacheresources/cacheresource.memcache.php'; +require_once __DIR__ . '/../cacheresources/cacheresource.memcache.php'; class Smarty_CacheResource_Memcachetest extends Smarty_CacheResource_Memcache { diff --git a/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.mysqltest.php b/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.mysqltest.php index 5bc53bd1..7301bb33 100644 --- a/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.mysqltest.php +++ b/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/cacheresource.mysqltest.php @@ -3,7 +3,7 @@ use Smarty\Exception; use Smarty\Template\Cached; -require_once __DIR__ . '/../../../__shared/cacheresources/cacheresource.mysql.php'; +require_once __DIR__ . '/../cacheresources/cacheresource.mysql.php'; class Smarty_CacheResource_Mysqltest extends Smarty_CacheResource_Mysql { diff --git a/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.memcache.php b/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.memcache.php new file mode 100644 index 00000000..bc212a82 --- /dev/null +++ b/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.memcache.php @@ -0,0 +1,101 @@ +memcache === null) { + if (class_exists('Memcached')) { + $this->memcache = new Memcached(); + } else { + $this->memcache = new Memcache(); + } + $this->memcache->addServer('127.0.0.1', 11211); + } + return $this->memcache; + } + + /** + * Read values for a set of keys from cache + * + * @param array $keys list of keys to fetch + * + * @return array list of values with the given keys used as indexes + * @return boolean true on success, false on failure + */ + protected function read(array $keys) + { + $res = array(); + foreach ($keys as $key) { + $k = sha1($key); + $res[$key] = $this->getMemcache()->get($k); + } + return $res; + } + + /** + * Save values for a set of keys to cache + * + * @param array $keys list of values to save + * @param int $expire expiration time + * + * @return boolean true on success, false on failure + */ + protected function write(array $keys, $expire = null) + { + foreach ($keys as $k => $v) { + $k = sha1($k); + if (class_exists('Memcached')) { + $this->getMemcache()->set($k, $v, $expire); + } else { + $this->getMemcache()->set($k, $v, 0, $expire); + } + } + return true; + } + + /** + * Remove values from cache + * + * @param array $keys list of keys to delete + * + * @return boolean true on success, false on failure + */ + protected function delete(array $keys) + { + foreach ($keys as $k) { + $k = sha1($k); + $this->getMemcache()->delete($k); + } + return true; + } + + /** + * Remove *all* values from cache + * + * @return boolean true on success, false on failure + */ + protected function purge() + { + return $this->getMemcache()->flush(); + } +} diff --git a/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.mysql.php b/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.mysql.php new file mode 100644 index 00000000..9b51c272 --- /dev/null +++ b/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.mysql.php @@ -0,0 +1,190 @@ +CREATE TABLE IF NOT EXISTS `output_cache` ( + * `id` CHAR(40) NOT NULL COMMENT 'sha1 hash', + * `name` VARCHAR(250) NOT NULL, + * `cache_id` VARCHAR(250) NULL DEFAULT NULL, + * `compile_id` VARCHAR(250) NULL DEFAULT NULL, + * `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + * `content` LONGTEXT NOT NULL, + * PRIMARY KEY (`id`), + * INDEX(`name`), + * INDEX(`cache_id`), + * INDEX(`compile_id`), + * INDEX(`modified`) + * ) ENGINE = InnoDB; + * + + * @author Rodney Rehm + */ +class Smarty_CacheResource_Mysql extends \Smarty\Cacheresource\Custom +{ + + /** + * @return PDO + * @throws Exception + */ + protected function db(): PDO { + static $dbConn = null; + try { + return $dbConn ?? ($dbConn = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty")); + } catch (PDOException $e) { + throw new Exception('Mysql Resource failed: ' . $e->getMessage()); + } + } + + /** + * @return false|PDOStatement + * @throws Exception + */ + protected function fetchQuery() { + static $query = null; + return $query ?? $query = $this->db()->prepare('SELECT modified, content FROM output_cache WHERE id = :id'); + } + + /** + * @return false|PDOStatement + * @throws Exception + */ + protected function fetchTimestampQuery() { + static $query = null; + return $query ?? $query = $this->db()->prepare('SELECT modified FROM output_cache WHERE id = :id'); + } + + /** + * @return false|PDOStatement + * @throws Exception + */ + protected function saveQuery() { + static $query = null; + return $query ?? $query = $this->db()->prepare( + 'REPLACE INTO output_cache (id, name, cache_id, compile_id, content) + VALUES (:id, :name, :cache_id, :compile_id, :content)' + ); + } + + /** + * fetch cached content and its modification time from data source + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) + * + * @return void + * @throws Exception + */ + protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime) + { + $this->fetchQuery()->execute(array('id' => $id)); + $row = $this->fetchQuery()->fetch(); + $this->fetchQuery()->closeCursor(); + if ($row) { + $content = $row[ 'content' ]; + $mtime = strtotime($row[ 'modified' ]); + } else { + $content = null; + $mtime = null; + } + } + + /** + * Fetch cached content's modification timestamp from data source + * + * @note implementing this method is optional. Only implement it if modification times can be accessed faster than + * loading the complete cached content. + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * + * @return integer|boolean timestamp (epoch) the template was modified, or false if not found + */ + protected function fetchTimestamp($id, $name, $cache_id, $compile_id) + { + $this->fetchTimestampQuery()->execute(array('id' => $id)); + $mtime = strtotime($this->fetchTimestampQuery()->fetchColumn()); + $this->fetchTimestampQuery()->closeCursor(); + return $mtime; + } + + /** + * Save content to cache + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null + * @param string $content content to cache + * + * @return boolean success + */ + protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content) + { + $this->saveQuery()->execute( + array('id' => $id, + 'name' => $name, + 'cache_id' => $cache_id, + 'compile_id' => $compile_id, + 'content' => $content,) + ); + return !!$this->saveQuery()->rowCount(); + } + + /** + * Delete content from cache + * + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration or null + * + * @return integer number of deleted caches + */ + protected function delete($name, $cache_id, $compile_id, $exp_time) + { + // delete the whole cache + if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { + // returning the number of deleted caches would require a second query to count them + $query = $this->db()->query('TRUNCATE TABLE output_cache'); + return -1; + } + // build the filter + $where = array(); + // equal test name + if ($name !== null) { + $where[] = 'name = ' . $this->db()->quote($name); + } + // equal test compile_id + if ($compile_id !== null) { + $where[] = 'compile_id = ' . $this->db()->quote($compile_id); + } + // range test expiration time + if ($exp_time !== null) { + $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)'; + } + // equal test cache_id and match sub-groups + if ($cache_id !== null) { + $where[] = + '(cache_id = ' . + $this->db()->quote($cache_id) . + ' OR cache_id LIKE ' . + $this->db()->quote($cache_id . '|%') . + ')'; + } + // run delete query + $query = $this->db()->query('DELETE FROM output_cache WHERE ' . join(' AND ', $where)); + return $query->rowCount(); + } +} diff --git a/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.pdo.php b/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.pdo.php new file mode 100644 index 00000000..8be18ec9 --- /dev/null +++ b/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.pdo.php @@ -0,0 +1,347 @@ +setCachingType('pdo'); + * $smarty->registerCacheResource('pdo', new Smarty_CacheResource_Pdo($cnx, 'smarty_cache')); + * + * @author Beno!t POLASZEK - 2014 + */ +class Smarty_CacheResource_Pdo extends \Smarty\Cacheresource\Custom +{ + /** + * @var string[] + */ + protected $fetchStatements = array('default' => 'SELECT %2$s + FROM %1$s + WHERE 1 + AND id = :id + AND cache_id IS NULL + AND compile_id IS NULL', + 'withCacheId' => 'SELECT %2$s + FROM %1$s + WHERE 1 + AND id = :id + AND cache_id = :cache_id + AND compile_id IS NULL', + 'withCompileId' => 'SELECT %2$s + FROM %1$s + WHERE 1 + AND id = :id + AND compile_id = :compile_id + AND cache_id IS NULL', + 'withCacheIdAndCompileId' => 'SELECT %2$s + FROM %1$s + WHERE 1 + AND id = :id + AND cache_id = :cache_id + AND compile_id = :compile_id'); + + /** + * @var string + */ + protected $insertStatement = 'INSERT INTO %s + + SET id = :id, + name = :name, + cache_id = :cache_id, + compile_id = :compile_id, + modified = CURRENT_TIMESTAMP, + expire = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :expire SECOND), + content = :content + + ON DUPLICATE KEY UPDATE + name = :name, + cache_id = :cache_id, + compile_id = :compile_id, + modified = CURRENT_TIMESTAMP, + expire = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :expire SECOND), + content = :content'; + + /** + * @var string + */ + protected $deleteStatement = 'DELETE FROM %1$s WHERE %2$s'; + + /** + * @var string + */ + protected $truncateStatement = 'TRUNCATE TABLE %s'; + + /** + * @var string + */ + protected $fetchColumns = 'modified, content'; + + /** + * @var string + */ + protected $fetchTimestampColumns = 'modified'; + + /** + * @var \PDO + */ + protected $pdo; + + /** + * @var + */ + protected $table; + + /** + * @var null + */ + protected $database; + + /** + * Constructor + * + * @param PDO $pdo PDO : active connection + * @param string $table : table (or view) name + * @param string $database : optional - if table is located in another db + * + * @throws \Smarty\Exception + */ + public function __construct(PDO $pdo, $table, $database = null) + { + if (is_null($table)) { + throw new Exception("Table name for caching can't be null"); + } + $this->pdo = $pdo; + $this->table = $table; + $this->database = $database; + $this->fillStatementsWithTableName(); + } + + /** + * Fills the table name into the statements. + * + * @return $this Current Instance + * @access protected + */ + protected function fillStatementsWithTableName() + { + foreach ($this->fetchStatements as &$statement) { + $statement = sprintf($statement, $this->getTableName(), '%s'); + } + $this->insertStatement = sprintf($this->insertStatement, $this->getTableName()); + $this->deleteStatement = sprintf($this->deleteStatement, $this->getTableName(), '%s'); + $this->truncateStatement = sprintf($this->truncateStatement, $this->getTableName()); + return $this; + } + + /** + * Gets the fetch statement, depending on what you specify + * + * @param string $columns : the column(s) name(s) you want to retrieve from the database + * @param string $id unique cache content identifier + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * + * @access protected + * @return \PDOStatement + */ + protected function getFetchStatement($columns, $id, $cache_id = null, $compile_id = null) + { + $args = array(); + if (!is_null($cache_id) && !is_null($compile_id)) { + $query = $this->fetchStatements[ 'withCacheIdAndCompileId' ] and + $args = array('id' => $id, 'cache_id' => $cache_id, 'compile_id' => $compile_id); + } elseif (is_null($cache_id) && !is_null($compile_id)) { + $query = $this->fetchStatements[ 'withCompileId' ] and + $args = array('id' => $id, 'compile_id' => $compile_id); + } elseif (!is_null($cache_id) && is_null($compile_id)) { + $query = $this->fetchStatements[ 'withCacheId' ] and $args = array('id' => $id, 'cache_id' => $cache_id); + } else { + $query = $this->fetchStatements[ 'default' ] and $args = array('id' => $id); + } + $query = sprintf($query, $columns); + $stmt = $this->pdo->prepare($query); + foreach ($args as $key => $value) { + $stmt->bindValue($key, $value); + } + return $stmt; + } + + /** + * fetch cached content and its modification time from data source + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) + * + * @return void + * @access protected + */ + protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime) + { + $stmt = $this->getFetchStatement($this->fetchColumns, $id, $cache_id, $compile_id); + $stmt->execute(); + $row = $stmt->fetch(); + $stmt->closeCursor(); + if ($row) { + $content = $this->outputContent($row[ 'content' ]); + $mtime = strtotime($row[ 'modified' ]); + } else { + $content = null; + $mtime = null; + } + } + + /** + * Fetch cached content's modification timestamp from data source + * {@internal implementing this method is optional. + * Only implement it if modification times can be accessed faster than loading the complete cached content.}} + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * + * @return integer|boolean timestamp (epoch) the template was modified, or false if not found + * @access protected + */ + // protected function fetchTimestamp($id, $name, $cache_id = null, $compile_id = null) { + // $stmt = $this->getFetchStatement($this->fetchTimestampColumns, $id, $cache_id, $compile_id); + // $stmt -> execute(); + // $mtime = strtotime($stmt->fetchColumn()); + // $stmt -> closeCursor(); + // return $mtime; + // } + /** + * Save content to cache + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null + * @param string $content content to cache + * + * @return boolean success + * @access protected + */ + protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content) + { + $stmt = $this->pdo->prepare($this->insertStatement); + $stmt->bindValue('id', $id); + $stmt->bindValue('name', $name); + $stmt->bindValue('cache_id', $cache_id, (is_null($cache_id)) ? PDO::PARAM_NULL : PDO::PARAM_STR); + $stmt->bindValue('compile_id', $compile_id, (is_null($compile_id)) ? PDO::PARAM_NULL : PDO::PARAM_STR); + $stmt->bindValue('expire', (int)$exp_time, PDO::PARAM_INT); + $stmt->bindValue('content', $this->inputContent($content)); + $stmt->execute(); + return !!$stmt->rowCount(); + } + + /** + * Encodes the content before saving to database + * + * @param string $content + * + * @return string $content + * @access protected + */ + protected function inputContent($content) + { + return $content; + } + + /** + * Decodes the content before saving to database + * + * @param string $content + * + * @return string $content + * @access protected + */ + protected function outputContent($content) + { + return $content; + } + + /** + * Delete content from cache + * + * @param string|null $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @param integer|null|-1 $exp_time seconds till expiration or null + * + * @return integer number of deleted caches + * @access protected + */ + protected function delete($name = null, $cache_id = null, $compile_id = null, $exp_time = null) + { + // delete the whole cache + if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { + // returning the number of deleted caches would require a second query to count them + $this->pdo->query($this->truncateStatement); + return -1; + } + // build the filter + $where = array(); + // equal test name + if ($name !== null) { + $where[] = 'name = ' . $this->pdo->quote($name); + } + // equal test cache_id and match sub-groups + if ($cache_id !== null) { + $where[] = + '(cache_id = ' . + $this->pdo->quote($cache_id) . + ' OR cache_id LIKE ' . + $this->pdo->quote($cache_id . '|%') . + ')'; + } + // equal test compile_id + if ($compile_id !== null) { + $where[] = 'compile_id = ' . $this->pdo->quote($compile_id); + } + // for clearing expired caches + if ($exp_time === \Smarty\Smarty::CLEAR_EXPIRED) { + $where[] = 'expire < CURRENT_TIMESTAMP'; + } // range test expiration time + elseif ($exp_time !== null) { + $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)'; + } + // run delete query + $query = $this->pdo->query(sprintf($this->deleteStatement, join(' AND ', $where))); + return $query->rowCount(); + } + + /** + * Gets the formatted table name + * + * @return string + * @access protected + */ + protected function getTableName() + { + return (is_null($this->database)) ? "`{$this->table}`" : "`{$this->database}`.`{$this->table}`"; + } +} diff --git a/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.pdo_gzip.php b/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.pdo_gzip.php new file mode 100644 index 00000000..89818abb --- /dev/null +++ b/tests/UnitTests/CacheResourceTests/_shared/cacheresources/cacheresource.pdo_gzip.php @@ -0,0 +1,42 @@ +setCachingType('pdo_gzip'); + * $smarty->registerCacheResource('pdo_gzip', new Smarty_CacheResource_Pdo_Gzip($cnx, 'smarty_cache')); + * + * @require Smarty_CacheResource_Pdo class + * @author Beno!t POLASZEK - 2014 + */ +class Smarty_CacheResource_Pdo_Gzip extends Smarty_CacheResource_Pdo +{ + /** + * Encodes the content before saving to database + * + * @param string $content + * + * @return string $content + * @access protected + */ + protected function inputContent($content) + { + return gzdeflate($content); + } + + /** + * Decodes the content before saving to database + * + * @param string $content + * + * @return string $content + * @access protected + */ + protected function outputContent($content) + { + return gzinflate($content); + } +} diff --git a/tests/UnitTests/Compiler/CompilerPlugin/CompileCompilerPluginTest.php b/tests/UnitTests/Compiler/CompilerPlugin/CompileCompilerPluginTest.php index ba747981..06f6862f 100644 --- a/tests/UnitTests/Compiler/CompilerPlugin/CompileCompilerPluginTest.php +++ b/tests/UnitTests/Compiler/CompilerPlugin/CompileCompilerPluginTest.php @@ -20,10 +20,6 @@ class CompileCompilerPluginTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test compiler plugin tag in template file diff --git a/tests/UnitTests/Compiler/CompilerPlugin/cache/.gitignore b/tests/UnitTests/Compiler/CompilerPlugin/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/Compiler/CompilerPlugin/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/Compiler/CompilerPlugin/templates_c/.gitignore b/tests/UnitTests/Compiler/CompilerPlugin/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/Compiler/CompilerPlugin/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php b/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php index 40d21653..65cd5cc7 100644 --- a/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php +++ b/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php @@ -17,13 +17,9 @@ class AutoliteralTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../__shared/PHPunitplugins/"); + $this->smarty->addPluginsDir("./plugins/"); } - public function testInit() - { - $this->cleanDirs(); - } /** * test '{ ' delimiter diff --git a/tests/UnitTests/Compiler/Delimiter/DelimiterTest.php b/tests/UnitTests/Compiler/Delimiter/DelimiterTest.php index 4092d9fb..d3d489ee 100644 --- a/tests/UnitTests/Compiler/Delimiter/DelimiterTest.php +++ b/tests/UnitTests/Compiler/Delimiter/DelimiterTest.php @@ -20,10 +20,6 @@ class DelimiterTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test <{ }> delimiter diff --git a/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php b/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php index 33a17eea..23e0ed0c 100644 --- a/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php +++ b/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php @@ -24,10 +24,6 @@ class UserliteralTest extends PHPUnit_Smarty } } - public function testInit() - { - $this->cleanDirs(); - } public function testUserLiteral() { diff --git a/tests/UnitTests/Compiler/Delimiter/cache/.gitignore b/tests/UnitTests/Compiler/Delimiter/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/Compiler/Delimiter/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/Compiler/Delimiter/plugins/block.dummyblock.php b/tests/UnitTests/Compiler/Delimiter/plugins/block.dummyblock.php new file mode 100644 index 00000000..b20ca8ec --- /dev/null +++ b/tests/UnitTests/Compiler/Delimiter/plugins/block.dummyblock.php @@ -0,0 +1,23 @@ +cleanDirs(); - } /** * test number config variable diff --git a/tests/UnitTests/ConfigFileTests/file/templates_c/.gitignore b/tests/UnitTests/ConfigFileTests/file/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ConfigFileTests/file/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Custom/Ambiguous/CustomResourceAmbiguousTest.php b/tests/UnitTests/ResourceTests/Custom/Ambiguous/CustomResourceAmbiguousTest.php index 610d8de3..d5413031 100644 --- a/tests/UnitTests/ResourceTests/Custom/Ambiguous/CustomResourceAmbiguousTest.php +++ b/tests/UnitTests/ResourceTests/Custom/Ambiguous/CustomResourceAmbiguousTest.php @@ -25,10 +25,6 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty // Smarty::$_resource_cache = array(); } - public function testInit() - { - $this->cleanDirs(); - } protected function relative($path) { diff --git a/tests/UnitTests/ResourceTests/Custom/Ambiguous/cache/.gitignore b/tests/UnitTests/ResourceTests/Custom/Ambiguous/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Custom/Ambiguous/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Custom/Ambiguous/templates_c/.gitignore b/tests/UnitTests/ResourceTests/Custom/Ambiguous/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Custom/Ambiguous/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/ResourceExtendsAllPluginTest.php b/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/ResourceExtendsAllPluginTest.php index 0cbbfce0..2d586922 100644 --- a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/ResourceExtendsAllPluginTest.php +++ b/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/ResourceExtendsAllPluginTest.php @@ -6,7 +6,7 @@ * @author Uwe Tews */ -require_once __DIR__ . '/../../../__shared/resources/resource.extendsall.php'; +require_once __DIR__ . '/resources/resource.extendsall.php'; /** * class for demo resource plugin extendsall tests @@ -22,10 +22,6 @@ class ResourceExtendsAllPluginTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test extendsall diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/cache/.gitignore b/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/resources/resource.extendsall.php b/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/resources/resource.extendsall.php new file mode 100644 index 00000000..14d37908 --- /dev/null +++ b/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/resources/resource.extendsall.php @@ -0,0 +1,66 @@ +getSmarty()->getTemplateDir() as $key => $directory) { + try { + $s = \Smarty\Template\Source::load(null, $source->getSmarty(), + 'file:' . '[' . $key . ']' . $source->name); + if (!$s->exists) { + continue; + } + $sources[ $s->uid ] = $s; + $uid .= $s->uid; + $timestamp = $s->timestamp > $timestamp ? $s->timestamp : $timestamp; + } catch (Exception $e) { + } + } + if (!$sources) { + $source->exists = false; + return; + } + $sources = array_reverse($sources, true); + reset($sources); + $s = current($sources); + $source->components = $sources; + $source->uid = sha1($uid . $source->getSmarty()->_joined_template_dir); + $source->exists = true; + $source->timestamp = $timestamp; + } + + /** + * Disable timestamp checks for extendsall resource. + * The individual source components will be checked. + * + * @return bool false + */ + public function checkTimestamps() + { + return false; + } +} diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/templates_c/.gitignore b/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/ResourceMysqlPluginTest.php b/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/ResourceMysqlPluginTest.php index 16d85489..2c98fae4 100644 --- a/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/ResourceMysqlPluginTest.php +++ b/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/ResourceMysqlPluginTest.php @@ -24,17 +24,9 @@ if (MysqlResourceEnable == true) { $this->getConnection(); } $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("./PHPunitplugins/"); - } - - /** - * - */ - public function testInit() - { - $this->cleanDirs(); $this->initMysqlResource(); PHPUnit_Smarty::$pdo->exec("REPLACE INTO templates (name, source) VALUES ('test.tpl', '{\$x = \'hello world\'}{\$x}')"); + $this->smarty->addPluginsDir("./PHPunitplugins/"); } /** diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/cache/.gitignore b/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/templates_c/.gitignore b/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/DefaultHandler/DefaultTemplateHandlerTest.php b/tests/UnitTests/ResourceTests/DefaultHandler/DefaultTemplateHandlerTest.php index f2073507..ecd7d81b 100644 --- a/tests/UnitTests/ResourceTests/DefaultHandler/DefaultTemplateHandlerTest.php +++ b/tests/UnitTests/ResourceTests/DefaultHandler/DefaultTemplateHandlerTest.php @@ -23,10 +23,6 @@ class DefaultTemplateHandlerTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test error on unknow template */ diff --git a/tests/UnitTests/ResourceTests/DefaultHandler/cache/.gitignore b/tests/UnitTests/ResourceTests/DefaultHandler/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/DefaultHandler/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/DefaultHandler/templates_c/.gitignore b/tests/UnitTests/ResourceTests/DefaultHandler/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/DefaultHandler/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php b/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php index f4bad162..faea5d2d 100644 --- a/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php +++ b/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php @@ -21,10 +21,6 @@ class EvalResourceTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test template eval exits */ diff --git a/tests/UnitTests/ResourceTests/Eval/cache/.gitignore b/tests/UnitTests/ResourceTests/Eval/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Eval/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Eval/templates_c/.gitignore b/tests/UnitTests/ResourceTests/Eval/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Eval/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php b/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php index 2ef17719..26edeac7 100644 --- a/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php +++ b/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php @@ -20,10 +20,6 @@ class ExtendsResourceTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } public function compiledPrefilter($text, Template $tpl) { diff --git a/tests/UnitTests/ResourceTests/Extends/cache/.gitignore b/tests/UnitTests/ResourceTests/Extends/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Extends/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Extends/templates_c/.gitignore b/tests/UnitTests/ResourceTests/Extends/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Extends/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/File/FileResourceTest.php b/tests/UnitTests/ResourceTests/File/FileResourceTest.php index 44201d4b..acf522d2 100644 --- a/tests/UnitTests/ResourceTests/File/FileResourceTest.php +++ b/tests/UnitTests/ResourceTests/File/FileResourceTest.php @@ -23,10 +23,6 @@ class FileResourceTest extends PHPUnit_Smarty $this->smarty->enableSecurity(); } - public function testInit() - { - $this->cleanDirs(); - } protected function relative($path) { @@ -171,8 +167,7 @@ class FileResourceTest extends PHPUnit_Smarty $tpl->fetch(); $timestamp = $tpl->getCached()->timestamp; - - $this->smarty = new \Smarty\Smarty(); + $this->setUpSmarty(__DIR__); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; @@ -271,8 +266,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); chdir(__DIR__ . '/templates/sub/'); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array( __DIR__ . '/does-not-exist/', )); @@ -292,8 +287,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); chdir(__DIR__ . '/templates/sub/'); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array( __DIR__ . '/does-not-exist/', )); @@ -348,8 +343,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array($dn . '/templates/relativity/theory/',)); $map = array('foo.tpl' => 'theory', './foo.tpl' => 'theory', '././foo.tpl' => 'theory', @@ -367,8 +362,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array( @@ -399,8 +394,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); chdir($dn . '/templates/relativity/theory/'); $this->smarty->setTemplateDir(array( $dn . '/templates/', @@ -428,8 +423,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array($dn . '/templates/relativity/theory/einstein/',)); $map = array('foo.tpl' => 'einstein', './foo.tpl' => 'einstein', '././foo.tpl' => 'einstein', @@ -448,8 +443,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array( $dn . '/templates/relativity/theory/einstein/', )); @@ -479,8 +474,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array('../..',)); $map = array('foo.tpl' => 'relativity', './foo.tpl' => 'relativity', '././foo.tpl' => 'relativity',); @@ -497,8 +492,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array('../..',)); $map = @@ -516,8 +511,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array( '../..', )); @@ -549,8 +544,8 @@ class FileResourceTest extends PHPUnit_Smarty $cwd = getcwd(); $dn = __DIR__; - $this->smarty->setCompileDir($dn . '/templates_c/'); - $this->smarty->setCacheDir($dn . '/cache/'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/'); + $this->smarty->setCacheDir(self::getTempBase() . 'cache/'); $this->smarty->setTemplateDir(array( '..', )); diff --git a/tests/UnitTests/ResourceTests/File/cache/.gitignore b/tests/UnitTests/ResourceTests/File/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/File/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/File/templates_c/.gitignore b/tests/UnitTests/ResourceTests/File/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/File/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/FileIndexed/FileResourceIndexedTest.php b/tests/UnitTests/ResourceTests/FileIndexed/FileResourceIndexedTest.php index 4bba6a27..45205fed 100644 --- a/tests/UnitTests/ResourceTests/FileIndexed/FileResourceIndexedTest.php +++ b/tests/UnitTests/ResourceTests/FileIndexed/FileResourceIndexedTest.php @@ -14,16 +14,13 @@ class FileResourceIndexedTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); + $this->smarty->setTemplateDir(__DIR__ . '/templates'); $this->smarty->addTemplateDir(__DIR__ . '/templates_2'); // note that 10 is a string! $this->smarty->addTemplateDir(__DIR__ . '/templates_3', '10'); $this->smarty->addTemplateDir(__DIR__ . '/templates_4', 'foo'); } - public function testInit() - { - $this->cleanDirs(); - } public function testFetch() { diff --git a/tests/UnitTests/ResourceTests/FileIndexed/cache/.gitignore b/tests/UnitTests/ResourceTests/FileIndexed/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/FileIndexed/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/FileIndexed/templates_c/.gitignore b/tests/UnitTests/ResourceTests/FileIndexed/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/FileIndexed/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Registered/RegisteredResourceTest.php b/tests/UnitTests/ResourceTests/Registered/RegisteredResourceTest.php index 407aa461..20300ccf 100644 --- a/tests/UnitTests/ResourceTests/Registered/RegisteredResourceTest.php +++ b/tests/UnitTests/ResourceTests/Registered/RegisteredResourceTest.php @@ -26,10 +26,6 @@ class RegisteredResourceTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test resource plugin rendering */ diff --git a/tests/UnitTests/ResourceTests/Registered/cache/.gitignore b/tests/UnitTests/ResourceTests/Registered/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Registered/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Registered/templates_c/.gitignore b/tests/UnitTests/ResourceTests/Registered/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Registered/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/ResourcePlugins/ResourcePluginTest.php b/tests/UnitTests/ResourceTests/ResourcePlugins/ResourcePluginTest.php index 5b1b3854..3a67ef21 100644 --- a/tests/UnitTests/ResourceTests/ResourcePlugins/ResourcePluginTest.php +++ b/tests/UnitTests/ResourceTests/ResourcePlugins/ResourcePluginTest.php @@ -20,10 +20,6 @@ class ResourcePluginTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test resource plugin rendering diff --git a/tests/UnitTests/ResourceTests/ResourcePlugins/cache/.gitignore b/tests/UnitTests/ResourceTests/ResourcePlugins/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/ResourcePlugins/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/ResourcePlugins/templates_c/.gitignore b/tests/UnitTests/ResourceTests/ResourcePlugins/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/ResourcePlugins/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php b/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php index e2a8ff70..dbb14285 100644 --- a/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php +++ b/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php @@ -27,10 +27,6 @@ class StreamResourceTest extends PHPUnit_Smarty fclose($fp); } - public function testInit() - { - $this->cleanDirs(); - } public function tearDown(): void { parent::tearDown(); diff --git a/tests/UnitTests/ResourceTests/Stream/cache/.gitignore b/tests/UnitTests/ResourceTests/Stream/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Stream/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/Stream/templates_c/.gitignore b/tests/UnitTests/ResourceTests/Stream/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/Stream/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/String/StringResourceTest.php b/tests/UnitTests/ResourceTests/String/StringResourceTest.php index a048d8b8..16a9c88b 100644 --- a/tests/UnitTests/ResourceTests/String/StringResourceTest.php +++ b/tests/UnitTests/ResourceTests/String/StringResourceTest.php @@ -21,10 +21,6 @@ class StringResourceTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } protected function relative($path) { diff --git a/tests/UnitTests/ResourceTests/String/cache/.gitignore b/tests/UnitTests/ResourceTests/String/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/String/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/ResourceTests/String/templates_c/.gitignore b/tests/UnitTests/ResourceTests/String/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/ResourceTests/String/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SecurityTests/FunctionTest.php b/tests/UnitTests/SecurityTests/FunctionTest.php index 3ef09b15..0559a3dc 100644 --- a/tests/UnitTests/SecurityTests/FunctionTest.php +++ b/tests/UnitTests/SecurityTests/FunctionTest.php @@ -20,10 +20,6 @@ class FunctionTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test unknown function error diff --git a/tests/UnitTests/SecurityTests/SecurityTest.php b/tests/UnitTests/SecurityTests/SecurityTest.php index 9996f225..393c8f54 100644 --- a/tests/UnitTests/SecurityTests/SecurityTest.php +++ b/tests/UnitTests/SecurityTests/SecurityTest.php @@ -20,10 +20,6 @@ class SecurityTest extends PHPUnit_Smarty $this->smarty->setForceCompile(true); $this->smarty->enableSecurity(); } - public function testInit() - { - $this->cleanDirs(); - } /** * test that security is loaded diff --git a/tests/UnitTests/SecurityTests/cache/.gitignore b/tests/UnitTests/SecurityTests/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SecurityTests/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SecurityTests/templates_c/.gitignore b/tests/UnitTests/SecurityTests/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SecurityTests/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/Append/AppendTest.php b/tests/UnitTests/SmartyMethodsTests/Append/AppendTest.php index 43736d01..c59fef81 100644 --- a/tests/UnitTests/SmartyMethodsTests/Append/AppendTest.php +++ b/tests/UnitTests/SmartyMethodsTests/Append/AppendTest.php @@ -21,10 +21,6 @@ class AppendTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test append */ diff --git a/tests/UnitTests/SmartyMethodsTests/Append/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/Append/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/Append/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/Append/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/Append/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/Append/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php b/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php index e8ae92b7..ec16526a 100644 --- a/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php +++ b/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php @@ -21,10 +21,6 @@ class AssignTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test simple assign */ diff --git a/tests/UnitTests/SmartyMethodsTests/Assign/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/Assign/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/Assign/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/Assign/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/Assign/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/Assign/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignTest.php b/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignTest.php index f9caa8a6..e1298e4b 100644 --- a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignTest.php +++ b/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignTest.php @@ -25,10 +25,6 @@ class ClearAllAssignTest extends PHPUnit_Smarty $this->_tpl->assign('blar', 'blar'); } - public function testInit() - { - $this->cleanDirs(); - } /** * test all variables accessable */ diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAssign/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/ClearAssign/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/ClearAssign/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAssign/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/ClearAssign/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/ClearAssign/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledTest.php b/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledTest.php index 8e638d98..dd5c4f97 100644 --- a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledTest.php +++ b/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledTest.php @@ -19,14 +19,11 @@ class ClearCompiledTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addTemplateDir('./templates_2/'); + $this->smarty->setTemplateDir('./templates/'); + $this->smarty->addTemplateDir('./templates_2/'); } - public function testInit() - { - $this->cleanDirs(); - } // helpers /** * clear $smarty->compile_dir diff --git a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/CompileCheck/CompileCheckTest.php b/tests/UnitTests/SmartyMethodsTests/CompileCheck/CompileCheckTest.php index 2c401b5e..0a55ff4c 100644 --- a/tests/UnitTests/SmartyMethodsTests/CompileCheck/CompileCheckTest.php +++ b/tests/UnitTests/SmartyMethodsTests/CompileCheck/CompileCheckTest.php @@ -7,7 +7,6 @@ class CompileCheckTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addTemplateDir('./templates_tmp'); $this->cleanDirs(); } @@ -16,18 +15,18 @@ class CompileCheckTest extends PHPUnit_Smarty */ protected function makeFiles() { - file_put_contents('./templates_tmp/t1.tpl', 'TPL1'); - file_put_contents('./templates_tmp/t2.tpl', 'TPL2'); - file_put_contents('./templates_tmp/base.tpl', '{include file="t1.tpl"}{include file="t2.tpl"}'); + $this->makeTemplateFile('t1.tpl', 'TPL1'); + $this->makeTemplateFile('t2.tpl', 'TPL2'); + $this->makeTemplateFile('base.tpl', '{include file="t1.tpl"}{include file="t2.tpl"}'); } /** * remove generated templates */ protected function removeFiles() { - unlink('./templates_tmp/t1.tpl'); - unlink('./templates_tmp/t2.tpl'); - unlink('./templates_tmp/base.tpl'); + $this->removeTemplateFile('t1.tpl'); + $this->removeTemplateFile('t2.tpl'); + $this->removeTemplateFile('base.tpl'); } /** @@ -35,8 +34,7 @@ class CompileCheckTest extends PHPUnit_Smarty * @return void */ private function softResetSmarty() { - $this->smarty = new \Smarty\Smarty(); - $this->smarty->addTemplateDir('./templates_tmp'); + $this->setUpSmarty(__DIR__); } /** @@ -64,7 +62,7 @@ class CompileCheckTest extends PHPUnit_Smarty $this->softResetSmarty(); $this->smarty->setCompileCheck(\Smarty\Smarty::COMPILECHECK_ON); - unlink('./templates_tmp/base.tpl'); + $this->removeTemplateFile('base.tpl'); sleep(1); $this->expectException(\Smarty\Exception::class); @@ -83,7 +81,7 @@ class CompileCheckTest extends PHPUnit_Smarty $this->smarty->setCompileCheck(\Smarty\Smarty::COMPILECHECK_ON); sleep(1); - file_put_contents('./templates_tmp/base.tpl', 'hello'); + $this->makeTemplateFile('base.tpl', 'hello'); $this->assertEquals('hello', $this->smarty->fetch('base.tpl')); } @@ -113,7 +111,7 @@ class CompileCheckTest extends PHPUnit_Smarty $this->softResetSmarty(); $this->smarty->setCompileCheck(\Smarty\Smarty::COMPILECHECK_OFF); - unlink('./templates_tmp/base.tpl'); + $this->removeTemplateFile('base.tpl'); sleep(1); $this->assertEquals('TPL1TPL2', $this->smarty->fetch('base.tpl')); @@ -131,7 +129,7 @@ class CompileCheckTest extends PHPUnit_Smarty $this->smarty->setCompileCheck(\Smarty\Smarty::COMPILECHECK_OFF); sleep(1); - file_put_contents('./templates_tmp/base.tpl', 'hello'); + $this->makeTemplateFile('base.tpl', 'hello'); $this->assertEquals('TPL1TPL2', $this->smarty->fetch('base.tpl')); } diff --git a/tests/UnitTests/SmartyMethodsTests/CompileCheck/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/CompileCheck/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/CompileCheck/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/CompileCheck/templates_tmp/.gitignore b/tests/UnitTests/SmartyMethodsTests/CompileCheck/templates_tmp/.gitignore deleted file mode 100644 index a0f57452..00000000 --- a/tests/UnitTests/SmartyMethodsTests/CompileCheck/templates_tmp/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore anything in here, but keep this directory -* - diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php index 3dc8c0a7..631ae351 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php @@ -25,10 +25,6 @@ class RegisterBlockTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test registerPlugin method for block function */ diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterBlock/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterBlock/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionTest.php index ec2287ad..e6d3ddf1 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionTest.php @@ -23,10 +23,6 @@ class RegisterCompilerFunctionTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test register->compilerFunction method for function */ diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php index 7bfe1a59..552bd3f8 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php @@ -23,10 +23,6 @@ class RegisterFunctionTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test registerPlugin method for function diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierFirstClassCallablesTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierFirstClassCallablesTest.php index 18e3fa36..50fdb9a0 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierFirstClassCallablesTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierFirstClassCallablesTest.php @@ -17,10 +17,6 @@ if (PHP_VERSION_ID >= 80100) { } - public function testInit() - { - $this->cleanDirs(); - } public function testRegisterFirstClassCallable() { diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierTest.php index 1d422d03..dfaf09c3 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierTest.php @@ -21,10 +21,6 @@ class RegisterModifierTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test register->modifier method for function */ diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterObject/CompileRegisteredObjectFunctionTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterObject/CompileRegisteredObjectFunctionTest.php index 9aca31fd..d8ec2b00 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterObject/CompileRegisteredObjectFunctionTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterObject/CompileRegisteredObjectFunctionTest.php @@ -32,10 +32,6 @@ class CompileRegisteredObjectFunctionTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test resgistered object as function */ diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterObject/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterObject/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterObject/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterObject/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/RegisterObject/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/RegisterObject/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/TemplateExist/TemplateExistsTest.php b/tests/UnitTests/SmartyMethodsTests/TemplateExist/TemplateExistsTest.php index 2917982a..da5bbb6b 100644 --- a/tests/UnitTests/SmartyMethodsTests/TemplateExist/TemplateExistsTest.php +++ b/tests/UnitTests/SmartyMethodsTests/TemplateExist/TemplateExistsTest.php @@ -21,10 +21,6 @@ class TemplateExistsTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test $smarty->templateExists true */ diff --git a/tests/UnitTests/SmartyMethodsTests/TemplateExist/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/TemplateExist/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/TemplateExist/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/TemplateExist/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/TemplateExist/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/SmartyMethodsTests/TemplateExist/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/TemplateVars/GetTemplateVarsTest.php b/tests/UnitTests/SmartyMethodsTests/TemplateVars/GetTemplateVarsTest.php index db60b822..74141343 100644 --- a/tests/UnitTests/SmartyMethodsTests/TemplateVars/GetTemplateVarsTest.php +++ b/tests/UnitTests/SmartyMethodsTests/TemplateVars/GetTemplateVarsTest.php @@ -9,10 +9,6 @@ class GetTemplateVarsTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test root getTemplateVars single value */ diff --git a/tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php b/tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php index 047af7b9..68c5fb38 100644 --- a/tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php +++ b/tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php @@ -11,10 +11,6 @@ class HasVariableTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } public function testSimpleTrue() { diff --git a/tests/UnitTests/TemplateSource/Comments/CommentsTest.php b/tests/UnitTests/TemplateSource/Comments/CommentsTest.php index 443ac39e..b399d592 100644 --- a/tests/UnitTests/TemplateSource/Comments/CommentsTest.php +++ b/tests/UnitTests/TemplateSource/Comments/CommentsTest.php @@ -20,10 +20,6 @@ class CommentsTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test comments @@ -36,7 +32,6 @@ class CommentsTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "testComments_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->assertEquals($result, $this->smarty->fetch($file), $file); diff --git a/tests/UnitTests/TemplateSource/Comments/cache/.gitignore b/tests/UnitTests/TemplateSource/Comments/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/Comments/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/Comments/templates_c/.gitignore b/tests/UnitTests/TemplateSource/Comments/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/Comments/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/Spacing/SpacingTest.php b/tests/UnitTests/TemplateSource/Spacing/SpacingTest.php index 098d9eb8..eeb4477b 100644 --- a/tests/UnitTests/TemplateSource/Spacing/SpacingTest.php +++ b/tests/UnitTests/TemplateSource/Spacing/SpacingTest.php @@ -20,10 +20,6 @@ class SpacingTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test spacings @@ -37,7 +33,6 @@ class SpacingTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('file', $file); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, diff --git a/tests/UnitTests/TemplateSource/Spacing/cache/.gitignore b/tests/UnitTests/TemplateSource/Spacing/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/Spacing/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/Spacing/templates_c/.gitignore b/tests/UnitTests/TemplateSource/Spacing/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/Spacing/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/Spacing/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/Spacing/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/Spacing/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/StaticClass/StaticClassAccessTest.php b/tests/UnitTests/TemplateSource/StaticClass/StaticClassAccessTest.php index b3c231ac..ac506f93 100644 --- a/tests/UnitTests/TemplateSource/StaticClass/StaticClassAccessTest.php +++ b/tests/UnitTests/TemplateSource/StaticClass/StaticClassAccessTest.php @@ -22,10 +22,6 @@ class StaticClassAccessTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test static class variable */ diff --git a/tests/UnitTests/TemplateSource/StaticClass/cache/.gitignore b/tests/UnitTests/TemplateSource/StaticClass/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/StaticClass/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/StaticClass/templates_c/.gitignore b/tests/UnitTests/TemplateSource/StaticClass/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/StaticClass/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Append/CompileAppendTest.php b/tests/UnitTests/TemplateSource/TagTests/Append/CompileAppendTest.php index dc99abcf..c53e0fa6 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Append/CompileAppendTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Append/CompileAppendTest.php @@ -18,16 +18,9 @@ class CompileAppendTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("../../../__shared/templates/"); - $this->smarty->addTemplateDir("./templates_tmp"); $this->smarty->registerPlugin('modifier', 'var_export', 'var_export'); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test {append} tags @@ -79,7 +72,6 @@ class CompileAppendTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), @@ -98,7 +90,6 @@ class CompileAppendTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('1'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar',true); $this->assertEquals($result, $this->smarty->fetch($file), @@ -117,7 +108,6 @@ class CompileAppendTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('1'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar',true); $this->assertEquals($result, diff --git a/tests/UnitTests/TemplateSource/TagTests/Append/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Append/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Append/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Append/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Append/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Append/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Append/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Append/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Append/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Assign/CompileAssignTest.php b/tests/UnitTests/TemplateSource/TagTests/Assign/CompileAssignTest.php index e654efa2..eca94e4e 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Assign/CompileAssignTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Assign/CompileAssignTest.php @@ -18,16 +18,9 @@ class CompileAssignTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("../../../__shared/templates/"); - $this->smarty->addTemplateDir("./templates_tmp"); $this->smarty->registerPlugin('modifier', 'var_export', 'var_export'); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test assign tags @@ -102,7 +95,6 @@ class CompileAssignTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), @@ -121,7 +113,6 @@ class CompileAssignTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('1'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar',true); $this->assertEquals($result, $this->smarty->fetch($file), @@ -140,7 +131,6 @@ class CompileAssignTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('1'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'foo',true); $this->assertEquals(str_replace('bar','foo',$result), $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/Assign/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Assign/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Assign/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Assign/templates/test_scope_assignbar.tpl b/tests/UnitTests/TemplateSource/TagTests/Assign/templates/test_scope_assignbar.tpl deleted file mode 100644 index c0be3a40..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Assign/templates/test_scope_assignbar.tpl +++ /dev/null @@ -1 +0,0 @@ -{$foo = $bar scope=global}{checkvar var=foo nocache} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Assign/templates/test_scope_assignnocache.tpl b/tests/UnitTests/TemplateSource/TagTests/Assign/templates/test_scope_assignnocache.tpl deleted file mode 100644 index 4bde90af..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Assign/templates/test_scope_assignnocache.tpl +++ /dev/null @@ -1 +0,0 @@ -{$foo = $buh scope=global nocache}{checkvar var=foo nocache} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Assign/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Assign/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Assign/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Assign/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Assign/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Assign/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php index 328cd4c1..525d3aad 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php @@ -22,10 +22,6 @@ class CompileBlockPluginTest extends PHPUnit_Smarty $this->smarty->disableSecurity(); } - public function testInit() - { - $this->cleanDirs(); - } /** * test block plugin tag @@ -251,7 +247,6 @@ class CompileBlockPluginTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "testSpacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), @@ -290,7 +285,6 @@ class CompileBlockPluginTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "testSpacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->registerDefaultPluginHandler('my_block_plugin_handler'); $this->smarty->setCompileId('default'); $this->smarty->assign('foo', 'bar'); @@ -334,7 +328,6 @@ class CompileBlockPluginTest extends PHPUnit_Smarty $this->makeTemplateFile($file, $code); $this->smarty->setCompileId('nocache'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('bar', 'bar',true); $this->assertEquals($result, $this->smarty->fetch($file), @@ -351,7 +344,6 @@ class CompileBlockPluginTest extends PHPUnit_Smarty $file = "Nocache_{$name}.tpl"; $this->smarty->setCompileId('nocache'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('bar', 'foo',true); $this->assertEquals(str_replace('bar','foo',$result), $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php index 6f0a798f..a8c896d3 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php @@ -24,10 +24,6 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty return str_replace('#', $tpl->getTemplateVars('test'), $text); } - public function testInit() - { - $this->cleanDirs(); - } /** * test block default outout @@ -563,7 +559,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->assign('parent', 'parent'); $this->smarty->assign('child', 'child', true); $this->smarty->assign('grand', 'grand', true); - $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/mustcompile'); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); @@ -589,7 +585,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty */ public function testCompileBlockGrandChildMustCompile_021_12() { - $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/mustcompile'); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; $this->smarty->assign('parent', 'parent3'); @@ -611,7 +607,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->assign('parent', 'parent4'); $this->smarty->assign('child', 'child4', true); $this->smarty->assign('grand', 'grand4', true); - $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/mustcompile'); sleep(2); touch($this->smarty->getTemplateDir(0) . '021_grand.tpl'); clearstatcache(); @@ -625,7 +621,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->assign('parent', 'parent5'); $this->smarty->assign('child', 'child5', true); $this->smarty->assign('grand', 'grand5', true); - $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/mustcompile'); $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); @@ -642,7 +638,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->assign('parent', 'parent6'); $this->smarty->assign('child', 'child6', true); $this->smarty->assign('grand', 'grand6', true); - $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/mustcompile'); sleep(2); touch($this->smarty->getTemplateDir(0) . '021_child.tpl'); clearstatcache(); @@ -667,7 +663,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->assign('parent', 'parent7'); $this->smarty->assign('child', 'child7', true); $this->smarty->assign('grand', 'grand7', true); - $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/mustcompile'); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); @@ -686,7 +682,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->assign('parent', 'parent8'); $this->smarty->assign('child', 'child8', true); $this->smarty->assign('grand', 'grand8', true); - $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/mustcompile'); sleep(2); touch($this->smarty->getTemplateDir(0) . '021_parent.tpl'); clearstatcache(); @@ -711,7 +707,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->assign('parent', 'parent9'); $this->smarty->assign('child', 'child9', true); $this->smarty->assign('grand', 'grand9', true); - $this->smarty->setCompileDir('./templates_c/mustcompile'); + $this->smarty->setCompileDir(self::getTempBase() . 'templates_c/mustcompile'); $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); @@ -1023,7 +1019,6 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), @@ -1042,7 +1037,6 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('VarNocache'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar',true); $this->assertEquals($result, $this->smarty->fetch($file), @@ -1061,7 +1055,6 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('VarNocache'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'foo',true); $this->assertEquals(str_replace('bar','foo',$result), $this->smarty->fetch($file), @@ -1103,7 +1096,6 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $child .= preg_replace(array('/A/','/C/','/[$]foo/','/\s*[{][$]smarty[.]block[.]child[}]\s*/'),array('G','H','$bar','{$bar}'),$code); $file = "Spacing_Child{$name}.tpl"; $this->makeTemplateFile($file, $child); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'foo'); $this->smarty->assign('bar', 'bar'); $this->assertEquals($result, @@ -1149,7 +1141,6 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->makeTemplateFile($file, $code); $this->smarty->setCompileId('BlockNocache'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), @@ -1167,7 +1158,6 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $file = "blockNocache_{$name}.tpl"; $this->smarty->setCompileId('BlockNocache'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'foo'); $this->assertEquals(str_replace('bar','foo',$result), $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/BockExtend/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_c/mustcompile/.gitignore b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_c/mustcompile/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_c/mustcompile/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php b/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php index 97a3c54f..ecdded10 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php @@ -18,13 +18,6 @@ class CompileCaptureTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addTemplateDir("./templates_tmp"); - } - - - public function testInit() - { - $this->cleanDirs(); } /** @@ -116,7 +109,6 @@ class CompileCaptureTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/Capture/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Capture/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Capture/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Capture/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Capture/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Capture/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Capture/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Capture/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Capture/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/CompilerPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/CompilerPluginTest.php index 78efeb9b..e026f8a4 100644 --- a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/CompilerPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/CompilerPluginTest.php @@ -17,10 +17,6 @@ class CompilerPluginTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test compiler plugin */ diff --git a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/CompileConfigLoadTest.php b/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/CompileConfigLoadTest.php index 5a402028..090f1321 100644 --- a/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/CompileConfigLoadTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/CompileConfigLoadTest.php @@ -23,18 +23,11 @@ class CompileConfigLoadTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("../../../__shared/templates/"); - $this->smarty->addTemplateDir("./templates_tmp"); } /** * empty template_c and cache folders */ - public function testInit() - { - $this->cleanDirs(); - } /** * diff --git a/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Delimiter/CompileDelimiterTest.php b/tests/UnitTests/TemplateSource/TagTests/Delimiter/CompileDelimiterTest.php index 4a90c535..4aeaee68 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Delimiter/CompileDelimiterTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Delimiter/CompileDelimiterTest.php @@ -21,10 +21,6 @@ class CompileDelimiterTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test delimiter tag test diff --git a/tests/UnitTests/TemplateSource/TagTests/Delimiter/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Delimiter/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Delimiter/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Delimiter/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Delimiter/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Delimiter/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Eval/CompileEvalTest.php b/tests/UnitTests/TemplateSource/TagTests/Eval/CompileEvalTest.php index 1c2ad006..734475b2 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Eval/CompileEvalTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Eval/CompileEvalTest.php @@ -21,10 +21,6 @@ class CompileEvalTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test eval tag */ diff --git a/tests/UnitTests/TemplateSource/TagTests/Eval/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Eval/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Eval/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Eval/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Eval/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Eval/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/For/CompileForTest.php b/tests/UnitTests/TemplateSource/TagTests/For/CompileForTest.php index 21d997d6..2aa5f7ef 100644 --- a/tests/UnitTests/TemplateSource/TagTests/For/CompileForTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/For/CompileForTest.php @@ -21,10 +21,6 @@ class CompileForTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * Test For @@ -38,7 +34,6 @@ class CompileForTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "For_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->assertEquals($result, $this->smarty->fetch($file), $file); @@ -162,7 +157,6 @@ class CompileForTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('buh', 'buh'); $this->assertEquals($result, $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/For/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/For/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/For/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/For/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/For/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/For/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/For/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/For/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/For/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Foreach/CompileForeachTest.php b/tests/UnitTests/TemplateSource/TagTests/Foreach/CompileForeachTest.php index 3e39d5e2..7370de5b 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Foreach/CompileForeachTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Foreach/CompileForeachTest.php @@ -18,13 +18,6 @@ class CompileForeachTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("./templates_tmp"); - } - - public function testInit() - { - $this->cleanDirs(); } /** @@ -312,7 +305,6 @@ class CompileForeachTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', array(1,2)); $this->assertEquals($result, $this->smarty->fetch($file), @@ -356,7 +348,6 @@ class CompileForeachTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_Else_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', array()); $this->smarty->assign('buh', 'buh'); $this->assertEquals($result, diff --git a/tests/UnitTests/TemplateSource/TagTests/Foreach/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Foreach/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Foreach/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Foreach/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Foreach/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Foreach/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Foreach/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Foreach/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Foreach/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionObjectChain/FunctionObjectChainTest.php b/tests/UnitTests/TemplateSource/TagTests/FunctionObjectChain/FunctionObjectChainTest.php index c1e34bdd..44f6b25d 100644 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionObjectChain/FunctionObjectChainTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/FunctionObjectChain/FunctionObjectChainTest.php @@ -92,10 +92,6 @@ class FunctionObjectChainTest extends PHPUnit_Smarty $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'create_object', 'smarty_modifier_create_object'); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test the NEW feature: function call followed by method chain diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php index fd62a5ef..5e23772c 100644 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php @@ -18,15 +18,8 @@ class CompileFunctionPluginTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); } - public function testInit() - { - $this->cleanDirs(); - } - - /** * test function plugin tag in compiled template file */ diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates/functionplugintestnocache.tpl b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates/functionplugintestnocache.tpl deleted file mode 100644 index 9134519a..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates/functionplugintestnocache.tpl +++ /dev/null @@ -1 +0,0 @@ -{getvar var=foo nocache} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php b/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php index 4384aa41..fbb20201 100644 --- a/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php @@ -18,16 +18,9 @@ class CompileIfTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("../../../__shared/templates/"); - $this->smarty->addTemplateDir("./templates_tmp"); $this->smarty->registerPlugin('modifier', 'var_export', 'var_export'); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test if tags @@ -249,7 +242,6 @@ class CompileIfTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('bar', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/If/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/If/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/If/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/If/templates/run_code.tpl b/tests/UnitTests/TemplateSource/TagTests/If/templates/run_code.tpl new file mode 100644 index 00000000..f2db3620 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/If/templates/run_code.tpl @@ -0,0 +1 @@ +{include $file} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/If/templates/run_code_caching.tpl b/tests/UnitTests/TemplateSource/TagTests/If/templates/run_code_caching.tpl new file mode 100644 index 00000000..421be584 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/If/templates/run_code_caching.tpl @@ -0,0 +1 @@ +{include $file caching} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/If/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/If/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/If/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/If/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/If/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/If/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php b/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php index bd6eeaf4..00b67bdf 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php @@ -18,14 +18,6 @@ class CompileIncludeTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("./templates_tmp"); - } - - - public function testInit() - { - $this->cleanDirs(); } /** @@ -265,7 +257,6 @@ class CompileIncludeTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->addTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), @@ -284,7 +275,6 @@ class CompileIncludeTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('1'); $this->smarty->setCaching(1); - $this->smarty->addTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar',true); $this->assertEquals($result, $this->smarty->fetch($file), @@ -303,7 +293,6 @@ class CompileIncludeTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('1'); $this->smarty->setCaching(1); - $this->smarty->addTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'foo',true); $this->assertEquals(str_replace('bar','foo',$result), $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Include/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Include/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope.tpl b/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope.tpl deleted file mode 100644 index bfb1e6cb..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope.tpl +++ /dev/null @@ -1 +0,0 @@ -{include $file} diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope_assign.tpl b/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope_assign.tpl deleted file mode 100644 index ae7268d8..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope_assign.tpl +++ /dev/null @@ -1 +0,0 @@ -{$foo = 'newvar'}{checkvar var=foo} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope_pluginassign.tpl b/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope_pluginassign.tpl deleted file mode 100644 index e19a560a..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Include/templates/test_scope_pluginassign.tpl +++ /dev/null @@ -1 +0,0 @@ -{pluginassign var=foo value='newvar'}{checkvar var=foo} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Include/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Include/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Include/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Include/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Literal/LiteralTest.php b/tests/UnitTests/TemplateSource/TagTests/Literal/LiteralTest.php index b71ed781..c44251e9 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Literal/LiteralTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Literal/LiteralTest.php @@ -21,10 +21,6 @@ class LiteralTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /* * Test literal tag */ diff --git a/tests/UnitTests/TemplateSource/TagTests/Literal/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Literal/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Literal/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Literal/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Literal/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Literal/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Nocache/CompileNocacheTest.php b/tests/UnitTests/TemplateSource/TagTests/Nocache/CompileNocacheTest.php index 9efd5329..03eb7974 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Nocache/CompileNocacheTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Nocache/CompileNocacheTest.php @@ -21,10 +21,6 @@ class CompileNocacheTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test nocache tag caching disabled */ diff --git a/tests/UnitTests/TemplateSource/TagTests/Nocache/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Nocache/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Nocache/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Nocache/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Nocache/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Nocache/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginBlock/PluginBlockTextformatTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginBlock/PluginBlockTextformatTest.php index d6dc3cd6..11907167 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginBlock/PluginBlockTextformatTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginBlock/PluginBlockTextformatTest.php @@ -22,10 +22,6 @@ class PluginBlockTextformatTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } public function testDefault() { diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginBlock/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/PluginBlock/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/PluginBlock/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginBlock/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/PluginBlock/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/PluginBlock/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php index 5c3aa45e..0a2a5f6e 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php @@ -10,10 +10,6 @@ class PluginFunctionFetchTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test {fetch} from local file diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountSentencesTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountSentencesTest.php index caec7630..a6d8cf4a 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountSentencesTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountSentencesTest.php @@ -20,10 +20,6 @@ class PluginModifierCountSentencesTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } public function testDefault() { diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php b/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php index b2bc2a48..1ace1817 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php @@ -21,10 +21,6 @@ class CompileSectionTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test {section} tag */ @@ -74,7 +70,6 @@ class CompileSectionTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', array(1,2)); $this->assertEquals($result, $this->smarty->fetch($file), @@ -118,7 +113,6 @@ class CompileSectionTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_Else_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', array()); $this->smarty->assign('bar', 'bar'); $this->assertEquals($result, diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Section/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Section/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Section/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Section/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Section/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Section/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php b/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php index cdc27e40..fe5bc1e6 100644 --- a/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php @@ -21,10 +21,6 @@ class CompileSetfilterTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * @run * InSeparateProcess diff --git a/tests/UnitTests/TemplateSource/TagTests/SetFilter/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/SetFilter/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/SetFilter/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/SetFilter/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/SetFilter/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/SetFilter/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php index 35b2eaac..7b417e43 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php @@ -18,13 +18,6 @@ class CompileStripTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("./templates_tmp"); - } - - public function testInit() - { - $this->cleanDirs(); } /** diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Strip/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Strip/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/Strip/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/Strip/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php index 16892ed0..0d3cddca 100644 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php @@ -23,10 +23,6 @@ class CompileFunctionTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * * @@ -359,7 +355,6 @@ class CompileFunctionTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->addTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), @@ -378,7 +373,6 @@ class CompileFunctionTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('VarNocache'); $this->smarty->setCaching(1); - $this->smarty->addTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar',true); $this->assertEquals($result, $this->smarty->fetch($file), @@ -397,7 +391,6 @@ class CompileFunctionTest extends PHPUnit_Smarty $file = "Spacing_{$name}.tpl"; $this->smarty->setCompileId('VarNocache'); $this->smarty->setCaching(1); - $this->smarty->addTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'foo',true); $this->assertEquals(str_replace('bar','foo',$result), $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/While/CompileWhileTest.php b/tests/UnitTests/TemplateSource/TagTests/While/CompileWhileTest.php index eaabf29b..84e24f1a 100644 --- a/tests/UnitTests/TemplateSource/TagTests/While/CompileWhileTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/While/CompileWhileTest.php @@ -21,10 +21,6 @@ class CompileWhileTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test {while 'condition'} tag */ @@ -55,7 +51,6 @@ class CompileWhileTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 3); $this->assertEquals($result, $this->smarty->fetch($file), @@ -113,7 +108,6 @@ class CompileWhileTest extends PHPUnit_Smarty $this->makeTemplateFile($file, $code); } $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', $value, $nocache); $this->assertEquals($result, $this->smarty->fetch($file), "{$file} - {$testNumber}"); diff --git a/tests/UnitTests/TemplateSource/TagTests/While/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/While/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/While/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/While/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/While/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/While/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/While/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/While/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/While/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php b/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php index 9beb5d09..dc5419bc 100644 --- a/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php @@ -18,14 +18,10 @@ class AttributeTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); + $this->smarty->addPluginsDir("./plugins/"); } - public function testInit() - { - $this->cleanDirs(); - } /** * test required attribute diff --git a/tests/UnitTests/TemplateSource/TagTests/_Attributes/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/_Attributes/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/_Attributes/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/_Attributes/plugins/function.getparams.php b/tests/UnitTests/TemplateSource/TagTests/_Attributes/plugins/function.getparams.php new file mode 100644 index 00000000..41075800 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/_Attributes/plugins/function.getparams.php @@ -0,0 +1,22 @@ +setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test none existing template file error diff --git a/tests/UnitTests/TemplateSource/TagTests/_Error/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/_Error/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/_Error/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/_Error/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/_Error/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/_Error/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/_Print/PrintTest.php b/tests/UnitTests/TemplateSource/TagTests/_Print/PrintTest.php index f10af7da..095eada5 100644 --- a/tests/UnitTests/TemplateSource/TagTests/_Print/PrintTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/_Print/PrintTest.php @@ -21,10 +21,6 @@ class PrintTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * Test Output spacings * @@ -37,7 +33,6 @@ class PrintTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "testSpacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, $this->smarty->fetch($file), @@ -56,7 +51,6 @@ class PrintTest extends PHPUnit_Smarty $file = "testSpacing_{$name}.tpl"; $this->smarty->setCompileId('1'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'bar',true); $this->assertEquals($result, $this->smarty->fetch($file), @@ -75,7 +69,6 @@ class PrintTest extends PHPUnit_Smarty $file = "testSpacing_{$name}.tpl"; $this->smarty->setCompileId('1'); $this->smarty->setCaching(1); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 'foo',true); $this->assertEquals(str_replace('bar','foo',$result), $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/TagTests/_Print/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/_Print/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/_Print/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/_Print/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/_Print/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/_Print/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/_Print/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/TagTests/_Print/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/_Print/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/break/CompileBreakTest.php b/tests/UnitTests/TemplateSource/TagTests/break/CompileBreakTest.php index 85e9aaaf..cf3a589a 100644 --- a/tests/UnitTests/TemplateSource/TagTests/break/CompileBreakTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/break/CompileBreakTest.php @@ -21,10 +21,6 @@ class CompileBreakTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test {break} in foreach */ diff --git a/tests/UnitTests/TemplateSource/TagTests/break/cache/.gitignore b/tests/UnitTests/TemplateSource/TagTests/break/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/break/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/TagTests/break/templates_c/.gitignore b/tests/UnitTests/TemplateSource/TagTests/break/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/TagTests/break/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Array/ArrayTest.php b/tests/UnitTests/TemplateSource/ValueTests/Array/ArrayTest.php index 096a38c7..2a133327 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Array/ArrayTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Array/ArrayTest.php @@ -20,10 +20,6 @@ class ArrayTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test array access * @@ -36,7 +32,6 @@ class ArrayTest extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Array_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('foo', 3); $this->assertEquals($result, $this->smarty->fetch($file), diff --git a/tests/UnitTests/TemplateSource/ValueTests/Array/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Array/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Array/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Array/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Array/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Array/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Array/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Array/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Array/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php index 41b5a10c..82ec3938 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php @@ -20,10 +20,6 @@ class BooleanNullTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test true * diff --git a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/ConstantsTest.php b/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/ConstantsTest.php index f85acafb..4b6042bb 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/ConstantsTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/ConstantsTest.php @@ -25,10 +25,6 @@ class ConstantsTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test constants */ diff --git a/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php index 688afb2e..d3ea8e5c 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php @@ -18,14 +18,6 @@ class DoubleQuotedStringTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("../../../__shared/templates/"); - $this->smarty->addTemplateDir("./templates_tmp"); - } - - public function testInit() - { - $this->cleanDirs(); } /** diff --git a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php b/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php index 4f38c161..bcf1aaa0 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php @@ -21,10 +21,6 @@ class MathTest extends PHPUnit_Smarty $this->smarty->registerPlugin('modifier', 'sin', 'sin'); } - public function testInit() - { - $this->cleanDirs(); - } /** * test PHP function as modifier diff --git a/tests/UnitTests/TemplateSource/ValueTests/Math/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Math/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Math/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Math/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Math/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Math/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php b/tests/UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php index 2895ad97..ad83b941 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php @@ -18,13 +18,8 @@ class ModifierTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addTemplateDir("./templates_tmp"); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test modifier diff --git a/tests/UnitTests/TemplateSource/ValueTests/Modifier/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Modifier/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Modifier/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Modifier/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Modifier/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Modifier/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Modifier/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Modifier/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Modifier/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Objects/ObjectVariableTest.php b/tests/UnitTests/TemplateSource/ValueTests/Objects/ObjectVariableTest.php index 9be49105..ff5c3e5e 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Objects/ObjectVariableTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Objects/ObjectVariableTest.php @@ -22,10 +22,6 @@ class ObjectVariableTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test simple object variable */ diff --git a/tests/UnitTests/TemplateSource/ValueTests/Objects/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Objects/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Objects/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Objects/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Objects/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Objects/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Operators/MatchesOperatorTest.php b/tests/UnitTests/TemplateSource/ValueTests/Operators/MatchesOperatorTest.php index 206b67ce..40c91638 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Operators/MatchesOperatorTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Operators/MatchesOperatorTest.php @@ -8,10 +8,6 @@ class MatchesOperatorTest extends PHPUnit_Smarty { $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test basic regex matching functionality diff --git a/tests/UnitTests/TemplateSource/ValueTests/Operators/OperatorsTest.php b/tests/UnitTests/TemplateSource/ValueTests/Operators/OperatorsTest.php index ea88e4bd..ea66108b 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Operators/OperatorsTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Operators/OperatorsTest.php @@ -6,10 +6,6 @@ class OperatorsTest extends PHPUnit_Smarty { $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * @group issue861 diff --git a/tests/UnitTests/TemplateSource/ValueTests/Operators/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Operators/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Operators/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/PhpFunctionTest.php b/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/PhpFunctionTest.php index e2a38862..63767abd 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/PhpFunctionTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/PhpFunctionTest.php @@ -22,10 +22,6 @@ class PhpFunctionTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test PHP empty() on variables true diff --git a/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/SingleQuotedStringTest.php b/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/SingleQuotedStringTest.php index e9f3333f..d719e973 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/SingleQuotedStringTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/SingleQuotedStringTest.php @@ -20,10 +20,6 @@ class SingleQuotedStringTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test simple single quoted string diff --git a/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php index 26ba767e..b3b73e23 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php @@ -20,10 +20,6 @@ class SmartyConstantTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test {$smarty.constant.foo} * diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/CookieTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/CookieTest.php index f54cd12c..603b1ce3 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/CookieTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/CookieTest.php @@ -20,10 +20,6 @@ class CookieTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test cookies * diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/SmartyDelimiterTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/SmartyDelimiterTest.php index 47304b0d..4f761d69 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/SmartyDelimiterTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/SmartyDelimiterTest.php @@ -20,10 +20,6 @@ class SmartyDelimiterTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test {$smarty.ldelim} {$smarty.rdelim} * diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/SmartyErrorTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/SmartyErrorTest.php index baf805a6..8657003b 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/SmartyErrorTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/SmartyErrorTest.php @@ -20,10 +20,6 @@ class SmartyErrorTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test undefined Smarty special variable */ diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/SmartyNowTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/SmartyNowTest.php index 32116a7c..16940d13 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/SmartyNowTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/SmartyNowTest.php @@ -20,10 +20,6 @@ class SmartyNowTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test {$smarty.now} * diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/PostTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/PostTest.php index 92bfea4a..63d4ada1 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/PostTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/PostTest.php @@ -20,10 +20,6 @@ class PostTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test $_POST * diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/SmartyTemplateObjectTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/SmartyTemplateObjectTest.php index 1ee56beb..8064b585 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/SmartyTemplateObjectTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/SmartyTemplateObjectTest.php @@ -20,10 +20,6 @@ class SmartyTemplateObjectTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test {$smarty.template_objects} * diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/SmartyVersionTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/SmartyVersionTest.php index efbc2dd6..cb704f80 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/SmartyVersionTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/SmartyVersionTest.php @@ -20,10 +20,6 @@ class SmartyVersionTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test {$smarty.version} * diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php index 500dcc62..b6a80389 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php @@ -26,10 +26,6 @@ class StreamVariableTest extends PHPUnit_Smarty fclose($fp); } - public function testInit() - { - $this->cleanDirs(); - } protected function tearDown(): void { diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/VariableVariableTest.php b/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/VariableVariableTest.php index 997a342a..98f5621b 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/VariableVariableTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/VariableVariableTest.php @@ -20,10 +20,6 @@ class VariableVariableTest extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * test variable name in variable diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/cache/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/templates_c/.gitignore b/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php b/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php index 3999538e..152d8da3 100644 --- a/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php +++ b/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php @@ -18,15 +18,9 @@ class ScopeTest extends PHPUnit_Smarty public function setUp(): void { $this->setUpSmarty(__DIR__); - $this->smarty->addPluginsDir("../../__shared/PHPunitplugins/"); - $this->smarty->addTemplateDir("../../__shared/templates/"); - $this->smarty->addTemplateDir("./templates_tmp"); + $this->smarty->addPluginsDir("./plugins/"); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test scope diff --git a/tests/UnitTests/TemplateSource/X_Scopes/cache/.gitignore b/tests/UnitTests/TemplateSource/X_Scopes/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/X_Scopes/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.checkconfigvar.php b/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.checkconfigvar.php new file mode 100644 index 00000000..94fcc2c9 --- /dev/null +++ b/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.checkconfigvar.php @@ -0,0 +1,47 @@ +getSource()->name}:\${$var} ="; + $output .= $ptr->hasConfigVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getConfigVariable($var), true)) : 'null'; + $ptr = $ptr->parent; + } elseif (in_array('data', $types) && !($ptr instanceof Template || $ptr instanceof \Smarty\Smarty)) { + $output .= "#data:\${$var} ="; + $output .= $ptr->hasConfigVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getConfigVariable($var), true)) : 'null'; + $ptr = $ptr->parent; + } else { + $ptr = null; + } + } + if (in_array('global', $types)) { + $output .= "#global:\${$var} ="; + $output .= $template->getSmarty()->hasConfigVariable($var) ? + preg_replace('/\s/', '', var_export($template->getSmarty()->getConfigVariable($var), true)) : 'null'; + } + return $output; +} diff --git a/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.checkvar.php b/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.checkvar.php new file mode 100644 index 00000000..71740902 --- /dev/null +++ b/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.checkvar.php @@ -0,0 +1,47 @@ +getSource()->name}:\${$var} ="; + $output .= $ptr->hasVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getValue($var), true)) : '>unassigned<'; + $ptr = $ptr->parent; + } elseif (in_array('data', $types) && !($ptr instanceof Template || $ptr instanceof \Smarty\Smarty)) { + $output .= "#data:\${$var} ="; + $output .= $ptr->hasVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getValue($var), true)) : '>unassigned<'; + $ptr = $ptr->parent; + } else { + $ptr = null; + } + } + if (in_array('global', $types)) { + $output .= "#global:\${$var} ="; + $output .= $template->getSmarty()->hasVariable($var) ? + preg_replace('/\s/', '', var_export($template->getSmarty()->getValue($var), true)) : '>unassigned<'; + } + return $output; +} diff --git a/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.pluginassign.php b/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.pluginassign.php new file mode 100644 index 00000000..7786b742 --- /dev/null +++ b/tests/UnitTests/TemplateSource/X_Scopes/plugins/function.pluginassign.php @@ -0,0 +1,21 @@ +assign($params[ 'var' ], $params[ 'value' ]); + return ''; +} diff --git a/tests/UnitTests/TemplateSource/X_Scopes/templates/scope_include.tpl b/tests/UnitTests/TemplateSource/X_Scopes/templates/scope_include.tpl new file mode 100644 index 00000000..bfb1e6cb --- /dev/null +++ b/tests/UnitTests/TemplateSource/X_Scopes/templates/scope_include.tpl @@ -0,0 +1 @@ +{include $file} diff --git a/tests/UnitTests/TemplateSource/X_Scopes/templates/scope_tag.tpl b/tests/UnitTests/TemplateSource/X_Scopes/templates/scope_tag.tpl new file mode 100644 index 00000000..734ebb7b --- /dev/null +++ b/tests/UnitTests/TemplateSource/X_Scopes/templates/scope_tag.tpl @@ -0,0 +1 @@ +{include 'scope_include.tpl'} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/X_Scopes/templates_c/.gitignore b/tests/UnitTests/TemplateSource/X_Scopes/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/X_Scopes/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/X_Scopes/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/X_Scopes/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/X_Scopes/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/Xml/XmlTest.php b/tests/UnitTests/TemplateSource/Xml/XmlTest.php index fe7de221..8f279a48 100644 --- a/tests/UnitTests/TemplateSource/Xml/XmlTest.php +++ b/tests/UnitTests/TemplateSource/Xml/XmlTest.php @@ -23,10 +23,6 @@ class XmlTest extends PHPUnit_Smarty } - public function testInit() - { - $this->cleanDirs(); - } /** * test standard xml */ diff --git a/tests/UnitTests/TemplateSource/Xml/cache/.gitignore b/tests/UnitTests/TemplateSource/Xml/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/Xml/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/Xml/templates_c/.gitignore b/tests/UnitTests/TemplateSource/Xml/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/Xml/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/327/ModifierIssue327Test.php b/tests/UnitTests/TemplateSource/_Issues/327/ModifierIssue327Test.php index c9ba0d26..b75dd7ff 100644 --- a/tests/UnitTests/TemplateSource/_Issues/327/ModifierIssue327Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/327/ModifierIssue327Test.php @@ -21,10 +21,6 @@ class ModifierIssue327Test extends PHPUnit_Smarty $this->smarty->registerPlugin('modifier', 'substr', 'substr'); } - public function testInit() - { - $this->cleanDirs(); - } public function testModifier327() { diff --git a/tests/UnitTests/TemplateSource/_Issues/327/cache/.gitignore b/tests/UnitTests/TemplateSource/_Issues/327/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/327/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/327/templates_c/.gitignore b/tests/UnitTests/TemplateSource/_Issues/327/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/327/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php b/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php index 9f6d8164..2a5f3ae2 100644 --- a/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php @@ -20,10 +20,6 @@ class ExtendsIssue419Test extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } public function testextends419() { diff --git a/tests/UnitTests/TemplateSource/_Issues/419/cache/.gitignore b/tests/UnitTests/TemplateSource/_Issues/419/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/419/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/419/templates_c/.gitignore b/tests/UnitTests/TemplateSource/_Issues/419/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/419/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php b/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php index 03a48e1f..ccdadcfd 100644 --- a/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php @@ -22,10 +22,6 @@ class NestedLoopIssue422Test extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } public function testnested422() { diff --git a/tests/UnitTests/TemplateSource/_Issues/422/cache/.gitignore b/tests/UnitTests/TemplateSource/_Issues/422/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/422/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/422/templates_c/.gitignore b/tests/UnitTests/TemplateSource/_Issues/422/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/422/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.php b/tests/UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.php index c880bcb2..ada6c39e 100644 --- a/tests/UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.php @@ -22,10 +22,6 @@ class SectionPropertiesShortSyntaxIssue428Test extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } public function testSection_001() { diff --git a/tests/UnitTests/TemplateSource/_Issues/428/cache/.gitignore b/tests/UnitTests/TemplateSource/_Issues/428/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/428/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/428/templates_c/.gitignore b/tests/UnitTests/TemplateSource/_Issues/428/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/428/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/549/cache/.gitignore b/tests/UnitTests/TemplateSource/_Issues/549/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/549/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/549/templates_c/.gitignore b/tests/UnitTests/TemplateSource/_Issues/549/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/549/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/TooManyShorthandAttributes949Test.php b/tests/UnitTests/TemplateSource/_Issues/TooManyShorthandAttributes949Test.php index cfe55752..50f16a28 100644 --- a/tests/UnitTests/TemplateSource/_Issues/TooManyShorthandAttributes949Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/TooManyShorthandAttributes949Test.php @@ -4,12 +4,12 @@ class TooManyShorthandAttributes949Test extends PHPUnit_Smarty { public function testPregMatchAll() { - $smarty = new \Smarty\Smarty(); - $smarty->registerPlugin('modifier', 'var_dump', 'var_dump'); + $this->setUpSmarty(__DIR__); + $this->smarty->registerPlugin('modifier', 'var_dump', 'var_dump'); $templateStr = "eval:{\$a = 'blah'}{\$b = array()}{if var_dump('', \$a, \$b, 2)|noprint}blah{else}nah{/if}"; $this->assertEquals( 'nah', - $smarty->fetch($templateStr) + $this->smarty->fetch($templateStr) ); } diff --git a/tests/UnitTests/TemplateSource/_Issues/topic26878/NewlineSpacing.php b/tests/UnitTests/TemplateSource/_Issues/topic26878/NewlineSpacing.php index 6de26639..f394b68a 100644 --- a/tests/UnitTests/TemplateSource/_Issues/topic26878/NewlineSpacing.php +++ b/tests/UnitTests/TemplateSource/_Issues/topic26878/NewlineSpacing.php @@ -20,10 +20,6 @@ class NewlineSpacing extends PHPUnit_Smarty $this->setUpSmarty(__DIR__); } - public function testInit() - { - $this->cleanDirs(); - } /** * Test spacings @@ -37,7 +33,6 @@ class NewlineSpacing extends PHPUnit_Smarty $name = empty($testName) ? $testNumber : $testName; $file = "Spacing_{$name}.tpl"; $this->makeTemplateFile($file, $code); - $this->smarty->setTemplateDir('./templates_tmp'); $this->smarty->assign('file', $file); $this->smarty->assign('foo', 'bar'); $this->assertEquals($result, diff --git a/tests/UnitTests/TemplateSource/_Issues/topic26878/cache/.gitignore b/tests/UnitTests/TemplateSource/_Issues/topic26878/cache/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/topic26878/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/topic26878/templates_c/.gitignore b/tests/UnitTests/TemplateSource/_Issues/topic26878/templates_c/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/topic26878/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/TemplateSource/_Issues/topic26878/templates_tmp/.gitignore b/tests/UnitTests/TemplateSource/_Issues/topic26878/templates_tmp/.gitignore deleted file mode 100644 index d88cc144..00000000 --- a/tests/UnitTests/TemplateSource/_Issues/topic26878/templates_tmp/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/__shared/PHPunitplugins/block.dummyblock.php b/tests/UnitTests/__shared/PHPunitplugins/block.dummyblock.php deleted file mode 100644 index b20ca8ec..00000000 --- a/tests/UnitTests/__shared/PHPunitplugins/block.dummyblock.php +++ /dev/null @@ -1,23 +0,0 @@ -getAttributes($compiler, $args); - $output = ' $value) { - $output .= "'{$key}'=>\" . "; - $output .= is_string($value) ? "({$value})" : ("'" . var_export($value, true). "'"); - $output .= ' . ",'; - - } - - $output .= ")\";?>\n"; - return $output; - } -} diff --git a/tests/UnitTests/__shared/PHPunitplugins/function.checkconfigvar.php b/tests/UnitTests/__shared/PHPunitplugins/function.checkconfigvar.php deleted file mode 100644 index 94fcc2c9..00000000 --- a/tests/UnitTests/__shared/PHPunitplugins/function.checkconfigvar.php +++ /dev/null @@ -1,47 +0,0 @@ -getSource()->name}:\${$var} ="; - $output .= $ptr->hasConfigVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getConfigVariable($var), true)) : 'null'; - $ptr = $ptr->parent; - } elseif (in_array('data', $types) && !($ptr instanceof Template || $ptr instanceof \Smarty\Smarty)) { - $output .= "#data:\${$var} ="; - $output .= $ptr->hasConfigVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getConfigVariable($var), true)) : 'null'; - $ptr = $ptr->parent; - } else { - $ptr = null; - } - } - if (in_array('global', $types)) { - $output .= "#global:\${$var} ="; - $output .= $template->getSmarty()->hasConfigVariable($var) ? - preg_replace('/\s/', '', var_export($template->getSmarty()->getConfigVariable($var), true)) : 'null'; - } - return $output; -} diff --git a/tests/UnitTests/__shared/PHPunitplugins/function.checkvar.php b/tests/UnitTests/__shared/PHPunitplugins/function.checkvar.php deleted file mode 100644 index 71740902..00000000 --- a/tests/UnitTests/__shared/PHPunitplugins/function.checkvar.php +++ /dev/null @@ -1,47 +0,0 @@ -getSource()->name}:\${$var} ="; - $output .= $ptr->hasVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getValue($var), true)) : '>unassigned<'; - $ptr = $ptr->parent; - } elseif (in_array('data', $types) && !($ptr instanceof Template || $ptr instanceof \Smarty\Smarty)) { - $output .= "#data:\${$var} ="; - $output .= $ptr->hasVariable($var) ? preg_replace('/\s/', '', var_export($ptr->getValue($var), true)) : '>unassigned<'; - $ptr = $ptr->parent; - } else { - $ptr = null; - } - } - if (in_array('global', $types)) { - $output .= "#global:\${$var} ="; - $output .= $template->getSmarty()->hasVariable($var) ? - preg_replace('/\s/', '', var_export($template->getSmarty()->getValue($var), true)) : '>unassigned<'; - } - return $output; -} diff --git a/tests/UnitTests/__shared/PHPunitplugins/function.getparams.php b/tests/UnitTests/__shared/PHPunitplugins/function.getparams.php deleted file mode 100644 index 41075800..00000000 --- a/tests/UnitTests/__shared/PHPunitplugins/function.getparams.php +++ /dev/null @@ -1,22 +0,0 @@ -assign($params[ 'assign' ], $template->getTemplateVars($params[ 'var' ])); - } else { - return $template->getTemplateVars($params[ 'var' ]); - } -} diff --git a/tests/UnitTests/__shared/PHPunitplugins/function.pluginassign.php b/tests/UnitTests/__shared/PHPunitplugins/function.pluginassign.php deleted file mode 100644 index 7786b742..00000000 --- a/tests/UnitTests/__shared/PHPunitplugins/function.pluginassign.php +++ /dev/null @@ -1,21 +0,0 @@ -assign($params[ 'var' ], $params[ 'value' ]); - return ''; -} diff --git a/tests/UnitTests/__shared/cacheresources/cacheresource.memcache.php b/tests/UnitTests/__shared/cacheresources/cacheresource.memcache.php deleted file mode 100644 index bc212a82..00000000 --- a/tests/UnitTests/__shared/cacheresources/cacheresource.memcache.php +++ /dev/null @@ -1,101 +0,0 @@ -memcache === null) { - if (class_exists('Memcached')) { - $this->memcache = new Memcached(); - } else { - $this->memcache = new Memcache(); - } - $this->memcache->addServer('127.0.0.1', 11211); - } - return $this->memcache; - } - - /** - * Read values for a set of keys from cache - * - * @param array $keys list of keys to fetch - * - * @return array list of values with the given keys used as indexes - * @return boolean true on success, false on failure - */ - protected function read(array $keys) - { - $res = array(); - foreach ($keys as $key) { - $k = sha1($key); - $res[$key] = $this->getMemcache()->get($k); - } - return $res; - } - - /** - * Save values for a set of keys to cache - * - * @param array $keys list of values to save - * @param int $expire expiration time - * - * @return boolean true on success, false on failure - */ - protected function write(array $keys, $expire = null) - { - foreach ($keys as $k => $v) { - $k = sha1($k); - if (class_exists('Memcached')) { - $this->getMemcache()->set($k, $v, $expire); - } else { - $this->getMemcache()->set($k, $v, 0, $expire); - } - } - return true; - } - - /** - * Remove values from cache - * - * @param array $keys list of keys to delete - * - * @return boolean true on success, false on failure - */ - protected function delete(array $keys) - { - foreach ($keys as $k) { - $k = sha1($k); - $this->getMemcache()->delete($k); - } - return true; - } - - /** - * Remove *all* values from cache - * - * @return boolean true on success, false on failure - */ - protected function purge() - { - return $this->getMemcache()->flush(); - } -} diff --git a/tests/UnitTests/__shared/cacheresources/cacheresource.mysql.php b/tests/UnitTests/__shared/cacheresources/cacheresource.mysql.php deleted file mode 100644 index 9b51c272..00000000 --- a/tests/UnitTests/__shared/cacheresources/cacheresource.mysql.php +++ /dev/null @@ -1,190 +0,0 @@ -CREATE TABLE IF NOT EXISTS `output_cache` ( - * `id` CHAR(40) NOT NULL COMMENT 'sha1 hash', - * `name` VARCHAR(250) NOT NULL, - * `cache_id` VARCHAR(250) NULL DEFAULT NULL, - * `compile_id` VARCHAR(250) NULL DEFAULT NULL, - * `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - * `content` LONGTEXT NOT NULL, - * PRIMARY KEY (`id`), - * INDEX(`name`), - * INDEX(`cache_id`), - * INDEX(`compile_id`), - * INDEX(`modified`) - * ) ENGINE = InnoDB; - * - - * @author Rodney Rehm - */ -class Smarty_CacheResource_Mysql extends \Smarty\Cacheresource\Custom -{ - - /** - * @return PDO - * @throws Exception - */ - protected function db(): PDO { - static $dbConn = null; - try { - return $dbConn ?? ($dbConn = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty")); - } catch (PDOException $e) { - throw new Exception('Mysql Resource failed: ' . $e->getMessage()); - } - } - - /** - * @return false|PDOStatement - * @throws Exception - */ - protected function fetchQuery() { - static $query = null; - return $query ?? $query = $this->db()->prepare('SELECT modified, content FROM output_cache WHERE id = :id'); - } - - /** - * @return false|PDOStatement - * @throws Exception - */ - protected function fetchTimestampQuery() { - static $query = null; - return $query ?? $query = $this->db()->prepare('SELECT modified FROM output_cache WHERE id = :id'); - } - - /** - * @return false|PDOStatement - * @throws Exception - */ - protected function saveQuery() { - static $query = null; - return $query ?? $query = $this->db()->prepare( - 'REPLACE INTO output_cache (id, name, cache_id, compile_id, content) - VALUES (:id, :name, :cache_id, :compile_id, :content)' - ); - } - - /** - * fetch cached content and its modification time from data source - * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $content cached content - * @param integer $mtime cache modification timestamp (epoch) - * - * @return void - * @throws Exception - */ - protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime) - { - $this->fetchQuery()->execute(array('id' => $id)); - $row = $this->fetchQuery()->fetch(); - $this->fetchQuery()->closeCursor(); - if ($row) { - $content = $row[ 'content' ]; - $mtime = strtotime($row[ 'modified' ]); - } else { - $content = null; - $mtime = null; - } - } - - /** - * Fetch cached content's modification timestamp from data source - * - * @note implementing this method is optional. Only implement it if modification times can be accessed faster than - * loading the complete cached content. - * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * - * @return integer|boolean timestamp (epoch) the template was modified, or false if not found - */ - protected function fetchTimestamp($id, $name, $cache_id, $compile_id) - { - $this->fetchTimestampQuery()->execute(array('id' => $id)); - $mtime = strtotime($this->fetchTimestampQuery()->fetchColumn()); - $this->fetchTimestampQuery()->closeCursor(); - return $mtime; - } - - /** - * Save content to cache - * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration time in seconds or null - * @param string $content content to cache - * - * @return boolean success - */ - protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content) - { - $this->saveQuery()->execute( - array('id' => $id, - 'name' => $name, - 'cache_id' => $cache_id, - 'compile_id' => $compile_id, - 'content' => $content,) - ); - return !!$this->saveQuery()->rowCount(); - } - - /** - * Delete content from cache - * - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration or null - * - * @return integer number of deleted caches - */ - protected function delete($name, $cache_id, $compile_id, $exp_time) - { - // delete the whole cache - if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { - // returning the number of deleted caches would require a second query to count them - $query = $this->db()->query('TRUNCATE TABLE output_cache'); - return -1; - } - // build the filter - $where = array(); - // equal test name - if ($name !== null) { - $where[] = 'name = ' . $this->db()->quote($name); - } - // equal test compile_id - if ($compile_id !== null) { - $where[] = 'compile_id = ' . $this->db()->quote($compile_id); - } - // range test expiration time - if ($exp_time !== null) { - $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)'; - } - // equal test cache_id and match sub-groups - if ($cache_id !== null) { - $where[] = - '(cache_id = ' . - $this->db()->quote($cache_id) . - ' OR cache_id LIKE ' . - $this->db()->quote($cache_id . '|%') . - ')'; - } - // run delete query - $query = $this->db()->query('DELETE FROM output_cache WHERE ' . join(' AND ', $where)); - return $query->rowCount(); - } -} diff --git a/tests/UnitTests/__shared/cacheresources/cacheresource.pdo.php b/tests/UnitTests/__shared/cacheresources/cacheresource.pdo.php deleted file mode 100644 index 8be18ec9..00000000 --- a/tests/UnitTests/__shared/cacheresources/cacheresource.pdo.php +++ /dev/null @@ -1,347 +0,0 @@ -setCachingType('pdo'); - * $smarty->registerCacheResource('pdo', new Smarty_CacheResource_Pdo($cnx, 'smarty_cache')); - * - * @author Beno!t POLASZEK - 2014 - */ -class Smarty_CacheResource_Pdo extends \Smarty\Cacheresource\Custom -{ - /** - * @var string[] - */ - protected $fetchStatements = array('default' => 'SELECT %2$s - FROM %1$s - WHERE 1 - AND id = :id - AND cache_id IS NULL - AND compile_id IS NULL', - 'withCacheId' => 'SELECT %2$s - FROM %1$s - WHERE 1 - AND id = :id - AND cache_id = :cache_id - AND compile_id IS NULL', - 'withCompileId' => 'SELECT %2$s - FROM %1$s - WHERE 1 - AND id = :id - AND compile_id = :compile_id - AND cache_id IS NULL', - 'withCacheIdAndCompileId' => 'SELECT %2$s - FROM %1$s - WHERE 1 - AND id = :id - AND cache_id = :cache_id - AND compile_id = :compile_id'); - - /** - * @var string - */ - protected $insertStatement = 'INSERT INTO %s - - SET id = :id, - name = :name, - cache_id = :cache_id, - compile_id = :compile_id, - modified = CURRENT_TIMESTAMP, - expire = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :expire SECOND), - content = :content - - ON DUPLICATE KEY UPDATE - name = :name, - cache_id = :cache_id, - compile_id = :compile_id, - modified = CURRENT_TIMESTAMP, - expire = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :expire SECOND), - content = :content'; - - /** - * @var string - */ - protected $deleteStatement = 'DELETE FROM %1$s WHERE %2$s'; - - /** - * @var string - */ - protected $truncateStatement = 'TRUNCATE TABLE %s'; - - /** - * @var string - */ - protected $fetchColumns = 'modified, content'; - - /** - * @var string - */ - protected $fetchTimestampColumns = 'modified'; - - /** - * @var \PDO - */ - protected $pdo; - - /** - * @var - */ - protected $table; - - /** - * @var null - */ - protected $database; - - /** - * Constructor - * - * @param PDO $pdo PDO : active connection - * @param string $table : table (or view) name - * @param string $database : optional - if table is located in another db - * - * @throws \Smarty\Exception - */ - public function __construct(PDO $pdo, $table, $database = null) - { - if (is_null($table)) { - throw new Exception("Table name for caching can't be null"); - } - $this->pdo = $pdo; - $this->table = $table; - $this->database = $database; - $this->fillStatementsWithTableName(); - } - - /** - * Fills the table name into the statements. - * - * @return $this Current Instance - * @access protected - */ - protected function fillStatementsWithTableName() - { - foreach ($this->fetchStatements as &$statement) { - $statement = sprintf($statement, $this->getTableName(), '%s'); - } - $this->insertStatement = sprintf($this->insertStatement, $this->getTableName()); - $this->deleteStatement = sprintf($this->deleteStatement, $this->getTableName(), '%s'); - $this->truncateStatement = sprintf($this->truncateStatement, $this->getTableName()); - return $this; - } - - /** - * Gets the fetch statement, depending on what you specify - * - * @param string $columns : the column(s) name(s) you want to retrieve from the database - * @param string $id unique cache content identifier - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id - * - * @access protected - * @return \PDOStatement - */ - protected function getFetchStatement($columns, $id, $cache_id = null, $compile_id = null) - { - $args = array(); - if (!is_null($cache_id) && !is_null($compile_id)) { - $query = $this->fetchStatements[ 'withCacheIdAndCompileId' ] and - $args = array('id' => $id, 'cache_id' => $cache_id, 'compile_id' => $compile_id); - } elseif (is_null($cache_id) && !is_null($compile_id)) { - $query = $this->fetchStatements[ 'withCompileId' ] and - $args = array('id' => $id, 'compile_id' => $compile_id); - } elseif (!is_null($cache_id) && is_null($compile_id)) { - $query = $this->fetchStatements[ 'withCacheId' ] and $args = array('id' => $id, 'cache_id' => $cache_id); - } else { - $query = $this->fetchStatements[ 'default' ] and $args = array('id' => $id); - } - $query = sprintf($query, $columns); - $stmt = $this->pdo->prepare($query); - foreach ($args as $key => $value) { - $stmt->bindValue($key, $value); - } - return $stmt; - } - - /** - * fetch cached content and its modification time from data source - * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id - * @param string $content cached content - * @param integer $mtime cache modification timestamp (epoch) - * - * @return void - * @access protected - */ - protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime) - { - $stmt = $this->getFetchStatement($this->fetchColumns, $id, $cache_id, $compile_id); - $stmt->execute(); - $row = $stmt->fetch(); - $stmt->closeCursor(); - if ($row) { - $content = $this->outputContent($row[ 'content' ]); - $mtime = strtotime($row[ 'modified' ]); - } else { - $content = null; - $mtime = null; - } - } - - /** - * Fetch cached content's modification timestamp from data source - * {@internal implementing this method is optional. - * Only implement it if modification times can be accessed faster than loading the complete cached content.}} - * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id - * - * @return integer|boolean timestamp (epoch) the template was modified, or false if not found - * @access protected - */ - // protected function fetchTimestamp($id, $name, $cache_id = null, $compile_id = null) { - // $stmt = $this->getFetchStatement($this->fetchTimestampColumns, $id, $cache_id, $compile_id); - // $stmt -> execute(); - // $mtime = strtotime($stmt->fetchColumn()); - // $stmt -> closeCursor(); - // return $mtime; - // } - /** - * Save content to cache - * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id - * @param integer|null $exp_time seconds till expiration time in seconds or null - * @param string $content content to cache - * - * @return boolean success - * @access protected - */ - protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content) - { - $stmt = $this->pdo->prepare($this->insertStatement); - $stmt->bindValue('id', $id); - $stmt->bindValue('name', $name); - $stmt->bindValue('cache_id', $cache_id, (is_null($cache_id)) ? PDO::PARAM_NULL : PDO::PARAM_STR); - $stmt->bindValue('compile_id', $compile_id, (is_null($compile_id)) ? PDO::PARAM_NULL : PDO::PARAM_STR); - $stmt->bindValue('expire', (int)$exp_time, PDO::PARAM_INT); - $stmt->bindValue('content', $this->inputContent($content)); - $stmt->execute(); - return !!$stmt->rowCount(); - } - - /** - * Encodes the content before saving to database - * - * @param string $content - * - * @return string $content - * @access protected - */ - protected function inputContent($content) - { - return $content; - } - - /** - * Decodes the content before saving to database - * - * @param string $content - * - * @return string $content - * @access protected - */ - protected function outputContent($content) - { - return $content; - } - - /** - * Delete content from cache - * - * @param string|null $name template name - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id - * @param integer|null|-1 $exp_time seconds till expiration or null - * - * @return integer number of deleted caches - * @access protected - */ - protected function delete($name = null, $cache_id = null, $compile_id = null, $exp_time = null) - { - // delete the whole cache - if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { - // returning the number of deleted caches would require a second query to count them - $this->pdo->query($this->truncateStatement); - return -1; - } - // build the filter - $where = array(); - // equal test name - if ($name !== null) { - $where[] = 'name = ' . $this->pdo->quote($name); - } - // equal test cache_id and match sub-groups - if ($cache_id !== null) { - $where[] = - '(cache_id = ' . - $this->pdo->quote($cache_id) . - ' OR cache_id LIKE ' . - $this->pdo->quote($cache_id . '|%') . - ')'; - } - // equal test compile_id - if ($compile_id !== null) { - $where[] = 'compile_id = ' . $this->pdo->quote($compile_id); - } - // for clearing expired caches - if ($exp_time === \Smarty\Smarty::CLEAR_EXPIRED) { - $where[] = 'expire < CURRENT_TIMESTAMP'; - } // range test expiration time - elseif ($exp_time !== null) { - $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)'; - } - // run delete query - $query = $this->pdo->query(sprintf($this->deleteStatement, join(' AND ', $where))); - return $query->rowCount(); - } - - /** - * Gets the formatted table name - * - * @return string - * @access protected - */ - protected function getTableName() - { - return (is_null($this->database)) ? "`{$this->table}`" : "`{$this->database}`.`{$this->table}`"; - } -} diff --git a/tests/UnitTests/__shared/cacheresources/cacheresource.pdo_gzip.php b/tests/UnitTests/__shared/cacheresources/cacheresource.pdo_gzip.php deleted file mode 100644 index 89818abb..00000000 --- a/tests/UnitTests/__shared/cacheresources/cacheresource.pdo_gzip.php +++ /dev/null @@ -1,42 +0,0 @@ -setCachingType('pdo_gzip'); - * $smarty->registerCacheResource('pdo_gzip', new Smarty_CacheResource_Pdo_Gzip($cnx, 'smarty_cache')); - * - * @require Smarty_CacheResource_Pdo class - * @author Beno!t POLASZEK - 2014 - */ -class Smarty_CacheResource_Pdo_Gzip extends Smarty_CacheResource_Pdo -{ - /** - * Encodes the content before saving to database - * - * @param string $content - * - * @return string $content - * @access protected - */ - protected function inputContent($content) - { - return gzdeflate($content); - } - - /** - * Decodes the content before saving to database - * - * @param string $content - * - * @return string $content - * @access protected - */ - protected function outputContent($content) - { - return gzinflate($content); - } -} diff --git a/tests/UnitTests/__shared/resources/resource.extendsall.php b/tests/UnitTests/__shared/resources/resource.extendsall.php deleted file mode 100644 index 14d37908..00000000 --- a/tests/UnitTests/__shared/resources/resource.extendsall.php +++ /dev/null @@ -1,66 +0,0 @@ -getSmarty()->getTemplateDir() as $key => $directory) { - try { - $s = \Smarty\Template\Source::load(null, $source->getSmarty(), - 'file:' . '[' . $key . ']' . $source->name); - if (!$s->exists) { - continue; - } - $sources[ $s->uid ] = $s; - $uid .= $s->uid; - $timestamp = $s->timestamp > $timestamp ? $s->timestamp : $timestamp; - } catch (Exception $e) { - } - } - if (!$sources) { - $source->exists = false; - return; - } - $sources = array_reverse($sources, true); - reset($sources); - $s = current($sources); - $source->components = $sources; - $source->uid = sha1($uid . $source->getSmarty()->_joined_template_dir); - $source->exists = true; - $source->timestamp = $timestamp; - } - - /** - * Disable timestamp checks for extendsall resource. - * The individual source components will be checked. - * - * @return bool false - */ - public function checkTimestamps() - { - return false; - } -} diff --git a/tests/UnitTests/__shared/templates/run_code.tpl b/tests/UnitTests/__shared/templates/run_code.tpl deleted file mode 100644 index f2db3620..00000000 --- a/tests/UnitTests/__shared/templates/run_code.tpl +++ /dev/null @@ -1 +0,0 @@ -{include $file} \ No newline at end of file diff --git a/tests/UnitTests/__shared/templates/run_code_caching.tpl b/tests/UnitTests/__shared/templates/run_code_caching.tpl deleted file mode 100644 index 421be584..00000000 --- a/tests/UnitTests/__shared/templates/run_code_caching.tpl +++ /dev/null @@ -1 +0,0 @@ -{include $file caching} \ No newline at end of file diff --git a/tests/UnitTests/__shared/templates/scope_include.tpl b/tests/UnitTests/__shared/templates/scope_include.tpl deleted file mode 100644 index bfb1e6cb..00000000 --- a/tests/UnitTests/__shared/templates/scope_include.tpl +++ /dev/null @@ -1 +0,0 @@ -{include $file} diff --git a/tests/UnitTests/__shared/templates/scope_tag.tpl b/tests/UnitTests/__shared/templates/scope_tag.tpl deleted file mode 100644 index 734ebb7b..00000000 --- a/tests/UnitTests/__shared/templates/scope_tag.tpl +++ /dev/null @@ -1 +0,0 @@ -{include 'scope_include.tpl'} \ No newline at end of file diff --git a/tests/cache/.gitignore b/tests/cache/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file diff --git a/tests/templates_c/.gitignore b/tests/templates_c/.gitignore deleted file mode 100644 index 1d34e205..00000000 --- a/tests/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* \ No newline at end of file -- cgit v1.3 From 3577fc7091f1beab0dddd881cb08fc24a2a3f741 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 13 Apr 2026 22:31:06 +0200 Subject: Re-activate unit tests for user literals. --- TODO.txt | 1 - changelog/userliterals.md | 1 + tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php | 6 +----- 3 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 changelog/userliterals.md diff --git a/TODO.txt b/TODO.txt index aabbf654..d3e6a394 100644 --- a/TODO.txt +++ b/TODO.txt @@ -29,4 +29,3 @@ ## Unrelated / other - review (and avoid) use of 'clone' keyword -- what is 'user literal support', why are unit tests skipped? diff --git a/changelog/userliterals.md b/changelog/userliterals.md new file mode 100644 index 00000000..defc176e --- /dev/null +++ b/changelog/userliterals.md @@ -0,0 +1 @@ +- Re-activated unit tests for user literals, which were previously disabled due to a bug in refactoring to v5. \ No newline at end of file diff --git a/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php b/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php index 23e0ed0c..70873a89 100644 --- a/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php +++ b/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php @@ -17,11 +17,7 @@ class UserliteralTest extends PHPUnit_Smarty { public function setUp(): void { - if (!property_exists('Smarty', 'literals')) { - $this->markTestSkipped('user literal support'); - } else { - $this->setUpSmarty(__DIR__); - } + $this->setUpSmarty(__DIR__); } -- cgit v1.3 From 6e648ed80922ff38fd9175c7cde2771034cf77cd Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Sun, 3 May 2026 22:19:50 +0200 Subject: Remove incomplete test cases for usesCompiler across multiple test files --- phpunit.xml | 1 - .../ResourceTests/Eval/EvalResourceTest.php | 9 --- .../ResourceTests/File/FileResourceTest.php | 6 -- .../ResourceTests/Stream/StreamResourceTest.php | 9 --- .../ResourceTests/String/StringResourceTest.php | 9 --- .../RegisterModifierFirstClassCallablesTest.php | 74 +++++++++++----------- 6 files changed, 38 insertions(+), 70 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 4bdff288..435fdd7e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -20,7 +20,6 @@ ./tests/UnitTests/ ./tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php - ./tests/UnitTests/CacheResourceTests/Apc/CacheResourceCustomApcTest.php ./tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php diff --git a/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php b/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php index faea5d2d..a52ac764 100644 --- a/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php +++ b/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php @@ -65,15 +65,6 @@ class EvalResourceTest extends PHPUnit_Smarty $this->assertEquals('', $this->smarty->fetch($tpl)); } - /** - * test usesCompiler - */ - public function testUsesCompiler() - { - $tpl = $this->smarty->createTemplate('eval:hello world'); - $this->markTestIncomplete(); - } - /** * test isEvaluated */ diff --git a/tests/UnitTests/ResourceTests/File/FileResourceTest.php b/tests/UnitTests/ResourceTests/File/FileResourceTest.php index acf522d2..68602827 100644 --- a/tests/UnitTests/ResourceTests/File/FileResourceTest.php +++ b/tests/UnitTests/ResourceTests/File/FileResourceTest.php @@ -86,12 +86,6 @@ class FileResourceTest extends PHPUnit_Smarty $this->assertEquals('hello world', $tpl->getSource()->getContent()); } - public function testUsesCompiler() - { - $tpl = $this->smarty->createTemplate('helloworld.tpl'); - $this->markTestIncomplete(); - } - public function testIsEvaluated() { $tpl = $this->smarty->createTemplate('helloworld.tpl'); diff --git a/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php b/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php index dbb14285..c6caf4b5 100644 --- a/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php +++ b/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php @@ -60,15 +60,6 @@ class StreamResourceTest extends PHPUnit_Smarty $this->assertEquals('hello world {$foo}', $tpl->getSource()->getContent()); } - /** - * test usesCompiler - */ - public function testUsesCompiler() - { - $tpl = $this->smarty->createTemplate('global:mytest'); - $this->markTestIncomplete(); - } - /** * test isEvaluated */ diff --git a/tests/UnitTests/ResourceTests/String/StringResourceTest.php b/tests/UnitTests/ResourceTests/String/StringResourceTest.php index 16a9c88b..da047c02 100644 --- a/tests/UnitTests/ResourceTests/String/StringResourceTest.php +++ b/tests/UnitTests/ResourceTests/String/StringResourceTest.php @@ -73,15 +73,6 @@ class StringResourceTest extends PHPUnit_Smarty $this->assertEquals('hello world{$foo}', $tpl->getSource()->getContent()); } - /** - * test usesCompiler - */ - public function testUsesCompiler() - { - $tpl = $this->smarty->createTemplate('string:hello world'); - $this->markTestIncomplete(); - } - /** * test isEvaluated */ diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierFirstClassCallablesTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierFirstClassCallablesTest.php index 50fdb9a0..fc99ca7f 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierFirstClassCallablesTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierFirstClassCallablesTest.php @@ -1,50 +1,52 @@ = 80100) { - - /** - * class for register modifier with (first class) callables tests - * - * @runTestsInSeparateProcess - * @preserveGlobalState disabled - * @backupStaticAttributes enabled - */ - class RegisterModifierFirstClassCallablesTest extends PHPUnit_Smarty + +/** + * class for register modifier with (first class) callables tests + * + * @runTestsInSeparateProcess + * @preserveGlobalState disabled + * @backupStaticAttributes enabled + */ +class RegisterModifierFirstClassCallablesTest extends PHPUnit_Smarty +{ + public function setUp(): void { - public function setUp(): void - { - $this->setUpSmarty(__DIR__); + // First-class callable syntax (Closure::fromCallable shorthand) requires PHP 8.1+ + if (PHP_VERSION_ID < 80100) { + $this->markTestSkipped('First-class callables require PHP >= 8.1'); } + $this->setUpSmarty(__DIR__); + } - public function testRegisterFirstClassCallable() - { - $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'testmodifier', eval('return strrev(...);')); - $this->assertEquals('mosredna', $this->smarty->fetch('string:{"andersom"|testmodifier}')); - } - - public function testRegisterFirstClassCallableSameName() - { - $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'mymodifier', eval('return strrev(...);')); - $this->assertEquals('mosredna', $this->smarty->fetch('string:{"andersom"|mymodifier}')); - } + public function testRegisterFirstClassCallable() + { + $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'testmodifier', eval('return strrev(...);')); + $this->assertEquals('mosredna', $this->smarty->fetch('string:{"andersom"|testmodifier}')); + } - public function testRegisterFirstClassCallableAsFunc() - { - $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'kprint_r_out', eval('return strrev(...);')); - $this->smarty->assign('myVar', 'andersom'); - $this->assertEquals('mosredna', $this->smarty->fetch('string:{kprint_r_out($myVar)}')); - } + public function testRegisterFirstClassCallableSameName() + { + $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'mymodifier', eval('return strrev(...);')); + $this->assertEquals('mosredna', $this->smarty->fetch('string:{"andersom"|mymodifier}')); + } - public function testRegisterFirstClassCallableSameNameAsPhpFunc() - { - $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'mymodifierfcc', eval('return strrev(...);')); - $this->assertEquals('mosredna', $this->smarty->fetch('string:{mymodifierfcc("andersom")}')); - } + public function testRegisterFirstClassCallableAsFunc() + { + $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'kprint_r_out', eval('return strrev(...);')); + $this->smarty->assign('myVar', 'andersom'); + $this->assertEquals('mosredna', $this->smarty->fetch('string:{kprint_r_out($myVar)}')); + } + public function testRegisterFirstClassCallableSameNameAsPhpFunc() + { + $this->smarty->registerPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, 'mymodifierfcc', eval('return strrev(...);')); + $this->assertEquals('mosredna', $this->smarty->fetch('string:{mymodifierfcc("andersom")}')); } + } + function mymodifierfcc($a, $b, $c) { return "$a function $b $c"; -- cgit v1.3 From c139883770b12f92c9b21f69c35ad600d34f39e8 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Sun, 3 May 2026 22:19:59 +0200 Subject: update todos --- TODO.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TODO.txt b/TODO.txt index d3e6a394..b5be3d24 100644 --- a/TODO.txt +++ b/TODO.txt @@ -11,10 +11,10 @@ ## include inline - Re-introduce merge_compiled_includes and the {include inline} attribute? -## Output buffering -- Fix ob_ output buffering commands being scattered around the codebase +## Output buffering (major) +- Fix ob_ output buffering commands being scattered around the codebase: Smarty's output model is fundamentally "echo everything, wrap in a buffer to capture". An alternative that would be where rendering returns a string rather than echoing — but that touches the entire compiled template format (the unifunc functions all echo) and is a large change. -## Review public static vars +## Review public static vars (major) - such as _CHARSET and _IS_WINDOWS ## Block / inheritance @@ -24,7 +24,7 @@ ## Plugin system - fix template security checks in one place in compiler -## Beatify output +## Beatify output (major) - compiled templates could be proper classes, possibly using [nette/php-generator](https://packagist.org/packages/nette/php-generator) ## Unrelated / other -- cgit v1.3