From 85eb9281abb0743e10aa6ef36154416ee3159360 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 19 Oct 2023 08:36:36 +0200 Subject: [PATCH] NamingConventions/NamespaceName: 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. --- .../Tests/NamingConventions/NamespaceNameUnitTest.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Yoast/Tests/NamingConventions/NamespaceNameUnitTest.php b/Yoast/Tests/NamingConventions/NamespaceNameUnitTest.php index 19fadee3..6dee51a2 100644 --- a/Yoast/Tests/NamingConventions/NamespaceNameUnitTest.php +++ b/Yoast/Tests/NamingConventions/NamespaceNameUnitTest.php @@ -42,7 +42,15 @@ public function setCliValues( $testFile, $config ) { */ protected function getTestFiles( $testFileBase ) { $sep = \DIRECTORY_SEPARATOR; - $test_files = \glob( \dirname( $testFileBase ) . $sep . 'NamespaceNameUnitTests{' . $sep . ',' . $sep . '*' . $sep . '}*.inc', \GLOB_BRACE ); + $test_files = \glob( + \dirname( $testFileBase ) . $sep . 'NamespaceNameUnitTests{' + . $sep . ',' // Files in the "NamespaceNameUnitTests" directory. + . $sep . '*' . $sep . ',' // Files in first-level subdirectories. + . $sep . '*' . $sep . '*' . $sep . ',' // Files in second-level subdirectories. + . $sep . '*' . $sep . '*' . $sep . '*' . $sep // Files in third-level subdirectories. + . '}*.inc', + \GLOB_BRACE + ); if ( ! empty( $test_files ) ) { return $test_files;