From 118b3ccf460ad8ecca89f4ef6bd689ca1ea4d1c2 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 16 Oct 2024 22:38:44 +0800 Subject: [PATCH] MDL-83468 phpunit: Skip tests instead of data providers Empty data providers are invalid and do not represent the state of the test. Rather than commenting them out we should instead skip them. --- cache/stores/redis/tests/compressor_test.php | 5 ----- lib/tests/rtlcss_test.php | 9 +++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/cache/stores/redis/tests/compressor_test.php b/cache/stores/redis/tests/compressor_test.php index f9d038f0555..8f46a263d7d 100644 --- a/cache/stores/redis/tests/compressor_test.php +++ b/cache/stores/redis/tests/compressor_test.php @@ -167,11 +167,6 @@ final class compressor_test extends \advanced_testcase { * @return array */ public static function provider_for_tests_setget(): array { - if (!cachestore_redis::are_requirements_met()) { - // Even though we skip all tests in this case, this provider can still show warnings about non-existing class. - return []; - } - $data = [ ['none, none', \Redis::SERIALIZER_NONE, cachestore_redis::COMPRESSOR_NONE, diff --git a/lib/tests/rtlcss_test.php b/lib/tests/rtlcss_test.php index b431e041ba6..384ccadc073 100644 --- a/lib/tests/rtlcss_test.php +++ b/lib/tests/rtlcss_test.php @@ -40,7 +40,7 @@ final class rtlcss_test extends basic_testcase { */ public static function background_image_provider(): array { return [ - /* Not supported by MoodleHQ/RTLCSS yet. + // Not supported by MoodleHQ/RTLCSS yet. [[ 'should' => 'Should process string map in url (processUrls:true)', 'expected' => 'div { background-image: url(images/rtl.png), url(images/right.png);}', @@ -70,7 +70,6 @@ final class rtlcss_test extends basic_testcase { 'reversable' => true, 'skip' => true ]] - */ ]; } @@ -421,7 +420,7 @@ final class rtlcss_test extends basic_testcase { */ public static function special_provider(): array { return [ - /* Not supported by MoodleHQ/RTLCSS yet. + // Not supported by MoodleHQ/RTLCSS yet. [[ 'should' => 'Should not negate tokens', 'expected' => 'div { box-shadow: rgba(0, 128, 128, .98) inset -5em 1em 0;}', @@ -429,7 +428,6 @@ final class rtlcss_test extends basic_testcase { 'reversable' => true, 'skip' => true, ]] - */ ]; } @@ -614,7 +612,7 @@ final class rtlcss_test extends basic_testcase { */ public static function transforms_provider(): array { return [ - /* Not supported by MoodleHQ/RTLCSS yet. + // Not supported by MoodleHQ/RTLCSS yet. [[ 'should' => 'Should mirror transform : matrix', 'expected' => 'div { transform: matrix(2, 0.1, 20.75, 2, 2, 2); }', @@ -888,7 +886,6 @@ final class rtlcss_test extends basic_testcase { 'reversable' => false, 'skip' => true ]] - */ ]; }