mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 07:36:32 +02:00
Truncate extended table if _system_ fields found. (eg. from forum test)
This commit is contained in:
@@ -871,7 +871,7 @@ class e107Test extends \Codeception\Test\Unit
|
|||||||
e_PLUGIN_ABS . 'forum/forum_viewtopic.php?f=post&id=123',
|
e_PLUGIN_ABS . 'forum/forum_viewtopic.php?f=post&id=123',
|
||||||
$url, "Generated href does not match expectation"
|
$url, "Generated href does not match expectation"
|
||||||
);
|
);
|
||||||
e107::getDb()->truncate('user_extended_struct');// reset.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUrlOptionQueryUrlEncoded()
|
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',
|
'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"
|
$url, "Generated href query string did not have expected URL encoding"
|
||||||
);
|
);
|
||||||
e107::getDb()->truncate('user_extended_struct');// reset.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUrlEscapesHtmlSpecialChars()
|
public function testUrlEscapesHtmlSpecialChars()
|
||||||
@@ -906,7 +906,7 @@ class e107Test extends \Codeception\Test\Unit
|
|||||||
'forum/<>/#Arts & Crafts <tag attr="can't inject here"></tag>',
|
'forum/<>/#Arts & Crafts <tag attr="can't inject here"></tag>',
|
||||||
$url, "Generated href did not prevent HTML tag injection as expected"
|
$url, "Generated href did not prevent HTML tag injection as expected"
|
||||||
);
|
);
|
||||||
e107::getDb()->truncate('user_extended_struct');// reset.
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
public function testRedirect()
|
public function testRedirect()
|
||||||
|
@@ -94,7 +94,12 @@
|
|||||||
'country' => 17,
|
'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.
|
// Add a field of each type.
|
||||||
@@ -273,13 +278,15 @@
|
|||||||
|
|
||||||
foreach($this->userValues as $field => $value)
|
foreach($this->userValues as $field => $value)
|
||||||
{
|
{
|
||||||
if(empty($value))
|
if(!isset($legacyExpectedIcons[$field]))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$parm = $field.'.icon.1';
|
$parm = $field.'.icon.1';
|
||||||
$result = (string) $tp->parseTemplate('{USER_EXTENDED='.$parm.'}', true); // retrieve value for $field of user_id: 1.
|
$result = (string) $tp->parseTemplate('{USER_EXTENDED='.$parm.'}', true); // retrieve value for $field of user_id: 1.
|
||||||
|
|
||||||
|
|
||||||
$this->assertStringContainsString($legacyExpectedIcons[$field], $result);
|
$this->assertStringContainsString($legacyExpectedIcons[$field], $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -180,7 +180,7 @@
|
|||||||
{
|
{
|
||||||
$this->pluginInstall('forum');
|
$this->pluginInstall('forum');
|
||||||
$this->pluginUninstall('forum');
|
$this->pluginUninstall('forum');
|
||||||
e107::getDb()->truncate('user_extended_struct'); // clear the table
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGallery()
|
public function testGallery()
|
||||||
|
Reference in New Issue
Block a user