<?php
require '/workspace/zhct/zhctproject/store/env.php';define('APP_PATH','/workspace/zhct/zhctproject/store/application/');require '/workspace/zhct/zhctproject/store/thinkphp/base.php';set_exception_handler(static function(Throwable $e):void{echo json_encode(['passed'=>false,'class'=>get_class($e),'message'=>$e->getMessage()]),"\n";exit(2);});$checks=0;$assert=static function($a,$b,string $why)use(&$checks):void{++$checks;if($a!==$b)throw new RuntimeException($why);};
foreach(['SportEducation','SportExperience']as $class){require '/tmp/cdx-store-sport-archive-20261010/source/application/p/logic/'.$class.'.php';$method=new ReflectionMethod('app\\p\\logic\\'.$class,'normalizeInfoCreateTime');$method->setAccessible(true);$row=['create_time'=>'2024-02-29 12:34:56.123456','start_date'=>'2010-01-01','end_date'=>'2010-01-02','other'=>'2024-02-29 12:34:56.123456'];$expected=$row;$expected['create_time']='2024-02-29 12:34:56';$assert($method->invoke(null,$row,true),$expected,'DM valid date only create_time');$assert($method->invoke(null,$row,false),$row,'MySQL fractional original');$assert($method->invoke(null,['id'=>1],true),['id'=>1],'Missing field not synthesized');foreach([null,'',123,'2024-02-29 12:34:56','2026-02-29 12:34:56.000000','2026-02-30 12:34:56.000000','2026-10-10 24:00:00.000000','2026-10-10 12:34:60.000000','2026-10-10 12:34:56.1234567','2026-10-10 12:34:56.']as $v){$r=['create_time'=>$v];$assert($method->invoke(null,$r,true),$r,'Preserve invalid/null/nonfraction');}foreach(['1','12','123','1234','12345','123456']as $fraction)$assert($method->invoke(null,['create_time'=>'2026-10-10 12:34:56.'.$fraction],true),['create_time'=>'2026-10-10 12:34:56'],'Bounded fraction');}
echo json_encode(['passed'=>true,'checks'=>$checks]),"\n";
