1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

Made it easier to debug a single plugin. Added extra checks in the linksword plugin test. Disabled empty db_verify tests.

This commit is contained in:
Cameron
2018-07-23 14:02:30 -07:00
parent 3c8e52af93
commit 0a1d768840
3 changed files with 35 additions and 7 deletions

View File

@@ -11,7 +11,7 @@
class db_verifyTest extends \Codeception\Test\Unit class db_verifyTest extends \Codeception\Test\Unit
{ {
/*
public function testGetFields() public function testGetFields()
{ {
@@ -115,5 +115,5 @@
public function testGetSqlLanguages() public function testGetSqlLanguages()
{ {
} }*/
} }

View File

@@ -65,6 +65,22 @@
$actual = $this->arrObj->unserialize($string_4); $actual = $this->arrObj->unserialize($string_4);
$this->assertArrayHasKey('json', $actual); $this->assertArrayHasKey('json', $actual);
// case linkwords prefs.
$string_5 = "array (
'OLDDEFAULT' => '',
'TITLE' => '',
'SUMMARY' => 1,
'BODY' => 1,
'DESCRIPTION'=> 1,
'USER_TITLE' => '',
'USER_BODY' => 1,
'LINKTEXT' => '',
'RAWTEXT' => ''
)";
$actual = $this->arrObj->unserialize($string_5);
$this->assertArrayHasKey('TITLE', $actual);
} }
/* /*

View File

@@ -12,7 +12,7 @@
class pluginsTest extends \Codeception\Test\Unit class pluginsTest extends \Codeception\Test\Unit
{ {
// protected $_plg; protected $_debugPlugin = false; // 'linkwords'; // add plugin-dir for full report.
protected function _before() protected function _before()
{ {
@@ -26,8 +26,9 @@
}*/ }*/
} }
private function makePluginReport($pluginDir, $debug=false) private function makePluginReport($pluginDir)
{ {
$debug = $this->_debugPlugin;
$debug_text = "\n\n---- Log \n\n"; $debug_text = "\n\n---- Log \n\n";
$log = e107::getPlugin()->getLog(); $log = e107::getPlugin()->getLog();
@@ -100,9 +101,10 @@
$debug_text .= "-------------------------------------------------------------------\n"; $debug_text .= "-------------------------------------------------------------------\n";
if($debug === true) if(!empty($debug) && $pluginDir === $debug)
{ {
codecept_debug($debug_text); codecept_debug($debug_text);
echo $debug_text;
} }
return array( return array(
@@ -185,7 +187,17 @@
public function testLinkwords() public function testLinkwords()
{ {
$this->pluginInstall('linkwords'); $this->pluginInstall('linkwords');
$pref1 = e107::pref('core', 'lw_custom_class');
$this->assertNotEmpty($pref1);
$pref2 = e107::pref('core', 'lw_context_visibility');
$this->assertNotEmpty($pref2['SUMMARY']);
$this->pluginUninstall('linkwords'); $this->pluginUninstall('linkwords');
$pref2 = e107::pref('core', 'lw_context_visibility');
$this->assertEmpty($pref2);
} }
public function testPm() public function testPm()
@@ -223,7 +235,7 @@
e107::getPlugin()->install($pluginDir); e107::getPlugin()->install($pluginDir);
$install = $this->makePluginReport($pluginDir, false); // set to true to see more info $install = $this->makePluginReport($pluginDir);
//todo additional checks //todo additional checks
@@ -242,7 +254,7 @@
e107::getPlugin()->uninstall($pluginDir, $opts); e107::getPlugin()->uninstall($pluginDir, $opts);
$uninstall = $this->makePluginReport($pluginDir, false); // set to true to see more info $uninstall = $this->makePluginReport($pluginDir);
//todo additional checks //todo additional checks