mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
Added plugin cache test. Removed 'thing' folders automatically after testing.
This commit is contained in:
@@ -80,12 +80,14 @@ DATA
|
|||||||
|
|
||||||
if(is_dir($path))
|
if(is_dir($path))
|
||||||
{
|
{
|
||||||
rename($path, $path."_old_".time());
|
e107::getFile()->removeDir($path);
|
||||||
|
// rename($path, $path."_old_".time());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_dir($tempPath))
|
if(is_dir($tempPath))
|
||||||
{
|
{
|
||||||
rename($tempPath, $tempPath."_old_".time());
|
e107::getFile()->removeDir($tempPath);
|
||||||
|
// rename($tempPath, $tempPath."_old_".time());
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = $this->mp->download($id,'','plugin' );
|
$status = $this->mp->download($id,'','plugin' );
|
||||||
|
@@ -61,6 +61,37 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testClearCache()
|
||||||
|
{
|
||||||
|
|
||||||
|
$detected = $this->ep->clearCache()->getDetected();
|
||||||
|
$num = e107::getDb()->count('plugin','(*)');
|
||||||
|
$det = count($detected);
|
||||||
|
$this->assertEquals($num,$det);
|
||||||
|
|
||||||
|
// Simulate an orphaned plugin entry.
|
||||||
|
$insert = array(
|
||||||
|
'plugin_name' => "testClearCache",
|
||||||
|
'plugin_version' => 1,
|
||||||
|
'plugin_path' => 'missing_path',
|
||||||
|
'plugin_installflag' => 1,
|
||||||
|
'plugin_addons' => '',
|
||||||
|
'plugin_category' => 'tools'
|
||||||
|
);
|
||||||
|
|
||||||
|
e107::getDb()->insert('plugin', $insert);
|
||||||
|
|
||||||
|
|
||||||
|
$detected = $this->ep->clearCache()->getDetected();
|
||||||
|
$num = e107::getDb()->count('plugin','(*)');
|
||||||
|
$det = count($detected);
|
||||||
|
$this->assertEquals($num,$det);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function testBuildAddonPrefList()
|
public function testBuildAddonPrefList()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user