diff --git a/module/aiapp/test/lib/aiapp.unittest.class.php b/module/aiapp/test/lib/aiapp.unittest.class.php new file mode 100644 index 0000000000..739a32c902 --- /dev/null +++ b/module/aiapp/test/lib/aiapp.unittest.class.php @@ -0,0 +1,24 @@ +objectModel = $tester->loadModel('aiapp'); + } + + /** + * Test __construct method. + * + * @access public + * @return mixed + */ + public function __constructTest() + { + $result = $this->objectModel; + if(dao::isError()) return dao::getError(); + + return $result; + } +} \ No newline at end of file diff --git a/module/aiapp/test/model/__construct.php b/module/aiapp/test/model/__construct.php new file mode 100755 index 0000000000..ff2635cb63 --- /dev/null +++ b/module/aiapp/test/model/__construct.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +__constructTest())) && p() && e('aiappModel'); // 步骤1:正常实例化验证类名 +r($aiappTest->__constructTest() instanceof model) && p() && e('1'); // 步骤2:验证继承基类 +r(get_class($aiappTest->__constructTest()->ai)) && p() && e('aiModel'); // 步骤3:验证加载ai模型 +r(get_class($aiappTest->__constructTest()->dao)) && p() && e('mysql'); // 步骤4:验证dao对象 +r(isset($aiappTest->__constructTest()->config)) && p() && e('1'); // 步骤5:验证config属性存在 \ No newline at end of file