From cf886cb172e89ff8bd56a9726f4c50131b738a05 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 19 Oct 2023 08:22:56 +0200 Subject: [PATCH] Files/TestDoubles: bug fix - not all tests were being run There was a bug in the `glob` expression used to collect all the test case files, which meant that not all test case files were found and checked during the test runs. Fixed now. Includes one minor, non-consequential fix to the test expectations. --- Yoast/Tests/Files/TestDoublesUnitTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Yoast/Tests/Files/TestDoublesUnitTest.php b/Yoast/Tests/Files/TestDoublesUnitTest.php index 9401a866..9e1ca262 100644 --- a/Yoast/Tests/Files/TestDoublesUnitTest.php +++ b/Yoast/Tests/Files/TestDoublesUnitTest.php @@ -41,7 +41,7 @@ public function setCliValues( $testFile, $config ) { */ protected function getTestFiles( $testFileBase ) { $sep = \DIRECTORY_SEPARATOR; - $test_files = \glob( \dirname( $testFileBase ) . $sep . 'TestDoublesUnitTests{' . $sep . ',' . $sep . '*' . $sep . '}*.inc', \GLOB_BRACE ); + $test_files = \glob( \dirname( $testFileBase ) . $sep . 'TestDoublesUnitTests' . $sep . 'tests{' . $sep . ',' . $sep . '*' . $sep . '}*.inc', \GLOB_BRACE ); if ( ! empty( $test_files ) ) { return $test_files; @@ -117,7 +117,7 @@ public function getErrorList( $testFile = '' ) { // In tests/mocks. case 'correct-custom-dir-not-mock.inc': return [ - 3 => 1, + 4 => 1, ]; case 'not-double-or-mock.inc': // In tests.