#!/usr/bin/env php realPath = $testFile; $emptyFile = new stdclass(); $missingRealPathFile = new stdclass(); $missingRealPathFile->someOtherProperty = 'test'; $nonexistentFile = new stdclass(); $nonexistentFile->realPath = dirname(__FILE__) . '/nonexistent_file.txt'; $emptyPathFile = new stdclass(); $emptyPathFile->realPath = ''; $nullPathFile = new stdclass(); $nullPathFile->realPath = null; // 5. 执行测试步骤(至少5个) r($fileTest->fileMTimeTest($emptyFile)) && p() && e('0'); // 步骤1:传入空对象 r($fileTest->fileMTimeTest($validFile) > 0) && p() && e('1'); // 步骤2:传入存在的文件对象 r($fileTest->fileMTimeTest($nonexistentFile)) && p() && e('0'); // 步骤3:传入不存在的文件路径 r($fileTest->fileMTimeTest($emptyPathFile)) && p() && e('0'); // 步骤4:传入空字符串的realPath r($fileTest->fileMTimeTest($nullPathFile)) && p() && e('0'); // 步骤5:传入null作为realPath // 清理测试文件 if(file_exists($testFile)) unlink($testFile);