From e71481a2cef2ce1f5870d9e09c23af872c27ef4e Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Thu, 7 Jan 2021 00:19:13 +0100 Subject: [PATCH] Dropped suppport for php<7.2 to enable unit testing for php8, using phpunit8. Updated unit tests for compatability with phpunit8. --- .travis.yml | 9 - CHANGELOG.md | 2 + composer.json | 4 +- phpunit.xml | 15 +- tests/PHPUnit_Smarty.php | 6 +- .../PathNormalizationTest.php | 2 +- .../PluginDirNormalizationTest.php | 2 +- .../TemlateDirNormalizationTest.php | 2 +- .../ProtectedFolderVarsTest.php | 2 +- .../UndefinedTemplateVarTest.php | 2 +- .../A_Core/AutoEscape/AutoEscapeTest.php | 2 +- tests/UnitTests/A_Core/Filter/FilterTest.php | 2 +- .../A_Core/Filter/LoadFilterTest.php | 2 +- .../A_Core/Filter/RegisterFilterTest.php | 2 +- .../A_Core/GetterSetter/GetterSetterTest.php | 2 +- .../LoadPlugin/DefaultPluginHandlerTest.php | 2 +- .../A_Core/LoadPlugin/IncludePathTest.php | 10 +- .../A_Core/LoadPlugin/LoadPluginTest.php | 2 +- .../MuteExpectedErrorsTest.php | 2 +- .../PluginTests/PluginChainedLoadTest.php | 4 +- .../Shared/SharedFunctionsTest.php | 2 +- .../A_Core/SmartyBC/SmartyBcTest.php | 2 +- .../ModifiedSince/HttpModifiedSinceTest.php | 2 +- .../File/CacheResourceFileTest.php | 2 +- .../CacheResourceCustomMemcacheTest.php | 2 +- .../_shared/CacheResourceTestCommon.php | 4 +- .../CompileCompilerPluginTest.php | 2 +- .../Compiler/Delimiter/AutoLiteralTest.php | 2 +- .../Compiler/Delimiter/DelimiterTest.php | 2 +- .../Compiler/Delimiter/UserLiteralTest.php | 2 +- .../DefaultConfigHandlerTest.php | 37 +-- .../ConfigFileTests/file/ConfigVarTest.php | 2 +- .../Ambiguous/CustomResourceAmbiguousTest.php | 2 +- .../ResourceExtendsAllPluginTest.php | 2 +- .../ResourceMysqlPluginTest.php | 4 +- .../DefaultTemplateHandlerTest.php | 10 +- .../ResourceTests/Eval/EvalResourceTest.php | 2 +- .../Extends/ExtendsResourceTest.php | 46 ++-- .../ResourceTests/File/FileResourceTest.php | 29 ++- .../FileIncludePath/FileIncludePathTest.php | 16 +- .../FileIndexed/FileResourceIndexedTest.php | 2 +- .../ResourceTests/Php/PhpResourceTest.php | 12 +- .../Registered/RegisteredResourceTest.php | 2 +- .../ResourcePlugins/ResourcePluginTest.php | 2 +- .../Stream/StreamResourceTest.php | 10 +- .../String/StringResourceTest.php | 2 +- .../UnitTests/SecurityTests/FunctionTest.php | 4 +- .../UnitTests/SecurityTests/SecurityTest.php | 56 ++--- .../SmartyMethodsTests/Append/AppendTest.php | 2 +- .../AppendByRef/AppendByRefBCTest.php | 2 +- .../AppendByRef/AppendByRefTest.php | 2 +- .../SmartyMethodsTests/Assign/AssignTest.php | 2 +- .../AssignByRef/AssignByRefBCTest.php | 2 +- .../AssignByRef/AssignByRefTest.php | 2 +- .../AssignGlobal/AssignGlobalTest.php | 2 +- .../ClearAllAssign/ClearAllAssignBCTest.php | 2 +- .../ClearAllAssign/ClearAllAssignTest.php | 2 +- .../ClearAssign/ClearAssignBCTest.php | 2 +- .../ClearAssign/ClearAssignTest.php | 2 +- .../ClearCompiledBCTest.php | 2 +- .../ClearCompiledTest.php | 2 +- .../GetTemplateVars/GetTemplateVarsBCTest.php | 2 +- .../GetTemplateVars/GetTemplateVarsTest.php | 2 +- .../RegisterBlock/RegisterBlockTest.php | 2 +- .../RegisterCompilerFunctionBCTest.php | 2 +- .../RegisterCompilerFunctionTest.php | 2 +- .../RegisterFunctionBCTest.php | 2 +- .../RegisterFunction/RegisterFunctionTest.php | 2 +- .../RegisterModifier/RegisterModifierTest.php | 2 +- .../CompileRegisteredObjectFunctionTest.php | 2 +- .../TemplateExist/TemplateExistsTest.php | 2 +- .../TemplateSource/Comments/CommentsTest.php | 2 +- .../TemplateSource/Spacing/SpacingTest.php | 2 +- .../StaticClass/StaticClassAccessTest.php | 2 +- .../TagTests/Append/CompileAppendTest.php | 2 +- .../TagTests/Assign/CompileAssignTest.php | 2 +- .../BlockPlugin/CompileBlockPluginTest.php | 31 ++- .../BockExtend/CompileBlockExtendsTest.php | 220 +++++++++--------- .../TagTests/Capture/CompileCaptureTest.php | 14 +- .../CompilerPlugin/CompilerPluginTest.php | 2 +- .../ConfigLoad/CompileConfigLoadTest.php | 6 +- .../Delimiter/CompileDelimiterTest.php | 8 +- .../TagTests/Eval/CompileEvalTest.php | 2 +- .../TagTests/For/CompileForTest.php | 2 +- .../TagTests/Foreach/CompileForeachTest.php | 2 +- .../CompileFunctionPluginTest.php | 2 +- .../TagTests/If/CompileIfTest.php | 2 +- .../TagTests/Include/CompileIncludeTest.php | 6 +- .../IncludePhp/CompileIncludePhpTest.php | 10 +- .../TagTests/Insert/CompileInsertTest.php | 12 +- .../TagTests/Literal/LiteralTest.php | 2 +- .../MakeNocache/CompileMakeNocacheTest.php | 2 +- .../TagTests/Nocache/CompileNocacheTest.php | 18 +- .../TagTests/Php/CompilePhpTest.php | 15 +- .../PluginBlock/PluginBlockTextformatTest.php | 2 +- .../PluginFunctionFetchTest.php | 24 +- .../PluginFunctionHtmlCheckboxesTest.php | 2 +- .../PluginFunctionHtmlImageTest.php | 2 +- .../PluginFunctionHtmlOptionsTest.php | 2 +- .../PluginFunctionHtmlRadiosTest.php | 2 +- .../PluginFunctionHtmlSelectDateTest.php | 2 +- .../PluginFunctionHtmlSelectTimeTest.php | 2 +- .../PluginFunctionMailtoTest.php | 2 +- .../PluginModifierCapitalizeTest.php | 2 +- .../PluginModifierCharsetTest.php | 2 +- .../PluginModifierCountCharactersTest.php | 2 +- .../PluginModifierCountSentencesTest.php | 2 +- .../PluginModifierCountWordsTest.php | 2 +- .../PluginModifierEscapeTest.php | 2 +- .../PluginModifierLowerTest.php | 2 +- .../PluginModifierRegexReplaceTest.php | 2 +- .../PluginModifierSpacifyTest.php | 2 +- .../PluginModifierStripTest.php | 2 +- .../PluginModifierTruncateTest.php | 2 +- .../PluginModifierUnescapeTest.php | 2 +- .../PluginModifierUpperTest.php | 2 +- .../PluginModifierWordwrapTest.php | 2 +- .../TagTests/Section/CompileSectionTest.php | 2 +- .../SetFilter/CompileSetfilterTest.php | 2 +- .../TagTests/Strip/CompileStripTest.php | 2 +- .../TemplateFunction/CompileFunctionTest.php | 16 +- .../TagTests/While/CompileWhileTest.php | 2 +- .../TagTests/_Attributes/AttributeTest.php | 20 +- .../TagTests/_Error/CompileErrorTest.php | 18 +- .../TagTests/_Print/PrintTest.php | 2 +- .../TagTests/break/CompileBreakTest.php | 2 +- .../ValueTests/Array/ArrayTest.php | 2 +- .../ValueTests/BoolenNull/BooleanNullTest.php | 2 +- .../ConstantTests/ConstantsTest.php | 2 +- .../DoubleQuoted/DoubleQuotedStringTest.php | 8 +- .../ValueTests/Math/MathTest.php | 2 +- .../ValueTests/Modifier/ModifierTest.php | 6 +- .../ValueTests/Objects/ObjectVariableTest.php | 2 +- .../PHPfunctions/PhpFunctionTest.php | 2 +- .../SingleQouted/SingleQuotedStringTest.php | 2 +- .../Constant/SmartyConstantTest.php | 2 +- .../SmartySpecialVars/Cookie/CookieTest.php | 2 +- .../Delimiter/SmartyDelimiterTest.php | 2 +- .../Error/SmartyErrorTest.php | 7 +- .../SmartySpecialVars/Now/SmartyNowTest.php | 2 +- .../SmartySpecialVars/Post/PostTest.php | 2 +- .../SmartyTemplateObjectTest.php | 2 +- .../Version/SmartyVersionTest.php | 2 +- .../Variables/Stream/StreamVariableTest.php | 4 +- .../VariableVariable/VariableVariableTest.php | 2 +- .../TemplateSource/X_Scopes/ScopeTest.php | 2 +- .../UnitTests/TemplateSource/Xml/XmlTest.php | 2 +- .../_Issues/327/ModifierIssue327Test.php | 2 +- .../_Issues/419/ExtendsIssue419Test.php | 2 +- .../_Issues/422/NestedLoopIssue422Test.php | 2 +- ...ctionPropertiesShortSyntaxIssue428Test.php | 2 +- .../_Issues/topic26878/NewlineSpacing.php | 2 +- 152 files changed, 447 insertions(+), 506 deletions(-) diff --git a/.travis.yml b/.travis.yml index b5c23a2e..c41fda22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,15 +7,6 @@ install: jobs: include: - - php: 5.3 # Composer and PHPUnit require PHP 5.3.2+ to run, so we cannot test below 5.3 - dist: precise # PHP 5.3 is supported only on Precise. - - php: 5.4 - dist: trusty # PHP 5.4 is supported only on Trusty. - - php: 5.5 - dist: trusty # PHP 5.5 is supported only on Trusty. - - php: 5.6 - - php: 7.0 - - php: 7.1 - php: 7.2 - php: 7.3 - php: 7.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 27702e35..ccb2c400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed +- Dropped support for PHP versions lower than PHP7.1 (and disabled unit tests for 7.1) - Changed error handlers and handling of undefined constants for php8-compatibility (set $errcontext argument optional) https://github.com/smarty-php/smarty/issues/605 - Changed expected error levels in unit tests for php8-compatibility - Travis unit tests now run for all php versions >= 5.3, including php8 - Travis runs on Xenial where possible + ### Fixed - PHP5.3 compatibility fixes diff --git a/composer.json b/composer.json index fef6ae6d..e3f0bb53 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "forum": "http://www.smarty.net/forums/" }, "require": { - "php": ">=5.2" + "php": ">=7.1" }, "autoload": { "classmap": [ @@ -40,7 +40,7 @@ } }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^8.5 || ^7.5 || ^6.5 || ^5.7 || ^4.8", + "phpunit/phpunit": "^8.5", "smarty/smarty-lexer": "^3.1" } } diff --git a/phpunit.xml b/phpunit.xml index e372eb80..efd5d902 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,6 @@ backupGlobals="false" backupStaticAttributes="true" forceCoversAnnotation="false" - mapTestClassNameToCoveredClassName="false" processIsolation="false" stopOnError="false" stopOnFailure="false" @@ -17,18 +16,7 @@ timeoutForMediumTests="10" timeoutForLargeTests="60" verbose="false"> - - - - - tests/UnitTests - - - - tests - tests/cache - tests/templates_c - + libs libs/plugins @@ -39,5 +27,4 @@ - diff --git a/tests/PHPUnit_Smarty.php b/tests/PHPUnit_Smarty.php index 6edcff18..53cc507b 100644 --- a/tests/PHPUnit_Smarty.php +++ b/tests/PHPUnit_Smarty.php @@ -86,7 +86,7 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase * This method is called before the first test of this test class is run. * */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { error_reporting(E_ALL & ~E_STRICT); self::$init = true; @@ -97,7 +97,7 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase * This method is called after the last test of this test class is run. * */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { //self::$pdo = null; self::$testNumber = 0; @@ -676,7 +676,7 @@ KEY `name` (`name`) * This method is called after a test is executed. * */ - protected function tearDown() + protected function tearDown(): void { if (class_exists('Smarty_Internal_TemplateCompilerBase') && isset(Smarty_Internal_TemplateCompilerBase::$_tag_objects) diff --git a/tests/UnitTests/A_0/PathNormalization/PathNormalizationTest.php b/tests/UnitTests/A_0/PathNormalization/PathNormalizationTest.php index ce4cdd91..fdba81b9 100644 --- a/tests/UnitTests/A_0/PathNormalization/PathNormalizationTest.php +++ b/tests/UnitTests/A_0/PathNormalization/PathNormalizationTest.php @@ -15,7 +15,7 @@ class PathNormalizationTest extends PHPUnit_Smarty /* * Setup test fixture */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_0/PathNormalization/PluginDirNormalizationTest.php b/tests/UnitTests/A_0/PathNormalization/PluginDirNormalizationTest.php index 737ff4eb..81e51730 100644 --- a/tests/UnitTests/A_0/PathNormalization/PluginDirNormalizationTest.php +++ b/tests/UnitTests/A_0/PathNormalization/PluginDirNormalizationTest.php @@ -15,7 +15,7 @@ class PluginNormalizationTest extends PHPUnit_Smarty /* * Setup test fixture */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_0/PathNormalization/TemlateDirNormalizationTest.php b/tests/UnitTests/A_0/PathNormalization/TemlateDirNormalizationTest.php index 3ee101b1..e8107f3e 100644 --- a/tests/UnitTests/A_0/PathNormalization/TemlateDirNormalizationTest.php +++ b/tests/UnitTests/A_0/PathNormalization/TemlateDirNormalizationTest.php @@ -15,7 +15,7 @@ class TemplateNormalizationTest extends PHPUnit_Smarty /* * Setup test fixture */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_1/ProtectedFolderVars/ProtectedFolderVarsTest.php b/tests/UnitTests/A_1/ProtectedFolderVars/ProtectedFolderVarsTest.php index a51757ae..0b2c4aa2 100644 --- a/tests/UnitTests/A_1/ProtectedFolderVars/ProtectedFolderVarsTest.php +++ b/tests/UnitTests/A_1/ProtectedFolderVars/ProtectedFolderVarsTest.php @@ -15,7 +15,7 @@ class ProtectedFolderVarsTest extends PHPUnit_Smarty /* * Setup test fixture */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php index 289e73e6..b7aaf43c 100644 --- a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php +++ b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php @@ -13,7 +13,7 @@ class UndefinedTemplateVarTest extends PHPUnit_Smarty /* * Setup test fixture */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); error_reporting(E_ALL | E_STRICT); diff --git a/tests/UnitTests/A_Core/AutoEscape/AutoEscapeTest.php b/tests/UnitTests/A_Core/AutoEscape/AutoEscapeTest.php index 733c7226..e1d73628 100644 --- a/tests/UnitTests/A_Core/AutoEscape/AutoEscapeTest.php +++ b/tests/UnitTests/A_Core/AutoEscape/AutoEscapeTest.php @@ -15,7 +15,7 @@ class AutoEscapeTest extends PHPUnit_Smarty /* * Setup test fixture */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->setEscapeHtml(true); diff --git a/tests/UnitTests/A_Core/Filter/FilterTest.php b/tests/UnitTests/A_Core/Filter/FilterTest.php index e3847be1..b389bc80 100644 --- a/tests/UnitTests/A_Core/Filter/FilterTest.php +++ b/tests/UnitTests/A_Core/Filter/FilterTest.php @@ -17,7 +17,7 @@ class FilterTest extends PHPUnit_Smarty { public $loadSmartyBC = true; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_Core/Filter/LoadFilterTest.php b/tests/UnitTests/A_Core/Filter/LoadFilterTest.php index f99719ab..27ef30b2 100644 --- a/tests/UnitTests/A_Core/Filter/LoadFilterTest.php +++ b/tests/UnitTests/A_Core/Filter/LoadFilterTest.php @@ -15,7 +15,7 @@ */ class LoadFilterTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_Core/Filter/RegisterFilterTest.php b/tests/UnitTests/A_Core/Filter/RegisterFilterTest.php index 9bd0f0e3..9c9733c1 100644 --- a/tests/UnitTests/A_Core/Filter/RegisterFilterTest.php +++ b/tests/UnitTests/A_Core/Filter/RegisterFilterTest.php @@ -15,7 +15,7 @@ */ class RegisterFilterTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_Core/GetterSetter/GetterSetterTest.php b/tests/UnitTests/A_Core/GetterSetter/GetterSetterTest.php index e2d46fcf..3610b3e9 100644 --- a/tests/UnitTests/A_Core/GetterSetter/GetterSetterTest.php +++ b/tests/UnitTests/A_Core/GetterSetter/GetterSetterTest.php @@ -15,7 +15,7 @@ */ class GetterSetterTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_Core/LoadPlugin/DefaultPluginHandlerTest.php b/tests/UnitTests/A_Core/LoadPlugin/DefaultPluginHandlerTest.php index aa1764f3..2205a746 100644 --- a/tests/UnitTests/A_Core/LoadPlugin/DefaultPluginHandlerTest.php +++ b/tests/UnitTests/A_Core/LoadPlugin/DefaultPluginHandlerTest.php @@ -15,7 +15,7 @@ */ class DefaultPluginHandlerTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->setForceCompile(true); diff --git a/tests/UnitTests/A_Core/LoadPlugin/IncludePathTest.php b/tests/UnitTests/A_Core/LoadPlugin/IncludePathTest.php index 2a3b46b7..100bc877 100644 --- a/tests/UnitTests/A_Core/LoadPlugin/IncludePathTest.php +++ b/tests/UnitTests/A_Core/LoadPlugin/IncludePathTest.php @@ -11,7 +11,7 @@ */ class IncludePathTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->use_include_path = true; @@ -26,7 +26,7 @@ class IncludePathTest extends PHPUnit_Smarty * This method is called after a test is executed. * */ - protected function tearDown() + protected function tearDown(): void { ini_restore('include_path'); $this->smarty->disableSecurity(); @@ -38,14 +38,14 @@ class IncludePathTest extends PHPUnit_Smarty } public function testInclude1() { - $this->assertContains('plugin1', $this->smarty->fetch('test_include_path1.tpl')); + $this->assertStringContainsString('plugin1', $this->smarty->fetch('test_include_path1.tpl')); } public function testInclude2() { - $this->assertContains('plugin2', $this->smarty->fetch('test_include_path2.tpl')); + $this->assertStringContainsString('plugin2', $this->smarty->fetch('test_include_path2.tpl')); } public function testInclude3() { - $this->assertContains('plugin3', $this->smarty->fetch('test_include_path3.tpl')); + $this->assertStringContainsString('plugin3', $this->smarty->fetch('test_include_path3.tpl')); } } diff --git a/tests/UnitTests/A_Core/LoadPlugin/LoadPluginTest.php b/tests/UnitTests/A_Core/LoadPlugin/LoadPluginTest.php index 0b9a918a..cf7756a6 100644 --- a/tests/UnitTests/A_Core/LoadPlugin/LoadPluginTest.php +++ b/tests/UnitTests/A_Core/LoadPlugin/LoadPluginTest.php @@ -15,7 +15,7 @@ */ class LoadPluginTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_Core/MuteExpectedErrors/MuteExpectedErrorsTest.php b/tests/UnitTests/A_Core/MuteExpectedErrors/MuteExpectedErrorsTest.php index 6fbb53c1..40bc4392 100644 --- a/tests/UnitTests/A_Core/MuteExpectedErrors/MuteExpectedErrorsTest.php +++ b/tests/UnitTests/A_Core/MuteExpectedErrors/MuteExpectedErrorsTest.php @@ -17,7 +17,7 @@ class MuteExpectedErrorsTest extends PHPUnit_Smarty { protected $_errors = array(); - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_Core/PluginTests/PluginChainedLoadTest.php b/tests/UnitTests/A_Core/PluginTests/PluginChainedLoadTest.php index d0f68809..e2c171f8 100644 --- a/tests/UnitTests/A_Core/PluginTests/PluginChainedLoadTest.php +++ b/tests/UnitTests/A_Core/PluginTests/PluginChainedLoadTest.php @@ -15,7 +15,7 @@ */ class PluginChainedLoadTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -28,6 +28,6 @@ class PluginChainedLoadTest extends PHPUnit_Smarty public function testPluginChainedLoad() { $this->smarty->addPluginsDir(dirname(__FILE__) . "/PHPunitplugins/"); - $this->assertContains('from chain3', $this->smarty->fetch('test_plugin_chained_load.tpl')); + $this->assertStringContainsString('from chain3', $this->smarty->fetch('test_plugin_chained_load.tpl')); } } diff --git a/tests/UnitTests/A_Core/PluginTests/Shared/SharedFunctionsTest.php b/tests/UnitTests/A_Core/PluginTests/Shared/SharedFunctionsTest.php index 2ecafd32..2fb82d43 100644 --- a/tests/UnitTests/A_Core/PluginTests/Shared/SharedFunctionsTest.php +++ b/tests/UnitTests/A_Core/PluginTests/Shared/SharedFunctionsTest.php @@ -11,7 +11,7 @@ */ class SharedFunctionsTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/A_Core/SmartyBC/SmartyBcTest.php b/tests/UnitTests/A_Core/SmartyBC/SmartyBcTest.php index 988d1a4a..45ddf24b 100644 --- a/tests/UnitTests/A_Core/SmartyBC/SmartyBcTest.php +++ b/tests/UnitTests/A_Core/SmartyBC/SmartyBcTest.php @@ -17,7 +17,7 @@ class SmartyBcTest extends PHPUnit_Smarty { public $loadSmartyBC = true; public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php b/tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php index d59577c5..e666f3a9 100644 --- a/tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php +++ b/tests/UnitTests/CacheModify/ModifiedSince/HttpModifiedSinceTest.php @@ -16,7 +16,7 @@ class HttpModifiedSinceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->markTestSkipped('modified since tests are disabled'); $this->setUpSmarty(dirname(__FILE__)); diff --git a/tests/UnitTests/CacheResourceTests/File/CacheResourceFileTest.php b/tests/UnitTests/CacheResourceTests/File/CacheResourceFileTest.php index dda616a8..383aa20f 100644 --- a/tests/UnitTests/CacheResourceTests/File/CacheResourceFileTest.php +++ b/tests/UnitTests/CacheResourceTests/File/CacheResourceFileTest.php @@ -18,7 +18,7 @@ include_once dirname(__FILE__) . '/../_shared/CacheResourceTestCommon.php'; class CacheResourceFileTest extends CacheResourceTestCommon { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); parent::setUp(); diff --git a/tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php b/tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php index d8d9df1b..b1f489bf 100644 --- a/tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php +++ b/tests/UnitTests/CacheResourceTests/Memcache/CacheResourceCustomMemcacheTest.php @@ -22,7 +22,7 @@ class CacheResourceCustomMemcacheTest extends CacheResourceTestCommon * This method is called before a test is executed. * */ - public function setUp() + public function setUp(): void { if (MemCacheEnable != true) { $this->markTestSkipped('Memcache tests are disabled'); diff --git a/tests/UnitTests/CacheResourceTests/_shared/CacheResourceTestCommon.php b/tests/UnitTests/CacheResourceTests/_shared/CacheResourceTestCommon.php index 7deaebd2..a1c8ade4 100644 --- a/tests/UnitTests/CacheResourceTests/_shared/CacheResourceTestCommon.php +++ b/tests/UnitTests/CacheResourceTests/_shared/CacheResourceTestCommon.php @@ -15,7 +15,7 @@ class CacheResourceTestCommon extends PHPUnit_Smarty { public static $touchResource = null; - public function setUp() + public function setUp(): void { $this->smarty->setTemplateDir(dirname(__FILE__) . '/templates'); $this->smarty->addPluginsDir(dirname(__FILE__) . '/PHPunitplugins'); @@ -551,7 +551,7 @@ class CacheResourceTestCommon extends PHPUnit_Smarty } $tpl = $this->smarty->createTemplate('templatedir.tpl', $this->smarty); $this->assertEquals($iscached, $tpl->isCached()); - $this->assertContains($result, $tpl->fetch()); + $this->assertStringContainsString($result, $tpl->fetch()); } public function dataDir(){ diff --git a/tests/UnitTests/Compiler/CompilerPlugin/CompileCompilerPluginTest.php b/tests/UnitTests/Compiler/CompilerPlugin/CompileCompilerPluginTest.php index d83197c0..f59c0903 100644 --- a/tests/UnitTests/Compiler/CompilerPlugin/CompileCompilerPluginTest.php +++ b/tests/UnitTests/Compiler/CompilerPlugin/CompileCompilerPluginTest.php @@ -15,7 +15,7 @@ */ class CompileCompilerPluginTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php b/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php index 32dde734..49bdcdf7 100644 --- a/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php +++ b/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php @@ -14,7 +14,7 @@ */ class AutoliteralTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/Compiler/Delimiter/DelimiterTest.php b/tests/UnitTests/Compiler/Delimiter/DelimiterTest.php index 11e333ef..caa7f707 100644 --- a/tests/UnitTests/Compiler/Delimiter/DelimiterTest.php +++ b/tests/UnitTests/Compiler/Delimiter/DelimiterTest.php @@ -15,7 +15,7 @@ */ class DelimiterTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php b/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php index 49f8d79c..1d0980ce 100644 --- a/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php +++ b/tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php @@ -15,7 +15,7 @@ */ class UserliteralTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { if (!property_exists('Smarty', 'literals')) { $this->markTestSkipped('user literal support'); diff --git a/tests/UnitTests/ConfigFileTests/defaultHandler/DefaultConfigHandlerTest.php b/tests/UnitTests/ConfigFileTests/defaultHandler/DefaultConfigHandlerTest.php index 458c4d9e..3bf4c4fc 100644 --- a/tests/UnitTests/ConfigFileTests/defaultHandler/DefaultConfigHandlerTest.php +++ b/tests/UnitTests/ConfigFileTests/defaultHandler/DefaultConfigHandlerTest.php @@ -21,33 +21,30 @@ class DefaultConfigHandlerTest extends PHPUnit_Smarty * This method is called before a test is executed. * */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->setForceCompile(true); } /** - * @expectedException SmartyException - * @expectedExceptionMessage Unable to load config 'file:foo.conf' - * * test unknown config file */ public function testUnknownConfigFile() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('Unable to load config \'file:foo.conf\''); $this->smarty->configLoad('foo.conf'); } /** - * @expectedException SmartyException - * @expectedExceptionMessage Default config handler - * @expectedExceptionMessage not callable - * * test register unknown default config handler - * */ public function testRegisterUnknownDefaultConfigHandler() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('Default config handler'); + $this->expectExceptionMessage('not callable'); $this->smarty->registerDefaultConfigHandler('foo'); } @@ -77,42 +74,32 @@ class DefaultConfigHandlerTest extends PHPUnit_Smarty $this->assertEquals("123.4", $this->smarty->fetch('number.tpl')); } - /** - * @expectedException SmartyException - * @expectedExceptionMessage Unable to load config default file 'no.conf' for 'file:fo.conf' - * - * - */ public function testDefaultConfigHandlerReplacementByConfigFileFail() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage("Unable to load config default file 'no.conf' for 'file:fo.conf'"); $this->smarty->registerDefaultConfigHandler('configHandlerFile'); $this->smarty->configLoad('fo.conf'); $this->assertEquals("123.4", $this->smarty->fetch('number.tpl')); } /** - * @expectedException SmartyException - * @expectedExceptionMessage Unable to load config 'file:foo.conf' - * - * * test default config handler replacement (return false) - * */ public function testDefaultConfigHandlerReplacementReturningFalse() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('Unable to load config \'file:foo.conf\''); $this->smarty->configLoad('foo.conf'); } /** - * @expectedException SmartyException - * @expectedExceptionMessage No config default content for 'file:bla.conf' - * - * * test default config handler replacement (return false) - * */ public function testDefaultConfigHandlerReplacementReturningFalse1() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('No config default content for \'file:bla.conf\''); $this->smarty->registerDefaultConfigHandler('configHandlerData'); $this->smarty->configLoad('bla.conf'); } diff --git a/tests/UnitTests/ConfigFileTests/file/ConfigVarTest.php b/tests/UnitTests/ConfigFileTests/file/ConfigVarTest.php index 41faf101..465b4966 100644 --- a/tests/UnitTests/ConfigFileTests/file/ConfigVarTest.php +++ b/tests/UnitTests/ConfigFileTests/file/ConfigVarTest.php @@ -20,7 +20,7 @@ class ConfigVarTest extends PHPUnit_Smarty * This method is called before a test is executed. * */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/ResourceTests/Custom/Ambiguous/CustomResourceAmbiguousTest.php b/tests/UnitTests/ResourceTests/Custom/Ambiguous/CustomResourceAmbiguousTest.php index b16af7dc..c3ba4e51 100644 --- a/tests/UnitTests/ResourceTests/Custom/Ambiguous/CustomResourceAmbiguousTest.php +++ b/tests/UnitTests/ResourceTests/Custom/Ambiguous/CustomResourceAmbiguousTest.php @@ -17,7 +17,7 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty { public $_resource = null; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); require_once dirname(__FILE__) . '/PHPunitplugins/resource.ambiguous.php'; diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/ResourceExtendsAllPluginTest.php b/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/ResourceExtendsAllPluginTest.php index e89e11bc..d32b0407 100644 --- a/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/ResourceExtendsAllPluginTest.php +++ b/tests/UnitTests/ResourceTests/Custom/DemoPluginExtendsAll/ResourceExtendsAllPluginTest.php @@ -15,7 +15,7 @@ */ class ResourceExtendsAllPluginTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/ResourceMysqlPluginTest.php b/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/ResourceMysqlPluginTest.php index 23d0c0e1..01e42d7b 100644 --- a/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/ResourceMysqlPluginTest.php +++ b/tests/UnitTests/ResourceTests/Custom/DemoPluginMysql/ResourceMysqlPluginTest.php @@ -138,13 +138,13 @@ if (MysqlResourceEnable == true) { /** * test unknown template * - * @expectedException SmartyException - * @expectedExceptionMessage Unable to load template 'mysqlstest:foo.tpl' * @runInSeparateProcess * @preserveGlobalState disabled * */ public function testUnknownTemplate() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('Unable to load template \'mysqlstest:foo.tpl\''); $this->assertEquals('foo', $this->smarty->fetch('mysqlstest:foo.tpl')); } } diff --git a/tests/UnitTests/ResourceTests/DefaultHandler/DefaultTemplateHandlerTest.php b/tests/UnitTests/ResourceTests/DefaultHandler/DefaultTemplateHandlerTest.php index 63dc3604..6914dd06 100644 --- a/tests/UnitTests/ResourceTests/DefaultHandler/DefaultTemplateHandlerTest.php +++ b/tests/UnitTests/ResourceTests/DefaultHandler/DefaultTemplateHandlerTest.php @@ -15,7 +15,7 @@ */ class DefaultTemplateHandlerTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->setForceCompile(true); @@ -36,7 +36,7 @@ class DefaultTemplateHandlerTest extends PHPUnit_Smarty $this->smarty->fetch('foo.tpl'); } catch (Exception $e) { - $this->assertContains('Unable to load template', $e->getMessage()); + $this->assertStringContainsString('Unable to load template', $e->getMessage()); return; } @@ -52,8 +52,8 @@ class DefaultTemplateHandlerTest extends PHPUnit_Smarty $this->smarty->registerDefaultTemplateHandler('foo'); } catch (Exception $e) { - $this->assertContains("Default template handler", $e->getMessage()); - $this->assertContains("not callable", $e->getMessage()); + $this->assertStringContainsString("Default template handler", $e->getMessage()); + $this->assertStringContainsString("not callable", $e->getMessage()); return; } @@ -85,7 +85,7 @@ class DefaultTemplateHandlerTest extends PHPUnit_Smarty $this->smarty->fetch('foo.tpl'); } catch (Exception $e) { - $this->assertContains('Default handler: No template default content for \'file:foo.tpl\'', $e->getMessage()); + $this->assertStringContainsString('Default handler: No template default content for \'file:foo.tpl\'', $e->getMessage()); return; } diff --git a/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php b/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php index 27635f02..867dfc19 100644 --- a/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php +++ b/tests/UnitTests/ResourceTests/Eval/EvalResourceTest.php @@ -15,7 +15,7 @@ */ class EvalResourceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php b/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php index 3012f34f..3a5bcfe3 100644 --- a/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php +++ b/tests/UnitTests/ResourceTests/Extends/ExtendsResourceTest.php @@ -15,7 +15,7 @@ */ class ExtendsResourceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->enableSecurity(); @@ -48,8 +48,8 @@ class ExtendsResourceTest extends PHPUnit_Smarty $this->smarty->compile_id = 1; } $result = $this->smarty->fetch('extends:003_parent.tpl|003_child_prepend.tpl'); - $this->assertContains("prepend - Default Title", $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $this->assertStringContainsString("prepend - Default Title", $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** * test child/parent template chain with apppend @@ -67,8 +67,8 @@ class ExtendsResourceTest extends PHPUnit_Smarty $this->smarty->compile_id = 1; } $result = $this->smarty->fetch('extends:004_parent.tpl|004_child_append.tpl'); - $this->assertContains("Default Title - append", $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $this->assertStringContainsString("Default Title - append", $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -87,8 +87,8 @@ class ExtendsResourceTest extends PHPUnit_Smarty $this->smarty->compile_id = 1; } $result = $this->smarty->fetch('extends:040_parent.tpl|040_child.tpl'); - $this->assertContains("var-bar-var", $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); + $this->assertStringContainsString("var-bar-var", $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -103,7 +103,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); + $this->assertStringContainsString('Grandchild Page Title', $result); } /** @@ -118,7 +118,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty $tpl2 = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('Grandchild Page Title', $result); + $this->assertStringContainsString('Grandchild Page Title', $result); } /** @@ -137,7 +137,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); + $this->assertStringContainsString('Grandchild Page Title', $result); } /** * test grandchild/child/parent dependency test2 @@ -152,7 +152,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty $tpl2 = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('Grandchild Page Title', $result); + $this->assertStringContainsString('Grandchild Page Title', $result); } /** @@ -171,7 +171,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); + $this->assertStringContainsString('Grandchild Page Title', $result); } /** * test grandchild/child/parent dependency test3 @@ -186,7 +186,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty $tpl2 = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('Grandchild Page Title', $result); + $this->assertStringContainsString('Grandchild Page Title', $result); } /** @@ -205,7 +205,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); + $this->assertStringContainsString('Grandchild Page Title', $result); } /** * test grandchild/child/parent dependency test4 @@ -220,7 +220,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('extends:021_parent.tpl|021_child.tpl|021_grandchild.tpl'); $this->assertTrue($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('Grandchild Page Title', $result); + $this->assertStringContainsString('Grandchild Page Title', $result); } /** @@ -241,10 +241,10 @@ class ExtendsResourceTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('extends:./child/parent/033_parent.tpl|./child/033_child.tpl|033_grandchild.tpl'); - $this->assertContains('include grand:content include grand', $result, $testName . ' - grand'); - $this->assertContains('include child:content include child', $result, $testName . ' - grand'); - $this->assertContains('include parent:content include parent', $result, $testName . ' - grand'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('include grand:content include grand', $result, $testName . ' - grand'); + $this->assertStringContainsString('include child:content include child', $result, $testName . ' - grand'); + $this->assertStringContainsString('include parent:content include parent', $result, $testName . ' - grand'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } public function data(){ @@ -293,11 +293,11 @@ class ExtendsResourceTest extends PHPUnit_Smarty } $this->smarty->setCompileId($cid); $result = $this->smarty->fetch('extends:034_parent.tpl|034_grandchild.tpl'); - $this->assertContains('grandchild - grandchild', $result, $testName . ' - grand'); - $this->assertContains('parent - parent', $result, $testName . ' - grand'); - $this->assertContains($extends_recursion ? 'child - child' : 'child - parent', $result, + $this->assertStringContainsString('grandchild - grandchild', $result, $testName . ' - grand'); + $this->assertStringContainsString('parent - parent', $result, $testName . ' - grand'); + $this->assertStringContainsString($extends_recursion ? 'child - child' : 'child - parent', $result, $testName . ' - grand'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } } diff --git a/tests/UnitTests/ResourceTests/File/FileResourceTest.php b/tests/UnitTests/ResourceTests/File/FileResourceTest.php index 1a1d615a..a3ff19de 100644 --- a/tests/UnitTests/ResourceTests/File/FileResourceTest.php +++ b/tests/UnitTests/ResourceTests/File/FileResourceTest.php @@ -15,7 +15,7 @@ */ class FileResourceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->enableSecurity(); @@ -65,16 +65,14 @@ class FileResourceTest extends PHPUnit_Smarty } /** - * @expectedException SmartyException - * @expectedExceptionMessage Unable to - * @expectedExceptionMessage notthere.tpl - * * test not existing file */ public function testTemplateFileNotExists3() { - - $result = $this->smarty->fetch('notthere.tpl'); + $this->expectException('SmartyException'); + $this->expectExceptionMessage('Unable to'); + $this->expectExceptionMessage('notthere.tpl'); + $this->smarty->fetch('notthere.tpl'); } public function testGetTemplateTimestamp() @@ -196,7 +194,7 @@ class FileResourceTest extends PHPUnit_Smarty public function testRelativeInclude() { $result = $this->smarty->fetch('relative.tpl'); - $this->assertContains('hello world', $result); + $this->assertStringContainsString('hello world', $result); } /** @@ -208,12 +206,9 @@ class FileResourceTest extends PHPUnit_Smarty public function testRelativeIncludeSub() { $result = $this->smarty->fetch('sub/relative.tpl'); - $this->assertContains('hello world', $result); + $this->assertStringContainsString('hello world', $result); } /** - * @expectedException SmartyException - * @expectedExceptionMessage Unable to - * @expectedExceptionMessage notthereh.tpl * @runInSeparateProcess * @preserveGlobalState disabled * @@ -221,11 +216,11 @@ class FileResourceTest extends PHPUnit_Smarty */ public function testRelativeIncludeFail() { - $result = $this->smarty->fetch('relative_sub.tpl'); + $this->expectException('SmartyException'); + $this->expectExceptionMessage('Unable to'); + $this->smarty->fetch('relative_sub.tpl'); } /** - * @expectedException SmartyException - * @expectedExceptionMessage ./hello.tpl * @runInSeparateProcess * @preserveGlobalState disabled * @@ -233,8 +228,10 @@ class FileResourceTest extends PHPUnit_Smarty */ public function testRelativeIncludeFailOtherDir() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('./hello.tpl'); $this->smarty->addTemplateDir('./templates_2'); - $result = $this->smarty->fetch('relative_notexist.tpl'); + $this->smarty->fetch('relative_notexist.tpl'); } /** diff --git a/tests/UnitTests/ResourceTests/FileIncludePath/FileIncludePathTest.php b/tests/UnitTests/ResourceTests/FileIncludePath/FileIncludePathTest.php index 8ba53fb3..6b297458 100644 --- a/tests/UnitTests/ResourceTests/FileIncludePath/FileIncludePathTest.php +++ b/tests/UnitTests/ResourceTests/FileIncludePath/FileIncludePathTest.php @@ -11,7 +11,7 @@ */ class FileIncludePathTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->use_include_path = true; @@ -26,7 +26,7 @@ class FileIncludePathTest extends PHPUnit_Smarty * This method is called after a test is executed. * */ - protected function tearDown() + protected function tearDown(): void { ini_restore('include_path'); $this->smarty->disableSecurity(); @@ -38,30 +38,30 @@ class FileIncludePathTest extends PHPUnit_Smarty } public function testInclude1() { - $this->assertContains('include_test1', $this->smarty->fetch('test1.tpl')); + $this->assertStringContainsString('include_test1', $this->smarty->fetch('test1.tpl')); } public function testInclude2() { - $this->assertContains('include_test2', $this->smarty->fetch('test2.tpl')); + $this->assertStringContainsString('include_test2', $this->smarty->fetch('test2.tpl')); } public function testInclude3() { - $this->assertContains('include_test3', $this->smarty->fetch('test3.tpl')); + $this->assertStringContainsString('include_test3', $this->smarty->fetch('test3.tpl')); } public function testInclude31() { $this->smarty->use_include_path = false; $this->smarty->security_policy->secure_dir = getcwd(); - $this->assertContains('include_test3', $this->smarty->fetch('test3.tpl')); + $this->assertStringContainsString('include_test3', $this->smarty->fetch('test3.tpl')); } public function testInclude4() { - $this->assertContains('include_test4', $this->smarty->fetch('test4.tpl')); + $this->assertStringContainsString('include_test4', $this->smarty->fetch('test4.tpl')); } public function testInclude5() { $this->smarty->setTemplateDir(array('./')); - $this->assertContains('include path root', $this->smarty->fetch('test5.tpl')); + $this->assertStringContainsString('include path root', $this->smarty->fetch('test5.tpl')); } } diff --git a/tests/UnitTests/ResourceTests/FileIndexed/FileResourceIndexedTest.php b/tests/UnitTests/ResourceTests/FileIndexed/FileResourceIndexedTest.php index 9a1cf606..0650f799 100644 --- a/tests/UnitTests/ResourceTests/FileIndexed/FileResourceIndexedTest.php +++ b/tests/UnitTests/ResourceTests/FileIndexed/FileResourceIndexedTest.php @@ -11,7 +11,7 @@ */ class FileResourceIndexedTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addTemplateDir(dirname(__FILE__) . '/templates_2'); diff --git a/tests/UnitTests/ResourceTests/Php/PhpResourceTest.php b/tests/UnitTests/ResourceTests/Php/PhpResourceTest.php index dd4f20f0..ef04acce 100644 --- a/tests/UnitTests/ResourceTests/Php/PhpResourceTest.php +++ b/tests/UnitTests/ResourceTests/Php/PhpResourceTest.php @@ -15,7 +15,7 @@ */ class PhpResourceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -57,7 +57,7 @@ class PhpResourceTest extends PHPUnit_Smarty * public function testGetTemplateSource() * { * $tpl = $this->smarty->createTemplate('php:phphelloworld.php'); - * $this->assertContains('php hello world', $tpl->source->getContent()); + * $this->assertStringContainsString('php hello world', $tpl->source->getContent()); * } * /** * test usesCompiler @@ -110,7 +110,7 @@ class PhpResourceTest extends PHPUnit_Smarty $this->smarty->caching = true; $this->smarty->cache_lifetime = 1000; $tpl = $this->smarty->createTemplate('php:phphelloworld.php'); - $this->assertContains('php hello world', $this->smarty->fetch($tpl)); + $this->assertStringContainsString('php hello world', $this->smarty->fetch($tpl)); } /** @@ -207,7 +207,7 @@ class PhpResourceTest extends PHPUnit_Smarty { $this->smarty->setAllowPhpTemplates(true); $tpl = $this->smarty->createTemplate('php:phphelloworld.php'); - $this->assertContains('php hello world', $tpl->fetch()); + $this->assertStringContainsString('php hello world', $tpl->fetch()); } /** @@ -275,7 +275,7 @@ class PhpResourceTest extends PHPUnit_Smarty public function testIncludePhpTemplate() { $this->smarty->setAllowPhpTemplates(true); - $this->assertContains('php hello world', $this->smarty->fetch('includephp.tpl')); + $this->assertStringContainsString('php hello world', $this->smarty->fetch('includephp.tpl')); } /** @@ -285,7 +285,7 @@ class PhpResourceTest extends PHPUnit_Smarty { $this->smarty->caching = true; $this->smarty->setAllowPhpTemplates(true); - $this->assertContains('php hello world', $this->smarty->fetch('includephp.tpl')); + $this->assertStringContainsString('php hello world', $this->smarty->fetch('includephp.tpl')); } /** diff --git a/tests/UnitTests/ResourceTests/Registered/RegisteredResourceTest.php b/tests/UnitTests/ResourceTests/Registered/RegisteredResourceTest.php index d55a1852..584ab67f 100644 --- a/tests/UnitTests/ResourceTests/Registered/RegisteredResourceTest.php +++ b/tests/UnitTests/ResourceTests/Registered/RegisteredResourceTest.php @@ -16,7 +16,7 @@ class RegisteredResourceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); diff --git a/tests/UnitTests/ResourceTests/ResourcePlugins/ResourcePluginTest.php b/tests/UnitTests/ResourceTests/ResourcePlugins/ResourcePluginTest.php index ba8d9162..17a136a6 100644 --- a/tests/UnitTests/ResourceTests/ResourcePlugins/ResourcePluginTest.php +++ b/tests/UnitTests/ResourceTests/ResourcePlugins/ResourcePluginTest.php @@ -15,7 +15,7 @@ */ class ResourcePluginTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php b/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php index 73584f09..1c422351 100644 --- a/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php +++ b/tests/UnitTests/ResourceTests/Stream/StreamResourceTest.php @@ -15,7 +15,7 @@ */ class StreamResourceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); @@ -32,7 +32,7 @@ class StreamResourceTest extends PHPUnit_Smarty { $this->cleanDirs(); } - public function tearDown() + public function tearDown(): void { parent::tearDown(); stream_wrapper_unregister("global"); @@ -138,8 +138,6 @@ class StreamResourceTest extends PHPUnit_Smarty $this->assertFalse($this->smarty->templateExists('global:notthere')); } /** - * @expectedException SmartyException - * @expectedExceptionMessage 'global:notthere' * @runInSeparateProcess * @preserveGlobalState disabled * @@ -148,7 +146,9 @@ class StreamResourceTest extends PHPUnit_Smarty public function testTemplateStramNotExists3() { - $result = $this->smarty->fetch('global:notthere'); + $this->expectException('SmartyException'); + $this->expectExceptionMessage('\'global:notthere\''); + $this->smarty->fetch('global:notthere'); } /** diff --git a/tests/UnitTests/ResourceTests/String/StringResourceTest.php b/tests/UnitTests/ResourceTests/String/StringResourceTest.php index 7c938842..b01e2925 100644 --- a/tests/UnitTests/ResourceTests/String/StringResourceTest.php +++ b/tests/UnitTests/ResourceTests/String/StringResourceTest.php @@ -15,7 +15,7 @@ */ class StringResourceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SecurityTests/FunctionTest.php b/tests/UnitTests/SecurityTests/FunctionTest.php index 0706f23b..30ba119b 100644 --- a/tests/UnitTests/SecurityTests/FunctionTest.php +++ b/tests/UnitTests/SecurityTests/FunctionTest.php @@ -15,7 +15,7 @@ */ class FunctionTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -35,7 +35,7 @@ class FunctionTest extends PHPUnit_Smarty $this->smarty->fetch('eval:{unknown()}'); } catch (Exception $e) { - $this->assertContains("PHP function 'unknown' not allowed by security setting", $e->getMessage()); + $this->assertStringContainsString("PHP function 'unknown' not allowed by security setting", $e->getMessage()); return; } diff --git a/tests/UnitTests/SecurityTests/SecurityTest.php b/tests/UnitTests/SecurityTests/SecurityTest.php index 2a4d3e59..964b8204 100644 --- a/tests/UnitTests/SecurityTests/SecurityTest.php +++ b/tests/UnitTests/SecurityTests/SecurityTest.php @@ -16,7 +16,7 @@ class SecurityTest extends PHPUnit_Smarty { public $loadSmartyBC = true; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); @@ -60,15 +60,15 @@ class SecurityTest extends PHPUnit_Smarty /** * test not trusted PHP function - * @expectedException SmartyException - * @expectedExceptionMessage PHP function 'count' not allowed by security setting * @runInSeparateProcess * @preserveGlobalState disabled */ public function testNotTrustedPHPFunction() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('PHP function \'count\' not allowed by security setting'); $this->smarty->security_policy->php_functions = array('null'); - $this->smarty->fetch('string:{assign var=foo value=[1,2,3,4,5]}{count($foo)}'); + $this->smarty->fetch('string:{assign var=foo value=[1,2,3,4,5]}{count($foo)}'); } /** @@ -91,13 +91,13 @@ class SecurityTest extends PHPUnit_Smarty /** * test not trusted modifier - * @expectedException SmartyException - * @expectedExceptionMessage modifier 'count' not allowed by security setting * @runInSeparateProcess * @preserveGlobalState disabled */ public function testNotTrustedModifier() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('modifier \'count\' not allowed by security setting'); $this->smarty->security_policy->php_modifiers = array('null'); $this->smarty->fetch('string:{assign var=foo value=[1,2,3,4,5]}{$foo|@count}'); } @@ -123,26 +123,26 @@ class SecurityTest extends PHPUnit_Smarty /** * test not allowed tag - * @expectedException SmartyException - * @expectedExceptionMessage tag 'cycle' not allowed by security setting * @runInSeparateProcess * @preserveGlobalState disabled */ public function testNotAllowedTags2() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('tag \'cycle\' not allowed by security setting'); $this->smarty->security_policy->allowed_tags = array('counter'); $this->smarty->fetch('string:{counter}{cycle values="1,2"}'); } /** * test disabled tag - * @expectedException SmartyException - * @expectedExceptionMessage tag 'cycle' disabled by security setting * @runInSeparateProcess * @preserveGlobalState disabled */ public function testDisabledTags() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('tag \'cycle\' disabled by security setting'); $this->smarty->security_policy->disabled_tags = array('cycle'); $this->smarty->fetch('string:{counter}{cycle values="1,2"}'); } @@ -166,28 +166,28 @@ class SecurityTest extends PHPUnit_Smarty /** * test not allowed modifier - * @expectedException SmartyException - * @expectedExceptionMessage modifier 'lower' not allowed by security setting * @runInSeparateProcess * @preserveGlobalState disabled */ public function testNotAllowedModifier() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('modifier \'lower\' not allowed by security setting'); $this->smarty->security_policy->allowed_modifiers = array('upper'); $this->smarty->fetch('string:{"hello"|upper}{"world"|lower}'); - } + } /** * test disabled modifier - * @expectedException SmartyException - * @expectedExceptionMessage modifier 'lower' disabled by security setting * @runInSeparateProcess * @preserveGlobalState disabled */ public function testDisabledModifier() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('modifier \'lower\' disabled by security setting'); $this->smarty->security_policy->disabled_modifiers = array('lower'); - $this->smarty->fetch('string:{"hello"|upper}{"world"|lower}'); + $this->smarty->fetch('string:{"hello"|upper}{"world"|lower}'); } /** @@ -268,15 +268,15 @@ class SecurityTest extends PHPUnit_Smarty /** * test not trusted directory * - * @expectedException SmartyException - * @expectedExceptionMessage not trusted file path * @runInSeparateProcess * @preserveGlobalState disabled */ public function testNotTrustedDirectory() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('not trusted file path'); $this->smarty->security_policy->secure_dir = array(str_replace('\\', '/', dirname(__FILE__) . '/templates_3/')); - $this->smarty->fetch('string:{include file="templates_2/hello.tpl"}'); + $this->smarty->fetch('string:{include file="templates_2/hello.tpl"}'); } /** @@ -300,15 +300,15 @@ class SecurityTest extends PHPUnit_Smarty /** * test not trusted PHP function - * @expectedException SmartyException - * @expectedExceptionMessage access to static class 'mysecuritystaticclass' not allowed by security setting * @runInSeparateProcess * @preserveGlobalState disabled */ public function testNotTrustedStaticClass() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('access to static class \'mysecuritystaticclass\' not allowed by security setting'); $this->smarty->security_policy->static_classes = array('null'); - $this->smarty->fetch('string:{mysecuritystaticclass::square(5)}'); + $this->smarty->fetch('string:{mysecuritystaticclass::square(5)}'); } public function testChangedTrustedDirectory() @@ -342,14 +342,14 @@ class SecurityTest extends PHPUnit_Smarty $this->assertTrue($tpl->source->exists); } /** - * @expectedException SmartyException - * @expectedExceptionMessage stream 'global' not allowed by security setting * @runInSeparateProcess * @preserveGlobalState disabled * test template file exits */ public function testTemplateNotTrustedStream() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('stream \'global\' not allowed by security setting'); stream_wrapper_register("global", "ResourceStreamSecurity") or die("Failed to register protocol"); $fp = fopen("global://mytest", "r+"); @@ -368,19 +368,19 @@ class SecurityTest extends PHPUnit_Smarty $this->smarty->security_policy->trusted_uri = array( '#https://www.smarty.net$#i' ); - $this->assertContains('Preface | Smarty', $this->smarty->fetch('string:{fetch file="https://www.smarty.net/docs/en/preface.tpl"}')); + $this->assertStringContainsString('Preface | Smarty', $this->smarty->fetch('string:{fetch file="https://www.smarty.net/docs/en/preface.tpl"}')); } /** - * @expectedException SmartyException - * @expectedExceptionMessage URI 'https://www.smarty.net/docs/en/preface.tpl' not allowed by security setting * @runInSeparateProcess * @preserveGlobalState disabled */ public function testNotTrustedUri() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('URI \'https://www.smarty.net/docs/en/preface.tpl\' not allowed by security setting'); $this->smarty->security_policy->trusted_uri = array(); - $this->assertContains('Preface | Smarty', $this->smarty->fetch('string:{fetch file="https://www.smarty.net/docs/en/preface.tpl"}')); + $this->assertStringContainsString('Preface | Smarty', $this->smarty->fetch('string:{fetch file="https://www.smarty.net/docs/en/preface.tpl"}')); } } diff --git a/tests/UnitTests/SmartyMethodsTests/Append/AppendTest.php b/tests/UnitTests/SmartyMethodsTests/Append/AppendTest.php index 4955b7d7..5d63b654 100644 --- a/tests/UnitTests/SmartyMethodsTests/Append/AppendTest.php +++ b/tests/UnitTests/SmartyMethodsTests/Append/AppendTest.php @@ -15,7 +15,7 @@ */ class AppendTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/AppendByRef/AppendByRefBCTest.php b/tests/UnitTests/SmartyMethodsTests/AppendByRef/AppendByRefBCTest.php index 0c8a759e..ee28a995 100644 --- a/tests/UnitTests/SmartyMethodsTests/AppendByRef/AppendByRefBCTest.php +++ b/tests/UnitTests/SmartyMethodsTests/AppendByRef/AppendByRefBCTest.php @@ -17,7 +17,7 @@ class AppendByRefBCTest extends PHPUnit_Smarty { public $loadSmartyBC = true; public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/AppendByRef/AppendByRefTest.php b/tests/UnitTests/SmartyMethodsTests/AppendByRef/AppendByRefTest.php index 7a52d700..abf074dc 100644 --- a/tests/UnitTests/SmartyMethodsTests/AppendByRef/AppendByRefTest.php +++ b/tests/UnitTests/SmartyMethodsTests/AppendByRef/AppendByRefTest.php @@ -15,7 +15,7 @@ */ class AppendByRefTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php b/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php index cc45a5c9..fbe44365 100644 --- a/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php +++ b/tests/UnitTests/SmartyMethodsTests/Assign/AssignTest.php @@ -15,7 +15,7 @@ */ class AssignTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/AssignByRef/AssignByRefBCTest.php b/tests/UnitTests/SmartyMethodsTests/AssignByRef/AssignByRefBCTest.php index 902d27ac..86cd63ac 100644 --- a/tests/UnitTests/SmartyMethodsTests/AssignByRef/AssignByRefBCTest.php +++ b/tests/UnitTests/SmartyMethodsTests/AssignByRef/AssignByRefBCTest.php @@ -17,7 +17,7 @@ class AssignByRefBCTest extends PHPUnit_Smarty { public $loadSmartyBC = true; public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/AssignByRef/AssignByRefTest.php b/tests/UnitTests/SmartyMethodsTests/AssignByRef/AssignByRefTest.php index 6c393d86..789f2aa5 100644 --- a/tests/UnitTests/SmartyMethodsTests/AssignByRef/AssignByRefTest.php +++ b/tests/UnitTests/SmartyMethodsTests/AssignByRef/AssignByRefTest.php @@ -15,7 +15,7 @@ */ class AssignByRefTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/AssignGlobal/AssignGlobalTest.php b/tests/UnitTests/SmartyMethodsTests/AssignGlobal/AssignGlobalTest.php index ecd4130b..62c5aca8 100644 --- a/tests/UnitTests/SmartyMethodsTests/AssignGlobal/AssignGlobalTest.php +++ b/tests/UnitTests/SmartyMethodsTests/AssignGlobal/AssignGlobalTest.php @@ -15,7 +15,7 @@ */ class AssignGlobalTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignBCTest.php b/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignBCTest.php index 48c104e9..566d035b 100644 --- a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignBCTest.php +++ b/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignBCTest.php @@ -20,7 +20,7 @@ class ClearAllAssignBCTest extends PHPUnit_Smarty protected $_dataBC = null; protected $_tplBC = null; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignTest.php b/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignTest.php index 459e8557..db273ffd 100644 --- a/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignTest.php +++ b/tests/UnitTests/SmartyMethodsTests/ClearAllAssign/ClearAllAssignTest.php @@ -18,7 +18,7 @@ class ClearAllAssignTest extends PHPUnit_Smarty protected $_data = null; protected $_tpl = null; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAssign/ClearAssignBCTest.php b/tests/UnitTests/SmartyMethodsTests/ClearAssign/ClearAssignBCTest.php index b9867627..d72e706c 100644 --- a/tests/UnitTests/SmartyMethodsTests/ClearAssign/ClearAssignBCTest.php +++ b/tests/UnitTests/SmartyMethodsTests/ClearAssign/ClearAssignBCTest.php @@ -17,7 +17,7 @@ class ClearAssignBCTest extends PHPUnit_Smarty { public $loadSmartyBC = true; public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); diff --git a/tests/UnitTests/SmartyMethodsTests/ClearAssign/ClearAssignTest.php b/tests/UnitTests/SmartyMethodsTests/ClearAssign/ClearAssignTest.php index 2b466928..7dd12d15 100644 --- a/tests/UnitTests/SmartyMethodsTests/ClearAssign/ClearAssignTest.php +++ b/tests/UnitTests/SmartyMethodsTests/ClearAssign/ClearAssignTest.php @@ -15,7 +15,7 @@ */ class ClearAssignTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->assign('foo', 'foo'); diff --git a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledBCTest.php b/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledBCTest.php index 9cf3f127..a18961fd 100644 --- a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledBCTest.php +++ b/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledBCTest.php @@ -20,7 +20,7 @@ class ClearCompiledBCTest extends ClearCompiledTest public $loadSmartyBC = true; public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smartyBC->addTemplateDir('./templates_2/'); diff --git a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledTest.php b/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledTest.php index 51fe36b5..796ca360 100644 --- a/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledTest.php +++ b/tests/UnitTests/SmartyMethodsTests/ClearCompiledTemplate/ClearCompiledTest.php @@ -17,7 +17,7 @@ class ClearCompiledTest extends PHPUnit_Smarty { public $methodName = null; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addTemplateDir('./templates_2/'); diff --git a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsBCTest.php b/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsBCTest.php index 816c9f50..97d39955 100644 --- a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsBCTest.php +++ b/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsBCTest.php @@ -18,7 +18,7 @@ class get_template_varsBCTest extends PHPUnit_Smarty public $loadSmartyBC = true; public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsTest.php b/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsTest.php index 7fd71f1e..35af56fb 100644 --- a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsTest.php +++ b/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsTest.php @@ -15,7 +15,7 @@ */ class GetTemplateVarsTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php index 5d5f845f..bb692de4 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php @@ -16,7 +16,7 @@ class RegisterBlockTest extends PHPUnit_Smarty { public $loadSmartyBC = true; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->disableSecurity(); diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionBCTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionBCTest.php index 3dee8b1e..084175a7 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionBCTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionBCTest.php @@ -18,7 +18,7 @@ class RegisterCompilerFunctionBCTest extends PHPUnit_Smarty public $loadSmartyBC = true; public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionTest.php index 54db28a6..996e9067 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterCompiler/RegisterCompilerFunctionTest.php @@ -15,7 +15,7 @@ */ class RegisterCompilerFunctionTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionBCTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionBCTest.php index b9082c26..76669d8f 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionBCTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionBCTest.php @@ -20,7 +20,7 @@ class RegisterFunctionBCTest extends PHPUnit_Smarty public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php index 8cc828cc..478d1e71 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php @@ -16,7 +16,7 @@ */ class RegisterFunctionTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierTest.php index 6b768984..4c76197c 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterModifier/RegisterModifierTest.php @@ -15,7 +15,7 @@ */ class RegisterModifierTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterObject/CompileRegisteredObjectFunctionTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterObject/CompileRegisteredObjectFunctionTest.php index be57c06f..59bd3cb8 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterObject/CompileRegisteredObjectFunctionTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterObject/CompileRegisteredObjectFunctionTest.php @@ -15,7 +15,7 @@ */ class CompileRegisteredObjectFunctionTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); diff --git a/tests/UnitTests/SmartyMethodsTests/TemplateExist/TemplateExistsTest.php b/tests/UnitTests/SmartyMethodsTests/TemplateExist/TemplateExistsTest.php index f387d8f7..6712ddaf 100644 --- a/tests/UnitTests/SmartyMethodsTests/TemplateExist/TemplateExistsTest.php +++ b/tests/UnitTests/SmartyMethodsTests/TemplateExist/TemplateExistsTest.php @@ -15,7 +15,7 @@ */ class TemplateExistsTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/Comments/CommentsTest.php b/tests/UnitTests/TemplateSource/Comments/CommentsTest.php index 281b5aec..4e01b845 100644 --- a/tests/UnitTests/TemplateSource/Comments/CommentsTest.php +++ b/tests/UnitTests/TemplateSource/Comments/CommentsTest.php @@ -15,7 +15,7 @@ */ class CommentsTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/Spacing/SpacingTest.php b/tests/UnitTests/TemplateSource/Spacing/SpacingTest.php index bfcb7495..5a0bbfeb 100644 --- a/tests/UnitTests/TemplateSource/Spacing/SpacingTest.php +++ b/tests/UnitTests/TemplateSource/Spacing/SpacingTest.php @@ -15,7 +15,7 @@ */ class SpacingTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/StaticClass/StaticClassAccessTest.php b/tests/UnitTests/TemplateSource/StaticClass/StaticClassAccessTest.php index 42d9f0ce..aaaa1819 100644 --- a/tests/UnitTests/TemplateSource/StaticClass/StaticClassAccessTest.php +++ b/tests/UnitTests/TemplateSource/StaticClass/StaticClassAccessTest.php @@ -15,7 +15,7 @@ */ class StaticClassAccessTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->disableSecurity(); diff --git a/tests/UnitTests/TemplateSource/TagTests/Append/CompileAppendTest.php b/tests/UnitTests/TemplateSource/TagTests/Append/CompileAppendTest.php index 1c671f15..76b11052 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Append/CompileAppendTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Append/CompileAppendTest.php @@ -15,7 +15,7 @@ */ class CompileAppendTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/TemplateSource/TagTests/Assign/CompileAssignTest.php b/tests/UnitTests/TemplateSource/TagTests/Assign/CompileAssignTest.php index b4301d59..fefdd72d 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Assign/CompileAssignTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Assign/CompileAssignTest.php @@ -15,7 +15,7 @@ */ class CompileAssignTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php index c6a2eee4..8af33e45 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/BlockPlugin/CompileBlockPluginTest.php @@ -15,7 +15,7 @@ */ class CompileBlockPluginTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("./PHPunitplugins/"); @@ -47,13 +47,11 @@ class CompileBlockPluginTest extends PHPUnit_Smarty /** * test unknown block plugin tag - * - * @expectedException SmartyCompilerException - * @expectedExceptionMessage unknown tag 'bar' - * */ public function testBlockPluginUnknown() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('unknown tag \'bar\''); $this->assertEquals("hello world", $this->smarty->fetch('unknown.tpl')); } @@ -75,12 +73,11 @@ class CompileBlockPluginTest extends PHPUnit_Smarty * * @runInSeparateProcess * @preserveGlobalState disabled - * @expectedException SmartyException - * @expectedExceptionMessage block tag 'blockplugintest' not callable - * */ public function testBlockPluginRegisteredFunction2() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('block tag \'blockplugintest\' not callable'); $this->assertEquals('block test', $this->smarty->fetch('registered.tpl')); } @@ -102,12 +99,12 @@ class CompileBlockPluginTest extends PHPUnit_Smarty * * @runInSeparateProcess * @preserveGlobalState disabled - * @expectedException SmartyException - * @expectedExceptionMessage block tag 'blockpluginstatic' not callable * */ public function testBlockPluginRegisteredStatic2() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('block tag \'blockpluginstatic\' not callable'); $this->assertEquals('static block test', $this->smarty->fetch('registered_static.tpl')); } @@ -130,12 +127,11 @@ class CompileBlockPluginTest extends PHPUnit_Smarty * * @runInSeparateProcess * @preserveGlobalState disabled - * @expectedException SmartyException - * @expectedExceptionMessage block tag 'blockpluginmethod' not callable - * */ public function testBlockPluginRegisteredMethod2() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('block tag \'blockpluginmethod\' not callable'); $this->assertEquals('method block test', $this->smarty->fetch('registered_method.tpl')); } @@ -158,12 +154,11 @@ class CompileBlockPluginTest extends PHPUnit_Smarty * * @runInSeparateProcess * @preserveGlobalState disabled - * @expectedException SmartyException - * @expectedExceptionMessage block tag 'myobject' not callable - * */ public function testBlockPluginRegisteredObject2() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('block tag \'myobject\' not callable'); $this->assertEquals('object block test', $this->smarty->fetch('registered_object.tpl')); } @@ -297,10 +292,10 @@ class CompileBlockPluginTest extends PHPUnit_Smarty $this->assertEquals($isCached, $tpl->isCached(), $testName . ' - isCached()'); } $result = $this->smarty->fetch($tpl); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure test number'); - $this->assertContains("block test{$resultNumber}", $result, $testName . ' - fetch() failure result'); + $this->assertStringContainsString("block test{$resultNumber}", $result, $testName . ' - fetch() failure result'); } public function data() diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php index 0f3eb406..93b81618 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php @@ -15,7 +15,7 @@ */ class CompileBlockExtendsTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); //$this->smarty->setMergeCompiledIncludes(true); @@ -54,7 +54,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty { $this->smarty->assign('parent', 'parent'); $result = $this->smarty->fetch('001_parent.tpl'); - $this->assertContains('(parent|b)content parent b(parent|/b)', $result); + $this->assertStringContainsString('(parent|b)content parent b(parent|/b)', $result); } /** @@ -77,8 +77,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('002_child.tpl'); - $this->assertContains('(child|b)content child b(child|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('(child|b)content child b(child|/b)', $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -102,9 +102,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('003_child.tpl'); - $this->assertContains('(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', $result, + $this->assertStringContainsString('(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -129,9 +129,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('003_grand.tpl'); - $this->assertContains('(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -156,9 +156,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('004_child.tpl'); - $this->assertContains('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)', $result, + $this->assertStringContainsString('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -183,9 +183,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('004_grand.tpl'); - $this->assertContains('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)(grand|b)content grand b(grand|/b)', + $this->assertStringContainsString('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)(grand|b)content grand b(grand|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -210,9 +210,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('004_grand2.tpl'); - $this->assertContains('(parent|b)content parent b(parent|/b)(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(grand|b)content grand b(grand|/b)', + $this->assertStringContainsString('(parent|b)content parent b(parent|/b)(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(grand|b)content grand b(grand|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -236,9 +236,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('005_child.tpl'); - $this->assertContains('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)', $result, + $this->assertStringContainsString('(parent|b)content parent b(parent|/b)(child|b)content child b(child|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -262,9 +262,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('006_child.tpl'); - $this->assertContains('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, + $this->assertStringContainsString('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -289,9 +289,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('007_child.tpl'); - $this->assertContains('(child|b)content (parent|b)content parent b(parent|/b) b(child|/b)', $result, + $this->assertStringContainsString('(child|b)content (parent|b)content parent b(parent|/b) b(child|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -316,9 +316,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('007_grand.tpl'); - $this->assertContains('(grand|b)content (child|b)content (parent|b)content parent b(parent|/b) b(child|/b) b(grand|/b)', + $this->assertStringContainsString('(grand|b)content (child|b)content (parent|b)content parent b(parent|/b) b(child|/b) b(grand|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -343,9 +343,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('008_child.tpl'); - $this->assertContains('(child|b)content escaped <text> child 1 b(child|/b', $result, + $this->assertStringContainsString('(child|b)content escaped <text> child 1 b(child|/b', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -368,9 +368,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('009_parent.tpl'); - $this->assertContains('(parent|b)content (parent|c)content parent c(parent|/c) b(parent|/b)', $result, + $this->assertStringContainsString('(parent|b)content (parent|c)content parent c(parent|/c) b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -394,9 +394,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('010_child.tpl'); - $this->assertContains('(parent|b)content (parent|c)content child c(parent|/c) b(parent|/b)', $result, + $this->assertStringContainsString('(parent|b)content (parent|c)content child c(parent|/c) b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -421,9 +421,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('011_grand.tpl'); - $this->assertContains('(child|b)content(child|c)content(child|n)content(include)content child i(/include)n(child|/n)c(child|/c)(grand|c)content grand c(grand|\c)b(child|/b)', + $this->assertStringContainsString('(child|b)content(child|c)content(child|n)content(include)content child i(/include)n(child|/n)c(child|/c)(grand|c)content grand c(grand|\c)b(child|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -448,9 +448,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('012_grandgrand.tpl'); - $this->assertContains('(grand|b)content (grandgrand|c)content c(grandgrand|\c)(grand|c)content c(grand|\c) b(grand|/b)', + $this->assertStringContainsString('(grand|b)content (grandgrand|c)content c(grandgrand|\c)(grand|c)content c(grand|\c) b(grand|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -472,9 +472,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('018_child.tpl'); - $this->assertContains('(child|b)content(child|c)content child c(child|/c)b(child|/b)', $result, + $this->assertStringContainsString('(child|b)content(child|c)content child c(child|/c)b(child|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -496,9 +496,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('018_grand.tpl'); - $this->assertContains('(child|b)content(child|c)content child c(child|/c)(child|d)content (grand|d)content grand d(grand|/d) d(child|/d)b(child|/b)', + $this->assertStringContainsString('(child|b)content(child|c)content child c(child|/c)(child|d)content (grand|d)content grand d(grand|/d) d(child|/d)b(child|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -520,9 +520,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('018_grandgrand.tpl'); - $this->assertContains('(child|b)content(grand|c)content (grandgrand|c)content grandgrand c(grandgrand|/c) c(grand|/c)(child|d)content (grandgrand|d)content grandgrand d(grandgrand|/d) d(child|/d)b(child|/b)', + $this->assertStringContainsString('(child|b)content(grand|c)content (grandgrand|c)content grandgrand c(grandgrand|/c) c(grand|/c)(child|d)content (grandgrand|d)content grandgrand d(grandgrand|/d) d(child|/d)b(child|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -544,13 +544,13 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('020_include_root.tpl'); - $this->assertContains('(include1)(include1|p)content 1 p(include1|\p)(include1|b)content 1 b(include1|\b)(\include1)', + $this->assertStringContainsString('(include1)(include1|p)content 1 p(include1|\p)(include1|b)content 1 b(include1|\b)(\include1)', $result, $testName . ' - include 1'); - $this->assertContains('(include2)(include2|p)content 2 p(include2|\p)(include2|b)content 2 b(include2|\b)(\include2)', + $this->assertStringContainsString('(include2)(include2|p)content 2 p(include2|\p)(include2|b)content 2 b(include2|\b)(\include2)', $result, $testName . ' - include 1'); - $this->assertContains('(include3)(include3|p)content 3 p(include3|\p)(include3|b)content 3 b(include3|\b)(\include3)', + $this->assertStringContainsString('(include3)(include3|p)content 3 p(include3|\p)(include3|b)content 3 b(include3|\b)(\include3)', $result, $testName . ' - include 1'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -571,7 +571,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand b(grand|/b)(child|b)content child b(child|/b)(parent|b)content parent b(parent|/b)', $result); $this->smarty->_clearTemplateCache(); $this->smarty->assign('parent', 'parent2'); @@ -580,7 +580,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('(grand|b)content grand2 b(grand|/b)(child|b)content child2 b(child|/b)(parent|b)content parent b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand2 b(grand|/b)(child|b)content child2 b(child|/b)(parent|b)content parent b(parent|/b)', $result); } @@ -601,7 +601,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('(grand|b)content grand3 b(grand|/b)(child|b)content child3 b(child|/b)(parent|b)content parent b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand3 b(grand|/b)(child|b)content child3 b(child|/b)(parent|b)content parent b(parent|/b)', $result); } @@ -626,7 +626,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('(grand|b)content grand4 b(grand|/b)(child|b)content child4 b(child|/b)(parent|b)content parent4 b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand4 b(grand|/b)(child|b)content child4 b(child|/b)(parent|b)content parent4 b(parent|/b)', $result); $this->smarty->_clearTemplateCache(); $this->smarty->assign('parent', 'parent5'); @@ -636,7 +636,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('(grand|b)content grand5 b(grand|/b)(child|b)content child5 b(child|/b)(parent|b)content parent4 b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand5 b(grand|/b)(child|b)content child5 b(child|/b)(parent|b)content parent4 b(parent|/b)', $result); } @@ -661,7 +661,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('(grand|b)content grand6 b(grand|/b)(child|b)content child6 b(child|/b)(parent|b)content parent6 b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand6 b(grand|/b)(child|b)content child6 b(child|/b)(parent|b)content parent6 b(parent|/b)', $result); } @@ -683,7 +683,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('(grand|b)content grand7 b(grand|/b)(child|b)content child7 b(child|/b)(parent|b)content parent6 b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand7 b(grand|/b)(child|b)content child7 b(child|/b)(parent|b)content parent6 b(parent|/b)', $result); } @@ -707,7 +707,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertFalse($tpl->isCached()); $result = $this->smarty->fetch($tpl); - $this->assertContains('(grand|b)content grand8 b(grand|/b)(child|b)content child8 b(child|/b)(parent|b)content parent8 b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand8 b(grand|/b)(child|b)content child8 b(child|/b)(parent|b)content parent8 b(parent|/b)', $result); } @@ -728,7 +728,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $tpl2 = $this->smarty->createTemplate('021_grand.tpl', $this->smarty); $this->assertTrue($tpl2->isCached()); $result = $this->smarty->fetch($tpl2); - $this->assertContains('(grand|b)content grand9 b(grand|/b)(child|b)content child9 b(child|/b)(parent|b)content parent8 b(parent|/b)', + $this->assertStringContainsString('(grand|b)content grand9 b(grand|/b)(child|b)content child9 b(child|/b)(parent|b)content parent8 b(parent|/b)', $result); } @@ -747,37 +747,37 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty public function testNotExistingChildBlock_024() { $result = $this->smarty->fetch('024_parent.tpl'); - $this->assertContains('no >< child', $result); + $this->assertStringContainsString('no >< child', $result); } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage '{$smarty.block.child}' used outside {block} tags * test {$this->smarty.block.child} outside {block] */ public function testSmartyBlockChildOutsideBlock_025() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('\'{$smarty.block.child}\' used outside {block} tags'); $this->smarty->fetch('025_parent.tpl'); } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage '{$smarty.block.parent}' used outside {block} tags * test {$this->smarty.block.parent} outside {block] */ public function testSmartyBlockParentOutsideBlock_026() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('\'{$smarty.block.parent}\' used outside {block} tags'); $this->smarty->fetch('026_child.tpl'); } /** - * @expectedException SmartyException - * @expectedExceptionMessage illegal '{$smarty.block.parent}' * test {$this->smarty.block.parent} in parent template */ public function testSmartyBlockParentInParent_027() { - $result = $this->smarty->fetch('027_parent.tpl'); + $this->expectException('SmartyException'); + $this->expectExceptionMessage('illegal \'{$smarty.block.parent}\''); + $this->smarty->fetch('027_parent.tpl'); } /** @@ -800,8 +800,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty } $this->smarty->assign('foo', '028_parent_include1.tpl'); $result = $this->smarty->fetch('028_child.tpl'); - $this->assertContains('b1-include-1--b1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('b1-include-1--b1', $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -822,8 +822,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty } $this->smarty->assign('foo', '028_parent_include2.tpl'); $result = $this->smarty->fetch('028_child.tpl'); - $this->assertContains('b1-child-i2-include-2--b1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('b1-child-i2-include-2--b1', $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -845,9 +845,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('030_grandchild_nested.tpl'); - $this->assertContains('child pre -grandchild content- child post', $result, $testName . ' - content'); - $this->assertContains('include:' . $testNumber, $result, $testName . ' - content 2'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('child pre -grandchild content- child post', $result, $testName . ' - content'); + $this->assertStringContainsString('include:' . $testNumber, $result, $testName . ' - content 2'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -868,9 +868,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('sub/030_grandchild_nested_rel.tpl'); - $this->assertContains('child pre -grandchild content- child post', $result, $testName . ' - content'); - $this->assertContains('include:' . $testNumber, $result, $testName . ' - content 2'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('child pre -grandchild content- child post', $result, $testName . ' - content'); + $this->assertStringContainsString('include:' . $testNumber, $result, $testName . ' - content 2'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -891,8 +891,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('034_1child.tpl'); - $this->assertContains('parent b1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('parent b1', $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -913,8 +913,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('034_2child.tpl'); - $this->assertContains('parent b1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('parent b1', $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -935,8 +935,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('034_3child.tpl'); - $this->assertContains('parent b1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('parent b1', $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -957,8 +957,8 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('034_4child.tpl'); - $this->assertContains('parent b1', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('parent b1', $result, $testName . ' - content'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -982,9 +982,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('035_child.tpl'); - $this->assertContains('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, + $this->assertStringContainsString('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -1009,9 +1009,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('035_child.tpl'); - $this->assertContains('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, + $this->assertStringContainsString('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -1035,9 +1035,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('035_child.tpl'); - $this->assertContains('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, + $this->assertStringContainsString('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** @@ -1061,9 +1061,9 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('035_child.tpl'); - $this->assertContains('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, + $this->assertStringContainsString('(parent|b)content (child|b)content child b(child|/b) b(parent|/b)', $result, $testName . ' - content'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } @@ -1102,7 +1102,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->loadFilter('post', 'test031'); $this->smarty->assign('foo', 'foo'); $this->smarty->assign('bar', 'bar'); - $this->assertContains('bar', $this->smarty->fetch('031_post_filter.tpl')); + $this->assertStringContainsString('bar', $this->smarty->fetch('031_post_filter.tpl')); } /* * Test new inheritance root in outermost include @@ -1110,11 +1110,11 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty public function testInclude_032() { $result = $this->smarty->fetch('032_child.tpl'); - $this->assertContains('foo in 032_child.tpl', $result); - $this->assertContains('bar in 032_included_child.tpl', $result); - $this->assertContains('foo in 032_included_parent.tpl', $result); - $this->assertNotContains('bar in 032_included_parent.tpl', $result); - $this->assertNotContains('foo in 032_parent.tpl', $result); + $this->assertStringContainsString('foo in 032_child.tpl', $result); + $this->assertStringContainsString('bar in 032_included_child.tpl', $result); + $this->assertStringContainsString('foo in 032_included_parent.tpl', $result); + $this->assertStringNotContainsString('bar in 032_included_parent.tpl', $result); + $this->assertStringNotContainsString('foo in 032_parent.tpl', $result); } /** * test relative includes in {block} @@ -1134,66 +1134,56 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty $this->smarty->setCompileId(1); } $result = $this->smarty->fetch('033_grandchild.tpl'); - $this->assertContains('include grand:content include grand', $result, $testName . ' - grand'); - $this->assertContains('include child:content include child', $result, $testName . ' - grand'); - $this->assertContains('include parent:content include parent', $result, $testName . ' - grand'); - $this->assertContains("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, + $this->assertStringContainsString('include grand:content include grand', $result, $testName . ' - grand'); + $this->assertStringContainsString('include child:content include child', $result, $testName . ' - grand'); + $this->assertStringContainsString('include parent:content include parent', $result, $testName . ' - grand'); + $this->assertStringContainsString("test:{$testNumber} compiled:{$compileTestNumber} rendered:{$renderTestNumber}", $result, $testName . ' - fetch() failure'); } /** - * * test smarty.block.foo - * - * @expectedException SmartyCompilerException - * @expectedExceptionMessage $smarty.block is not defined */ public function testSmartyBlockWrongBlockName_036() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('$smarty.block is not defined'); $this->smarty->fetch('036_parent.tpl'); } /** - * * test '{$smarty.block.parent}' - * - * @expectedException SmartyException - * @expectedExceptionMessage inheritance: illegal '{$smarty.block.parent}' used in child template */ public function testSmartyParentBlockCalledInParent_036_1() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('inheritance: illegal \'{$smarty.block.parent}\' used in child template'); $this->smarty->fetch('036_1_parent.tpl'); } /** - * * test {block_parent} - * - * @expectedException SmartyException - * @expectedExceptionMessage inheritance: illegal '{block_parent}' used in child template */ public function testSmartyParentBlockCalledInParent_036_2() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('inheritance: illegal \'{block_parent}\' used in child template'); $this->smarty->fetch('036_2_parent.tpl'); } /** - * * test {block_parent} - * - * @expectedException SmartyException - * @expectedExceptionMessage inheritance: illegal '{parent}' used in child template */ public function testSmartyParentBlockCalledInParent_036_3() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('inheritance: illegal \'{parent}\' used in child template'); $this->smarty->fetch('036_3_parent.tpl'); } /** - * * test smarty.block - * - * @expectedException SmartyCompilerException - * @expectedExceptionMessage $smarty.block is not defined */ public function testSmartyBlockMissigBlockName_037() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('$smarty.block is not defined'); $this->smarty->fetch('037_parent.tpl'); } diff --git a/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php b/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php index b76b5f7d..ae89049e 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Capture/CompileCaptureTest.php @@ -15,7 +15,7 @@ */ class CompileCaptureTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addTemplateDir("./templates_tmp"); @@ -70,15 +70,15 @@ class CompileCaptureTest extends PHPUnit_Smarty public function testCapture9() { $result = $this->smarty->fetch('009_capture.tpl'); - $this->assertContains('-->hello world<--', $result); - $this->assertContains('-->hello world2<--', $result); + $this->assertStringContainsString('-->hello world<--', $result); + $this->assertStringContainsString('-->hello world2<--', $result); } public function testCompileCaptureNocache1() { $this->smarty->assign('foo', 1); $this->smarty->caching = 1; - $this->assertContains('foo 1', $this->smarty->fetch('test_capture_nocache.tpl')); + $this->assertStringContainsString('foo 1', $this->smarty->fetch('test_capture_nocache.tpl')); } /** @@ -92,7 +92,7 @@ class CompileCaptureTest extends PHPUnit_Smarty $this->smarty->assign('foo', 2); $this->smarty->caching = 1; $this->assertTrue($this->smarty->isCached('test_capture_nocache.tpl')); - $this->assertContains('foo 2', $this->smarty->fetch('test_capture_nocache.tpl')); + $this->assertStringContainsString('foo 2', $this->smarty->fetch('test_capture_nocache.tpl')); } /* * Test capture buffer names with uppercase @@ -100,8 +100,8 @@ class CompileCaptureTest extends PHPUnit_Smarty public function testCapture10() { $result = $this->smarty->fetch('010_capture.tpl'); - $this->assertContains('lowercase', $result); - $this->assertContains('uppercase', $result); + $this->assertStringContainsString('lowercase', $result); + $this->assertStringContainsString('uppercase', $result); } /** diff --git a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/CompilerPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/CompilerPluginTest.php index eca3d1a3..2f455656 100644 --- a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/CompilerPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/CompilerPluginTest.php @@ -15,7 +15,7 @@ */ class CompilerPluginTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/CompileConfigLoadTest.php b/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/CompileConfigLoadTest.php index 50a8a321..3dca1773 100644 --- a/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/CompileConfigLoadTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/ConfigLoad/CompileConfigLoadTest.php @@ -20,7 +20,7 @@ class CompileConfigLoadTest extends PHPUnit_Smarty * This method is called before a test is executed. * */ - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); @@ -161,12 +161,12 @@ class CompileConfigLoadTest extends PHPUnit_Smarty } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage Syntax error in config file * test config file syntax error */ public function testConfigSyntaxError_009() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('Syntax error in config file'); $this->smarty->fetch('009_error.tpl'); } } diff --git a/tests/UnitTests/TemplateSource/TagTests/Delimiter/CompileDelimiterTest.php b/tests/UnitTests/TemplateSource/TagTests/Delimiter/CompileDelimiterTest.php index 16ae980f..c304fa77 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Delimiter/CompileDelimiterTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Delimiter/CompileDelimiterTest.php @@ -15,7 +15,7 @@ */ class CompileDelimiterTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -41,12 +41,10 @@ class CompileDelimiterTest extends PHPUnit_Smarty $this->assertEquals('x}x', $this->smarty->fetch($tpl)); } - /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage nocache option not allowed - */ public function testLeftDelimiterError() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('nocache option not allowed'); $tpl = $this->smarty->createTemplate('string:x{ldelim nocache}x'); $this->assertEquals('x{x', $this->smarty->fetch($tpl)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/Eval/CompileEvalTest.php b/tests/UnitTests/TemplateSource/TagTests/Eval/CompileEvalTest.php index 5053e42d..1a979184 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Eval/CompileEvalTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Eval/CompileEvalTest.php @@ -15,7 +15,7 @@ */ class CompileEvalTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/For/CompileForTest.php b/tests/UnitTests/TemplateSource/TagTests/For/CompileForTest.php index 0a1c5d9d..289fd365 100644 --- a/tests/UnitTests/TemplateSource/TagTests/For/CompileForTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/For/CompileForTest.php @@ -15,7 +15,7 @@ */ class CompileForTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/Foreach/CompileForeachTest.php b/tests/UnitTests/TemplateSource/TagTests/Foreach/CompileForeachTest.php index 0630d6f8..7b181e0d 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Foreach/CompileForeachTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Foreach/CompileForeachTest.php @@ -15,7 +15,7 @@ */ class CompileForeachTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php index 4622e578..e029dbf7 100644 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php @@ -15,7 +15,7 @@ */ class CompileFunctionPluginTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php b/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php index 1eb7bd30..595ff55c 100644 --- a/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php @@ -15,7 +15,7 @@ */ class CompileIfTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php b/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php index 830089ae..69d3f69c 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php @@ -15,7 +15,7 @@ */ class CompileIncludeTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); @@ -187,7 +187,7 @@ class CompileIncludeTest extends PHPUnit_Smarty $this->smarty->assign('foo', 1); $this->smarty->assign('bar', 'bar'); $content = $this->smarty->fetch('test_recursive_includes.tpl'); - $this->assertContains("before 1 bar
\nbefore 2 bar
\nbefore 3 bar
\nafter 3 bar
\nafter 2 bar
\nafter 1 bar
", $content, $text); + $this->assertStringContainsString("before 1 bar
\nbefore 2 bar
\nbefore 3 bar
\nafter 3 bar
\nafter 2 bar
\nafter 1 bar
", $content, $text); } /** @@ -203,7 +203,7 @@ class CompileIncludeTest extends PHPUnit_Smarty $this->smarty->assign('foo', 1); $this->smarty->assign('bar', 'bar'); $content = $this->smarty->fetch('test_recursive_includes2.tpl'); - $this->assertContains("before 1 bar
\nbefore 3 bar
\nbefore 5 bar
\nafter 5 bar
\nafter 3 bar
\nafter 1 bar
", $content, $text); + $this->assertStringContainsString("before 1 bar
\nbefore 3 bar
\nbefore 5 bar
\nafter 5 bar
\nafter 3 bar
\nafter 1 bar
", $content, $text); } /** diff --git a/tests/UnitTests/TemplateSource/TagTests/IncludePhp/CompileIncludePhpTest.php b/tests/UnitTests/TemplateSource/TagTests/IncludePhp/CompileIncludePhpTest.php index acdd1429..6906eac7 100644 --- a/tests/UnitTests/TemplateSource/TagTests/IncludePhp/CompileIncludePhpTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/IncludePhp/CompileIncludePhpTest.php @@ -17,7 +17,7 @@ class CompileIncludePhpTest extends PHPUnit_Smarty { public $loadSmartyBC = true; public $loadSmarty = false; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smartyBC->setForceCompile(true); @@ -36,7 +36,7 @@ class CompileIncludePhpTest extends PHPUnit_Smarty $this->smartyBC->disableSecurity(); $tpl = $this->smartyBC->createTemplate('include_php.tpl'); $result = $this->smartyBC->fetch($tpl); - $this->assertContains("test include php", $result); + $this->assertStringContainsString("test include php", $result); } /** @@ -48,7 +48,7 @@ class CompileIncludePhpTest extends PHPUnit_Smarty $this->smartyBC->security_policy->trusted_dir = '.\\scripts\\'; $tpl = $this->smartyBC->createTemplate('include_php_trusted.tpl'); $result = $this->smartyBC->fetch($tpl); - $this->assertContains("test include php", $result); + $this->assertStringContainsString("test include php", $result); } /** @@ -60,7 +60,7 @@ class CompileIncludePhpTest extends PHPUnit_Smarty $tpl = $this->smartyBC->createTemplate('string:start {include_php file=$filename once=false} end'); $tpl->assign('filename', 'scripts/test_include_php.php'); $result = $this->smartyBC->fetch($tpl); - $this->assertContains("test include php", $result); + $this->assertStringContainsString("test include php", $result); } public function testIncludePhpVariableFileNameShortag() @@ -69,6 +69,6 @@ class CompileIncludePhpTest extends PHPUnit_Smarty $tpl = $this->smartyBC->createTemplate('string:start {include_php $filename once=false} end'); $tpl->assign('filename', 'scripts/test_include_php.php'); $result = $this->smartyBC->fetch($tpl); - $this->assertContains("test include php", $result); + $this->assertStringContainsString("test include php", $result); } } diff --git a/tests/UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php b/tests/UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php index 61e8835c..aa9ba347 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php @@ -15,7 +15,7 @@ */ class CompileInsertTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir(dirname(__FILE__) . "/PHPunitplugins/"); @@ -192,7 +192,7 @@ class CompileInsertTest extends PHPUnit_Smarty $this->smarty->compile_id = 1; $tpl = $this->smarty->createTemplate('insertplugintest.tpl'); $tpl->assign('foo', 'buh'); - $this->assertContains('param foo bar globalvar global 2', $this->smarty->fetch($tpl)); + $this->assertStringContainsString('param foo bar globalvar global 2', $this->smarty->fetch($tpl)); } /** * test insert plugin caching 3 @@ -203,7 +203,7 @@ class CompileInsertTest extends PHPUnit_Smarty { $this->smarty->caching = true; $this->smarty->assign('insert',$t=time()); - $this->assertContains($t.'Inner template', $this->smarty->fetch('insertplugintest2.tpl')); + $this->assertStringContainsString($t.'Inner template', $this->smarty->fetch('insertplugintest2.tpl')); } /** @@ -216,7 +216,7 @@ class CompileInsertTest extends PHPUnit_Smarty sleep(2); $this->smarty->caching = true; $this->smarty->assign('insert',$t=time()); - $this->assertContains($t.'Inner template', $this->smarty->fetch('insertplugintest2.tpl')); + $this->assertStringContainsString($t.'Inner template', $this->smarty->fetch('insertplugintest2.tpl')); } @@ -232,7 +232,7 @@ class CompileInsertTest extends PHPUnit_Smarty $this->smarty->fetch($tpl); } catch (Exception $e) { - $this->assertContains("{insert} no function or plugin found for 'mustfail'", $e->getMessage()); + $this->assertStringContainsString("{insert} no function or plugin found for 'mustfail'", $e->getMessage()); return; } @@ -251,7 +251,7 @@ class CompileInsertTest extends PHPUnit_Smarty $this->smarty->fetch($tpl); } catch (Exception $e) { - $this->assertContains('missing script file', $e->getMessage()); + $this->assertStringContainsString('missing script file', $e->getMessage()); return; } diff --git a/tests/UnitTests/TemplateSource/TagTests/Literal/LiteralTest.php b/tests/UnitTests/TemplateSource/TagTests/Literal/LiteralTest.php index 972f9e25..6cb608bd 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Literal/LiteralTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Literal/LiteralTest.php @@ -15,7 +15,7 @@ */ class LiteralTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/MakeNocache/CompileMakeNocacheTest.php b/tests/UnitTests/TemplateSource/TagTests/MakeNocache/CompileMakeNocacheTest.php index 718c7313..daf85774 100644 --- a/tests/UnitTests/TemplateSource/TagTests/MakeNocache/CompileMakeNocacheTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/MakeNocache/CompileMakeNocacheTest.php @@ -15,7 +15,7 @@ */ class CompileMakeNocacheTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/TemplateSource/TagTests/Nocache/CompileNocacheTest.php b/tests/UnitTests/TemplateSource/TagTests/Nocache/CompileNocacheTest.php index a0a7e373..332e4919 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Nocache/CompileNocacheTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Nocache/CompileNocacheTest.php @@ -15,7 +15,7 @@ */ class CompileNocacheTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -34,13 +34,13 @@ class CompileNocacheTest extends PHPUnit_Smarty $this->smarty->assign('foo', 0); $this->smarty->assign('bar', 'A'); $content = $this->smarty->fetch('test_nocache_tag.tpl'); - $this->assertContains("root 2A", $content); - $this->assertContains("include 4A", $content); + $this->assertStringContainsString("root 2A", $content); + $this->assertStringContainsString("include 4A", $content); $this->smarty->assign('foo', 2); $this->smarty->assign('bar', 'B'); $content = $this->smarty->fetch('test_nocache_tag.tpl'); - $this->assertContains("root 4B", $content); - $this->assertContains("include 6B", $content); + $this->assertStringContainsString("root 4B", $content); + $this->assertStringContainsString("include 6B", $content); } /** @@ -52,8 +52,8 @@ class CompileNocacheTest extends PHPUnit_Smarty $this->smarty->assign('foo', 0); $this->smarty->assign('bar', 'A'); $content = $this->smarty->fetch('test_nocache_tag.tpl'); - $this->assertContains("root 2A", $content); - $this->assertContains("include 4A", $content); + $this->assertStringContainsString("root 2A", $content); + $this->assertStringContainsString("include 4A", $content); } @@ -69,7 +69,7 @@ class CompileNocacheTest extends PHPUnit_Smarty $this->smarty->assign('foo', 2); $this->smarty->assign('bar', 'B'); $content = $this->smarty->fetch('test_nocache_tag.tpl'); - $this->assertContains("root 4A", $content); - $this->assertContains("include 6A", $content); + $this->assertStringContainsString("root 4A", $content); + $this->assertStringContainsString("include 6A", $content); } } diff --git a/tests/UnitTests/TemplateSource/TagTests/Php/CompilePhpTest.php b/tests/UnitTests/TemplateSource/TagTests/Php/CompilePhpTest.php index fb34e9f4..8e65da96 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Php/CompilePhpTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Php/CompilePhpTest.php @@ -16,7 +16,7 @@ class CompilePhpTest extends PHPUnit_Smarty { public $loadSmartyBC = true; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->setUseSubDirs(true); @@ -79,13 +79,11 @@ class CompilePhpTest extends PHPUnit_Smarty $content = $tpl->fetch(); $this->assertEquals($result, $content, $testName); } - /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage $smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it - */ public function testPHP_ALLOW_error() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it'); $this->smarty->setPhpHandling(Smarty::PHP_ALLOW); $content = $this->smarty->fetch("string:aa ae"); } @@ -112,13 +110,12 @@ class CompilePhpTest extends PHPUnit_Smarty } /** * test {php no cache}illegal option - * @expectedException SmartyCompilerException - * @expectedExceptionMessage illegal value of option flag 'no cache' - * */ public function testPHP_Tag_IllegalOption() { - $content = $this->smartyBC->fetch("string:aa {php no cache} echo 'hallo'; {/php} ae"); + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('illegal value of option flag \'no cache\''); + $this->smartyBC->fetch("string:aa {php no cache} echo 'hallo'; {/php} ae"); } /** diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginBlock/PluginBlockTextformatTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginBlock/PluginBlockTextformatTest.php index 382c73ce..9ee5e315 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginBlock/PluginBlockTextformatTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginBlock/PluginBlockTextformatTest.php @@ -17,7 +17,7 @@ class PluginBlockTextformatTest extends PHPUnit_Smarty { protected $string = "\n\nThis is foo.\nThis is foo.\nThis is foo.\nThis is foo.\nThis is foo.\nThis is foo.\n\nThis is bar.\n\nbar foo bar foo foo.\nbar foo bar foo foo.\nbar foo bar foo foo.\nbar foo bar foo foo.\nbar foo bar foo foo.\nbar foo bar foo foo.\nbar foo bar foo foo.\n\n"; - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php index acea7def..c09a26ed 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php @@ -15,7 +15,7 @@ */ class PluginFunctionFetchTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -34,52 +34,52 @@ class PluginFunctionFetchTest extends PHPUnit_Smarty */ public function testFetchUri() { - $this->assertContains('Preface | Smarty', $this->smarty->fetch('string:{fetch file="https://www.smarty.net/docs/en/preface.tpl"}')); + $this->assertStringContainsString('Preface | Smarty', $this->smarty->fetch('string:{fetch file="https://www.smarty.net/docs/en/preface.tpl"}')); } /** * test {fetch} invalid uri * -* @expectedException SmartyException -* @expectedExceptionMessage {fetch} cannot read resource 'https://foo.smarty.net/foo.dat' * @runInSeparateProcess * @preserveGlobalState disabled */ public function testFetchInvalidUri() { - $result = $this->smarty->fetch('string:{fetch file="https://foo.smarty.net/foo.dat"}'); + $this->expectException('SmartyException'); + $this->expectExceptionMessage('{fetch} cannot read resource \'https://foo.smarty.net/foo.dat\''); + $this->smarty->fetch('string:{fetch file="https://foo.smarty.net/foo.dat"}'); } /** * test {fetch file=...} access to file from path not aloo/wed by security settings * - * @expectedException SmartyException - * @expectedExceptionMessage not trusted file path * @run InSeparateProcess * @preserveGlobalState disabled */ public function testFetchSecurity() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('not trusted file path'); $this->cleanDirs(); $dir=$this->smarty->getTemplateDir(); $this->smarty->enableSecurity(); - $result = $this->smarty->fetch('string:{fetch file=\''. $dir[0]. '../../../../../etc/passwd\'}'); + $this->smarty->fetch('string:{fetch file=\''. $dir[0]. '../../../../../etc/passwd\'}'); } /** * test {fetch file=...} access to file from path not aloo/wed by security settings * - * @expectedException SmartyException - * @expectedExceptionMessage not trusted file path * @run InSeparateProcess * @preserveGlobalState disabled */ public function testFetchSecurity2() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('not trusted file path'); $this->cleanDirs(); - $dir=$this->smarty->getTemplateDir(); + $this->smarty->getTemplateDir(); $this->smarty->enableSecurity(); $this->smarty->setTemplateDir('/templates'); - $result = $this->smarty->fetch('string:{fetch file="/templates/../etc/passwd"}'); + $this->smarty->fetch('string:{fetch file="/templates/../etc/passwd"}'); } } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlCheckboxesTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlCheckboxesTest.php index 2e4d6e68..5ea998fd 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlCheckboxesTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlCheckboxesTest.php @@ -17,7 +17,7 @@ require_once(dirname(__FILE__) . '/helpers/_object_tostring.php'); */ class PluginFunctionHtmlCheckboxesTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlImageTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlImageTest.php index 4293450f..027d12cc 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlImageTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlImageTest.php @@ -15,7 +15,7 @@ */ class PluginFunctionHtmlImageTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlOptionsTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlOptionsTest.php index d9182c4e..039a5eec 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlOptionsTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlOptionsTest.php @@ -17,7 +17,7 @@ require_once(dirname(__FILE__) . '/helpers/_object_tostring.php'); */ class PluginFunctionHtmlOptionsTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlRadiosTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlRadiosTest.php index 819d1049..57a3ecc5 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlRadiosTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlRadiosTest.php @@ -16,7 +16,7 @@ require_once(dirname(__FILE__) . '/helpers/_object_tostring.php'); */ class PluginFunctionHtmlRadiosTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectDateTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectDateTest.php index 8f4f79de..84e74bb8 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectDateTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectDateTest.php @@ -207,7 +207,7 @@ class PluginFunctionHtmlSelectDateTest extends PHPUnit_Smarty ', ); - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectTimeTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectTimeTest.php index f152a8e8..acef4694 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectTimeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionHtmlSelectTimeTest.php @@ -15,7 +15,7 @@ */ class PluginFunctionHtmlSelectTimeTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->now = mktime(16, 15, 11, 2, 20, 2011); diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionMailtoTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionMailtoTest.php index 2ea16ce5..e22d8ef3 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionMailtoTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionMailtoTest.php @@ -15,7 +15,7 @@ */ class PluginFunctionMailtoTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCapitalizeTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCapitalizeTest.php index a78dce31..59b34fa8 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCapitalizeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCapitalizeTest.php @@ -15,7 +15,7 @@ */ class PluginModifierCapitalizeTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCharsetTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCharsetTest.php index 87fd673f..d960b23e 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCharsetTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCharsetTest.php @@ -15,7 +15,7 @@ */ class PluginModifierCharsetTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountCharactersTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountCharactersTest.php index b2026cc8..df92c71a 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountCharactersTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountCharactersTest.php @@ -15,7 +15,7 @@ */ class PluginModifierCountCharactersTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountSentencesTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountSentencesTest.php index acca87cb..a1a055b3 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountSentencesTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountSentencesTest.php @@ -15,7 +15,7 @@ */ class PluginModifierCountSentencesTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountWordsTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountWordsTest.php index 2da98e1b..7684a39b 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountWordsTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierCountWordsTest.php @@ -15,7 +15,7 @@ */ class PluginModifierCountWordsTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierEscapeTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierEscapeTest.php index afabe71a..46a8297f 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierEscapeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierEscapeTest.php @@ -15,7 +15,7 @@ */ class PluginModifierEscapeTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierLowerTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierLowerTest.php index e465c7b9..b5fe9e41 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierLowerTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierLowerTest.php @@ -14,7 +14,7 @@ */ class PluginModifierLowerTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierRegexReplaceTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierRegexReplaceTest.php index 88ce0982..b0fed84d 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierRegexReplaceTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierRegexReplaceTest.php @@ -15,7 +15,7 @@ */ class PluginModifierRegexReplaceTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierSpacifyTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierSpacifyTest.php index 2ccd6cdb..55323845 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierSpacifyTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierSpacifyTest.php @@ -15,7 +15,7 @@ */ class PluginModifierSpacifyTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierStripTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierStripTest.php index 9dc7bdf3..4383f965 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierStripTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierStripTest.php @@ -15,7 +15,7 @@ */ class PluginModifierStripTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierTruncateTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierTruncateTest.php index 7af50af6..a6105817 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierTruncateTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierTruncateTest.php @@ -15,7 +15,7 @@ */ class PluginModifierTruncateTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierUnescapeTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierUnescapeTest.php index 608eb5c4..c08adf95 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierUnescapeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierUnescapeTest.php @@ -15,7 +15,7 @@ */ class PluginModifierUnescapeTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierUpperTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierUpperTest.php index fb96fa5b..d4bff113 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierUpperTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierUpperTest.php @@ -15,7 +15,7 @@ */ class PluginModifierUpperTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierWordwrapTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierWordwrapTest.php index bd94590d..c65ab3a7 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierWordwrapTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginModifier/PluginModifierWordwrapTest.php @@ -15,7 +15,7 @@ */ class PluginModifierWordwrapTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php b/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php index 0cedbcfd..9e422f34 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Section/CompileSectionTest.php @@ -15,7 +15,7 @@ */ class CompileSectionTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php b/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php index 89b187e5..1dcbaf37 100644 --- a/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php @@ -15,7 +15,7 @@ */ class CompileSetfilterTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php index cc850d38..ae9f0e69 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php @@ -15,7 +15,7 @@ */ class CompileStripTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php index d2be82ca..a174f5a0 100644 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php @@ -15,7 +15,7 @@ */ class CompileFunctionTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -196,7 +196,7 @@ class CompileFunctionTest extends PHPUnit_Smarty $this->smarty->cache_lifetime = 1000; $tpl = $this->smarty->createTemplate('test_template_function.tpl', $cacheId); $tpl->assign('foo', 'foo'); - $this->assertContains('foo foo', $this->smarty->fetch($tpl), $text); + $this->assertStringContainsString('foo foo', $this->smarty->fetch($tpl), $text); } /** @@ -208,9 +208,9 @@ class CompileFunctionTest extends PHPUnit_Smarty public function testExternalDefinedFunctionCalledByFetch() { $this->smarty->assign('foo', 'foo'); - $this->assertContains('foo foo', $this->smarty->fetch('test_template_function.tpl')); + $this->assertStringContainsString('foo foo', $this->smarty->fetch('test_template_function.tpl')); $this->smarty->assign('foo', 'bar'); - $this->assertContains('bar bar', $this->smarty->fetch('test_template_function_call.tpl')); + $this->assertStringContainsString('bar bar', $this->smarty->fetch('test_template_function_call.tpl')); } /** @@ -229,7 +229,7 @@ class CompileFunctionTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('test_template_function.tpl', $cacheId); $this->assertTrue($this->smarty->isCached($tpl), $text); $tpl->assign('foo', 'bar'); - $this->assertContains('foo bar', $this->smarty->fetch($tpl), $text); + $this->assertStringContainsString('foo bar', $this->smarty->fetch($tpl), $text); } /** @@ -247,7 +247,7 @@ class CompileFunctionTest extends PHPUnit_Smarty $this->smarty->cache_lifetime = 1000; $tpl = $this->smarty->createTemplate('test_template_function_nocache_call.tpl', $cacheId); $tpl->assign('foo', 'foo'); - $this->assertContains('foo foo', $this->smarty->fetch($tpl), $text); + $this->assertStringContainsString('foo foo', $this->smarty->fetch($tpl), $text); } /** @@ -266,7 +266,7 @@ class CompileFunctionTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('test_template_function_nocache_call.tpl', $cacheId); $this->assertTrue($this->smarty->isCached($tpl), $text); $tpl->assign('foo', 'bar'); - $this->assertContains('bar bar', $this->smarty->fetch($tpl), $text); + $this->assertStringContainsString('bar bar', $this->smarty->fetch($tpl), $text); } /** @@ -285,7 +285,7 @@ class CompileFunctionTest extends PHPUnit_Smarty $tpl = $this->smarty->createTemplate('test_template_function_nocache_call.tpl', $cacheId); $this->assertTrue($this->smarty->isCached($tpl), $text); $tpl->assign('foo', 'bar'); - $this->assertContains('bar bar', $this->smarty->fetch($tpl), $text); + $this->assertStringContainsString('bar bar', $this->smarty->fetch($tpl), $text); } /** diff --git a/tests/UnitTests/TemplateSource/TagTests/While/CompileWhileTest.php b/tests/UnitTests/TemplateSource/TagTests/While/CompileWhileTest.php index 78fe828a..a808aec9 100644 --- a/tests/UnitTests/TemplateSource/TagTests/While/CompileWhileTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/While/CompileWhileTest.php @@ -15,7 +15,7 @@ */ class CompileWhileTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php b/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php index b3fe851f..1cc845e9 100644 --- a/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/_Attributes/AttributeTest.php @@ -15,7 +15,7 @@ */ class AttributeTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); @@ -28,43 +28,43 @@ class AttributeTest extends PHPUnit_Smarty } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage missing 'var' attribute * test required attribute */ public function testRequiredAttributeVar() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('missing \'var\' attribute'); $this->smarty->fetch('string:{assign value=1}'); } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage unexpected 'bar' attribute * test unexpected attribute */ public function testUnexpectedAttribute() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('unexpected \'bar\' attribute'); $this->smarty->fetch('string:{assign var=foo value=1 bar=2}'); } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage for option flag 'nocache' - * @expectedExceptionMessage illegal value * test illegal option value */ public function testIllegalOptionValue() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('for option flag \'nocache\''); + $this->expectExceptionMessage('illegal value'); $this->smarty->fetch('string:{assign var=foo value=1 nocache=buh}'); } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage too many shorthand attributes * test too many shorthands */ public function testTooManyShorthands() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('too many shorthand attributes'); $this->smarty->fetch('string:{assign foo 1 2}'); } diff --git a/tests/UnitTests/TemplateSource/TagTests/_Error/CompileErrorTest.php b/tests/UnitTests/TemplateSource/TagTests/_Error/CompileErrorTest.php index b190c5ff..59a4b8f7 100644 --- a/tests/UnitTests/TemplateSource/TagTests/_Error/CompileErrorTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/_Error/CompileErrorTest.php @@ -15,7 +15,7 @@ */ class CompileErrorTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -26,42 +26,42 @@ class CompileErrorTest extends PHPUnit_Smarty } /** - * @expectedException SmartyException - * @expectedExceptionMessage no.tpl * test none existing template file error */ public function testNoneExistingTemplateError() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('no.tpl'); $this->smarty->fetch('eval:{include file=\'no.tpl\'}'); } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage unknown tag 'unknown' * test unkown tag error */ public function testUnknownTagError() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('unknown tag \'unknown\''); $this->smarty->fetch('eval:{unknown}'); } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage unclosed {if} tag * test unclosed tag error */ public function testUnclosedTagError() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('unclosed {if} tag'); $this->smarty->fetch('eval:{if true}'); } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage Unexpected "}" * test syntax error */ public function testSyntaxError() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('Unexpected "}"'); $this->smarty->fetch('eval:{assign var=}'); } } diff --git a/tests/UnitTests/TemplateSource/TagTests/_Print/PrintTest.php b/tests/UnitTests/TemplateSource/TagTests/_Print/PrintTest.php index 6c5d624a..b856a969 100644 --- a/tests/UnitTests/TemplateSource/TagTests/_Print/PrintTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/_Print/PrintTest.php @@ -15,7 +15,7 @@ */ class PrintTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/TagTests/break/CompileBreakTest.php b/tests/UnitTests/TemplateSource/TagTests/break/CompileBreakTest.php index 7594678a..e0a68ff6 100644 --- a/tests/UnitTests/TemplateSource/TagTests/break/CompileBreakTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/break/CompileBreakTest.php @@ -15,7 +15,7 @@ */ class CompileBreakTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/Array/ArrayTest.php b/tests/UnitTests/TemplateSource/ValueTests/Array/ArrayTest.php index d8f5cd63..67868bb8 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Array/ArrayTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Array/ArrayTest.php @@ -15,7 +15,7 @@ */ class ArrayTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php index 9fba0bac..20eed17b 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php @@ -15,7 +15,7 @@ */ class BooleanNullTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/ConstantsTest.php b/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/ConstantsTest.php index 42f9df6f..33bfd353 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/ConstantsTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/ConstantTests/ConstantsTest.php @@ -19,7 +19,7 @@ Class TestConst */ class ConstantsTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php index 0b647b4c..646dd115 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/DoubleQuoted/DoubleQuotedStringTest.php @@ -15,7 +15,7 @@ */ class DoubleQuotedStringTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); @@ -80,14 +80,12 @@ class DoubleQuotedStringTest extends PHPUnit_Smarty /** - * * test unclosed block tag - * - * @expectedException SmartyCompilerException - * @expectedExceptionMessage unclosed '{if}' in doubled quoted string */ public function testDoubleQuotedUnclosedBlock_001() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('unclosed \'{if}\' in doubled quoted string'); $this->smarty->fetch('001_unclosedBlock.tpl'); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php b/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php index ff0b3a1c..9c45d36e 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Math/MathTest.php @@ -15,7 +15,7 @@ */ class MathTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php b/tests/UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php index 2dc1751b..7c2d73c3 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Modifier/ModifierTest.php @@ -15,7 +15,7 @@ */ class ModifierTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addTemplateDir("./templates_tmp"); @@ -96,12 +96,12 @@ class ModifierTest extends PHPUnit_Smarty } /** - * @expectedException SmartyCompilerException - * @expectedExceptionMessage unknown modifier 'unknown' * test unknown modifier error */ public function testUnknownModifier() { + $this->expectException('SmartyCompilerException'); + $this->expectExceptionMessage('unknown modifier \'unknown\''); $this->smarty->fetch('eval:{"hello world"|unknown}'); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/Objects/ObjectVariableTest.php b/tests/UnitTests/TemplateSource/ValueTests/Objects/ObjectVariableTest.php index 717b94e8..4180dbac 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Objects/ObjectVariableTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Objects/ObjectVariableTest.php @@ -15,7 +15,7 @@ */ class ObjectVariableTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->setForceCompile(true); diff --git a/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/PhpFunctionTest.php b/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/PhpFunctionTest.php index 7534e024..09144be2 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/PhpFunctionTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/PHPfunctions/PhpFunctionTest.php @@ -17,7 +17,7 @@ */ class PhpFunctionTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/SingleQuotedStringTest.php b/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/SingleQuotedStringTest.php index 41378e1b..b55871bb 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/SingleQuotedStringTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SingleQouted/SingleQuotedStringTest.php @@ -15,7 +15,7 @@ */ class SingleQuotedStringTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php index 179f7123..990d686b 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Constant/SmartyConstantTest.php @@ -15,7 +15,7 @@ */ class SmartyConstantTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/CookieTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/CookieTest.php index cb92b776..e6e3dc44 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/CookieTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Cookie/CookieTest.php @@ -15,7 +15,7 @@ */ class CookieTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/SmartyDelimiterTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/SmartyDelimiterTest.php index 3a298362..0b1bd1d4 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/SmartyDelimiterTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Delimiter/SmartyDelimiterTest.php @@ -15,7 +15,7 @@ */ class SmartyDelimiterTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/SmartyErrorTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/SmartyErrorTest.php index b14c271c..7814736a 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/SmartyErrorTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Error/SmartyErrorTest.php @@ -15,7 +15,7 @@ */ class SmartyErrorTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } @@ -25,12 +25,11 @@ class SmartyErrorTest extends PHPUnit_Smarty $this->cleanDirs(); } /** - * @expectedException SmartyException - * @expectedExceptionMessage $smarty.foo is not defined * test undefined Smarty special variable - * */ public function testSmartyError() { + $this->expectException('SmartyException'); + $this->expectExceptionMessage('$smarty.foo is not defined'); $this->assertEquals(Smarty::SMARTY_VERSION, $this->smarty->fetch('error.tpl')); } } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/SmartyNowTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/SmartyNowTest.php index 724f2bf5..64a07f6c 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/SmartyNowTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Now/SmartyNowTest.php @@ -15,7 +15,7 @@ */ class SmartyNowTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/PostTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/PostTest.php index a49e44d8..f924edb8 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/PostTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Post/PostTest.php @@ -15,7 +15,7 @@ */ class PostTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/SmartyTemplateObjectTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/SmartyTemplateObjectTest.php index 6f661b4d..4f24f4eb 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/SmartyTemplateObjectTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/TemplateObject/SmartyTemplateObjectTest.php @@ -15,7 +15,7 @@ */ class SmartyTemplateObjectTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/SmartyVersionTest.php b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/SmartyVersionTest.php index 733609a3..518e42f3 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/SmartyVersionTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/SmartySpecialVars/Version/SmartyVersionTest.php @@ -15,7 +15,7 @@ */ class SmartyVersionTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php index 670324f1..09e31373 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php @@ -15,7 +15,7 @@ */ class StreamVariableTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); @@ -31,7 +31,7 @@ class StreamVariableTest extends PHPUnit_Smarty $this->cleanDirs(); } - public function tearDown() + protected function tearDown(): void { parent::tearDown(); stream_wrapper_unregister("var"); diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/VariableVariableTest.php b/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/VariableVariableTest.php index cbd7c662..3e45a204 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/VariableVariableTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Variables/VariableVariable/VariableVariableTest.php @@ -15,7 +15,7 @@ */ class VariableVariableTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php b/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php index e546b670..d12d0f8d 100644 --- a/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php +++ b/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php @@ -15,7 +15,7 @@ */ class ScopeTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->addPluginsDir("../../__shared/PHPunitplugins/"); diff --git a/tests/UnitTests/TemplateSource/Xml/XmlTest.php b/tests/UnitTests/TemplateSource/Xml/XmlTest.php index 9690a35c..cff87631 100644 --- a/tests/UnitTests/TemplateSource/Xml/XmlTest.php +++ b/tests/UnitTests/TemplateSource/Xml/XmlTest.php @@ -15,7 +15,7 @@ */ class XmlTest extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); $this->smarty->enableSecurity(); diff --git a/tests/UnitTests/TemplateSource/_Issues/327/ModifierIssue327Test.php b/tests/UnitTests/TemplateSource/_Issues/327/ModifierIssue327Test.php index ecbf045d..8418ea3e 100644 --- a/tests/UnitTests/TemplateSource/_Issues/327/ModifierIssue327Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/327/ModifierIssue327Test.php @@ -15,7 +15,7 @@ */ class ModifierIssue327Test extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php b/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php index 1f969291..d6358a5c 100644 --- a/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php @@ -15,7 +15,7 @@ */ class ExtendsIssue419Test extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php b/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php index c541b3cb..4a772789 100644 --- a/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php @@ -17,7 +17,7 @@ */ class NestedLoopIssue422Test extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.php b/tests/UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.php index 7c900349..1b0fbc06 100644 --- a/tests/UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/428/SectionPropertiesShortSyntaxIssue428Test.php @@ -17,7 +17,7 @@ */ class SectionPropertiesShortSyntaxIssue428Test extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); } diff --git a/tests/UnitTests/TemplateSource/_Issues/topic26878/NewlineSpacing.php b/tests/UnitTests/TemplateSource/_Issues/topic26878/NewlineSpacing.php index 6feac558..b1f34d39 100644 --- a/tests/UnitTests/TemplateSource/_Issues/topic26878/NewlineSpacing.php +++ b/tests/UnitTests/TemplateSource/_Issues/topic26878/NewlineSpacing.php @@ -15,7 +15,7 @@ */ class NewlineSpacing extends PHPUnit_Smarty { - public function setUp() + public function setUp(): void { $this->setUpSmarty(dirname(__FILE__)); }