<?php
namespace think {class Config{public static $type='mysql';public static function get($key){return $key==='database.type'?self::$type:null;}}class Exception extends \Exception{}}
namespace app\model {class SyllabusEvaluate{public static $row=[];public function read($uuid){return self::$row;}}class SyllabusEvaluateExt{}class Staff{}}
namespace {
require $argv[1];$logic=new \app\p\logic\SyllabusEvaluate();$values=[null,'',17,'2001-01-01 08:00:00','2001-01-01 08:00:00.0','2001-01-01 08:00:00.00','2001-01-01 08:00:00.000','2001-01-01 08:00:00.0000','2001-01-01 08:00:00.00000','2001-01-01 08:00:00.000000','2001-01-01 08:00:00.000001','2001-01-01 08:00:00.123456','2001-01-01 08:00:00.0000000','2001-01-01T08:00:00.000000','2026-02-29 08:00:00.000000','0000-01-01 08:00:00.000000','2024-02-29 24:00:00.000000','2024-02-29 23:60:00.000000','2024-02-29 23:59:60.000000','2024-02-29 23:59:59.000000',"2001-01-01 08:00:00.000000\n",'2001-13-01 08:00:00.000000'];$checks=[];
foreach(['mysql','app\\cores\\database\\Dm','\\app\\cores\\database\\Dm']as $type){\think\Config::$type=$type;foreach($values as $i=>$time){$row=['id'=>2,'uuid'=>'CDXSYE','staff_uuid'=>'CDXSTAFF','test_content'=>"数据库兼容测试'\n完整中文",'test_time'=>'2001-01-02','achievement'=>'达标2','demo'=>null,'create_time'=>$time,'create_by'=>'CDXSYE_FIXTURE'];\app\model\SyllabusEvaluate::$row=$row;$expected=$row;if($type!=='mysql'&&(($i>=4&&$i<=9)||$i===19))$expected['create_time']=substr($time,0,19);$checks[$type.'_info_time_'.$i]=$logic->info('CDXSYE')===['code'=>0,'message'=>'查询成功','data'=>$expected];}$row=['id'=>2,'uuid'=>'CDXSYE','test_content'=>null];\app\model\SyllabusEvaluate::$row=$row;$checks[$type.'_missing_time_shape']=$logic->info('CDXSYE')===['code'=>0,'message'=>'查询成功','data'=>$row];}
$fail=array_keys(array_filter($checks,static function($v){return !$v;}));echo json_encode(['total'=>count($checks),'failed_count'=>count($fail),'failed'=>$fail]),"\n";exit($fail?1:0);
}
