Skip to content

Commit 7aa533b

Browse files
committed
Some case-sensitivity-related changes.
1 parent fbb1122 commit 7aa533b

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

lib/Plugin.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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() {

tests/test-IoFileInfo.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@
3232
class 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

0 commit comments

Comments
 (0)