Skip to content

Commit

Permalink
Some case-sensitivity-related changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexboia committed Apr 29, 2024
1 parent fbb1122 commit 7aa533b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,17 @@ public function getAuditLogProvider() {
}

private function _determineReadmeTxtFilePath() {
return ABP01_PLUGIN_ROOT . '/readme.txt';
$regularFile = ABP01_PLUGIN_ROOT . '/readme.txt';
if (is_readable($regularFile)) {
return $regularFile;
}

$devFile = ABP01_PLUGIN_ROOT . '/README.txt';
if (is_readable($devFile)) {
return $devFile;
}

return null;
}

public function getViewerDataSourceCache() {
Expand Down
18 changes: 18 additions & 0 deletions tests/test-IoFileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
class IoFileInfoTests extends WP_UnitTestCase {
use GenericTestHelpers;

protected function setUp(): void {
parent::setUp();
$this->_removeAllLogFiles();
}

protected function tearDown(): void {
parent::tearDown();
$this->_removeAllLogFiles();
}

private function _removeAllLogFiles() {
$dir = WP_CONTENT_DIR;
$this->_removeAllFiles($dir, 'f_rand_*.txt');
$this->_removeAllFiles($dir, 'f_rand_*.log');
}

public function test_canGetId() {
$fileData = $this->_generateRandomTestFile();
$filePath = $fileData['path'];
Expand Down Expand Up @@ -83,6 +99,8 @@ public function test_canGetContents_whenFileExists_notEmpty() {
public function test_canGetContents_whenFileDoesntExist() {
$bogusFilePath = $this->_generateRandomTestFilePath();

var_dump($bogusFilePath);

$fileInfo = new Abp01_Io_FileInfo($bogusFilePath);
$readContents = $fileInfo->contents();

Expand Down

0 comments on commit 7aa533b

Please sign in to comment.