diff --git a/e107_tests/tests/unit/e107Test.php b/e107_tests/tests/unit/e107Test.php index 6a5da6773..230d6be54 100644 --- a/e107_tests/tests/unit/e107Test.php +++ b/e107_tests/tests/unit/e107Test.php @@ -871,7 +871,7 @@ class e107Test extends \Codeception\Test\Unit e_PLUGIN_ABS . 'forum/forum_viewtopic.php?f=post&id=123', $url, "Generated href does not match expectation" ); - e107::getDb()->truncate('user_extended_struct');// reset. + } public function testUrlOptionQueryUrlEncoded() @@ -889,7 +889,7 @@ class e107Test extends \Codeception\Test\Unit 'forum/post/?didn%27t=%3Ctag%20attr%3D%22such%20wow%22%3E%3C/tag%3E&did=much%20doge', $url, "Generated href query string did not have expected URL encoding" ); - e107::getDb()->truncate('user_extended_struct');// reset. + } public function testUrlEscapesHtmlSpecialChars() @@ -906,7 +906,7 @@ class e107Test extends \Codeception\Test\Unit 'forum/<>/#Arts & Crafts <tag attr="can't inject here"></tag>', $url, "Generated href did not prevent HTML tag injection as expected" ); - e107::getDb()->truncate('user_extended_struct');// reset. + } /* public function testRedirect() diff --git a/e107_tests/tests/unit/e107_user_extendedTest.php b/e107_tests/tests/unit/e107_user_extendedTest.php index 693be6966..516940c54 100644 --- a/e107_tests/tests/unit/e107_user_extendedTest.php +++ b/e107_tests/tests/unit/e107_user_extendedTest.php @@ -94,7 +94,12 @@ 'country' => 17, ); - + // clear the table. + $sql = e107::getDb(); + if($sql->select('user_extended_struct', 'user_extended_struct_id', "user_extended_struct_text = '_system_'")) + { + $sql->truncate('user_extended_struct'); + } // Add a field of each type. @@ -273,13 +278,15 @@ foreach($this->userValues as $field => $value) { - if(empty($value)) + if(!isset($legacyExpectedIcons[$field])) { continue; } $parm = $field.'.icon.1'; $result = (string) $tp->parseTemplate('{USER_EXTENDED='.$parm.'}', true); // retrieve value for $field of user_id: 1. + + $this->assertStringContainsString($legacyExpectedIcons[$field], $result); } diff --git a/e107_tests/tests/unit/pluginsTest.php b/e107_tests/tests/unit/pluginsTest.php index 48038777a..7a6ba3839 100644 --- a/e107_tests/tests/unit/pluginsTest.php +++ b/e107_tests/tests/unit/pluginsTest.php @@ -180,7 +180,7 @@ { $this->pluginInstall('forum'); $this->pluginUninstall('forum'); - e107::getDb()->truncate('user_extended_struct'); // clear the table + } public function testGallery()