aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJosh Richards <josh.t.richards@gmail.com>2023-06-03 08:57:38 -0400
committeryemkareems <yemkareems@gmail.com>2024-11-13 09:11:17 +0530
commit1fc1543a8bcffa04f0c4d42ba2252409c8876041 (patch)
tree100e3e14795208077fc7e23245086e3b18cc2938 /tests
parent0da87f178f1db975a1c3f9212b99ac01f4bae874 (diff)
downloadnextcloud-server-1fc1543a8bcffa04f0c4d42ba2252409c8876041.tar.gz
nextcloud-server-1fc1543a8bcffa04f0c4d42ba2252409c8876041.zip
fix: Clean-up some remaining readdir calls with undesirable false evaluation potential
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/Storage/Storage.php4
-rw-r--r--tests/lib/Files/Storage/Wrapper/EncodingTest.php2
-rw-r--r--tests/lib/Files/Storage/Wrapper/JailTest.php2
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/lib/Files/Storage/Storage.php b/tests/lib/Files/Storage/Storage.php
index 0a170a0e7d5..747cb4b6f43 100644
--- a/tests/lib/Files/Storage/Storage.php
+++ b/tests/lib/Files/Storage/Storage.php
@@ -66,7 +66,7 @@ abstract class Storage extends \Test\TestCase {
$dh = $this->instance->opendir('/');
$content = [];
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if ($file != '.' and $file != '..') {
$content[] = $file;
}
@@ -99,7 +99,7 @@ abstract class Storage extends \Test\TestCase {
$dh = $this->instance->opendir('/');
$content = [];
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if ($file != '.' and $file != '..') {
$content[] = $file;
}
diff --git a/tests/lib/Files/Storage/Wrapper/EncodingTest.php b/tests/lib/Files/Storage/Wrapper/EncodingTest.php
index bc9355d7bfb..ae6a6ece742 100644
--- a/tests/lib/Files/Storage/Wrapper/EncodingTest.php
+++ b/tests/lib/Files/Storage/Wrapper/EncodingTest.php
@@ -208,7 +208,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
$dh = $this->instance->opendir('/test');
$content = [];
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if ($file != '.' and $file != '..') {
$content[] = $file;
}
diff --git a/tests/lib/Files/Storage/Wrapper/JailTest.php b/tests/lib/Files/Storage/Wrapper/JailTest.php
index c48f52ecce7..fb2d05d0691 100644
--- a/tests/lib/Files/Storage/Wrapper/JailTest.php
+++ b/tests/lib/Files/Storage/Wrapper/JailTest.php
@@ -27,7 +27,7 @@ class JailTest extends \Test\Files\Storage\Storage {
// test that nothing outside our jail is touched
$contents = [];
$dh = $this->sourceStorage->opendir('');
- while ($file = readdir($dh)) {
+ while (($file = readdir($dh)) !== false) {
if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
$contents[] = $file;
}