File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -376,7 +376,17 @@ public function getAuditLogProvider() {
376376 }
377377
378378 private function _determineReadmeTxtFilePath () {
379- return ABP01_PLUGIN_ROOT . '/readme.txt ' ;
379+ $ regularFile = ABP01_PLUGIN_ROOT . '/readme.txt ' ;
380+ if (is_readable ($ regularFile )) {
381+ return $ regularFile ;
382+ }
383+
384+ $ devFile = ABP01_PLUGIN_ROOT . '/README.txt ' ;
385+ if (is_readable ($ devFile )) {
386+ return $ devFile ;
387+ }
388+
389+ return null ;
380390 }
381391
382392 public function getViewerDataSourceCache () {
Original file line number Diff line number Diff line change 3232class IoFileInfoTests extends WP_UnitTestCase {
3333 use GenericTestHelpers;
3434
35+ protected function setUp (): void {
36+ parent ::setUp ();
37+ $ this ->_removeAllLogFiles ();
38+ }
39+
40+ protected function tearDown (): void {
41+ parent ::tearDown ();
42+ $ this ->_removeAllLogFiles ();
43+ }
44+
45+ private function _removeAllLogFiles () {
46+ $ dir = WP_CONTENT_DIR ;
47+ $ this ->_removeAllFiles ($ dir , 'f_rand_*.txt ' );
48+ $ this ->_removeAllFiles ($ dir , 'f_rand_*.log ' );
49+ }
50+
3551 public function test_canGetId () {
3652 $ fileData = $ this ->_generateRandomTestFile ();
3753 $ filePath = $ fileData ['path ' ];
@@ -83,6 +99,8 @@ public function test_canGetContents_whenFileExists_notEmpty() {
8399 public function test_canGetContents_whenFileDoesntExist () {
84100 $ bogusFilePath = $ this ->_generateRandomTestFilePath ();
85101
102+ var_dump ($ bogusFilePath );
103+
86104 $ fileInfo = new Abp01_Io_FileInfo ($ bogusFilePath );
87105 $ readContents = $ fileInfo ->contents ();
88106
You can’t perform that action at this time.
0 commit comments