diff --git a/module/extension/test/lib/extension.unittest.class.php b/module/extension/test/lib/extension.unittest.class.php index c418a8f41a..f04d4f1959 100644 --- a/module/extension/test/lib/extension.unittest.class.php +++ b/module/extension/test/lib/extension.unittest.class.php @@ -78,4 +78,22 @@ class extensionTest return $result; } + + /** + * Test cleanModelCache method. + * + * @access public + * @return bool + */ + public function cleanModelCacheTest() + { + $reflection = new ReflectionClass($this->objectModel); + $method = $reflection->getMethod('cleanModelCache'); + $method->setAccessible(true); + + $result = $method->invoke($this->objectModel); + if(dao::isError()) return dao::getError(); + + return $result; + } } \ No newline at end of file diff --git a/module/extension/test/model/cleanmodelcache.php b/module/extension/test/model/cleanmodelcache.php new file mode 100755 index 0000000000..7dcfee721c --- /dev/null +++ b/module/extension/test/model/cleanmodelcache.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +cleanModelCacheTest()) && p() && e('1'); // 步骤1:正常清理缓存 +r($extensionTest->cleanModelCacheTest()) && p() && e('1'); // 步骤2:重复清理缓存 +r($extensionTest->cleanModelCacheTest()) && p() && e('1'); // 步骤3:无缓存文件时清理 +r($extensionTest->cleanModelCacheTest()) && p() && e('1'); // 步骤4:继续清理确认稳定性 +r($extensionTest->cleanModelCacheTest()) && p() && e('1'); // 步骤5:最终验证清理功能 \ No newline at end of file