From 321075d9e5d448f644b8e75c3dd677e40087fcc9 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Mon, 14 Jul 2025 23:07:49 +0800 Subject: [PATCH 1/2] fix: ensure `make:test` works on Windows --- system/Commands/Generators/TestGenerator.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/system/Commands/Generators/TestGenerator.php b/system/Commands/Generators/TestGenerator.php index 7ab6859ed9a9..d37864d76efc 100644 --- a/system/Commands/Generators/TestGenerator.php +++ b/system/Commands/Generators/TestGenerator.php @@ -173,20 +173,17 @@ protected function buildPath(string $class): string /** * Returns test file path for the namespace. */ - private function searchTestFilePath(string $namespace): ?string + private function searchTestFilePath(string $testNamespace): ?string { - $bases = service('autoloader')->getNamespace($namespace); + /** @var list $testPaths */ + $testPaths = service('autoloader')->getNamespace($testNamespace); - $base = null; - - foreach ($bases as $candidate) { - if (str_contains($candidate, '/tests/')) { - $base = $candidate; - - break; + foreach ($testPaths as $candidate) { + if (str_contains($candidate, DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR)) { + return $candidate; } } - return $base; + return null; } } From 1e0f86523b564caf00a6f47f32c212d90832706f Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Tue, 15 Jul 2025 23:59:30 +0800 Subject: [PATCH 2/2] Add changelog --- user_guide_src/source/changelogs/v4.6.2.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/changelogs/v4.6.2.rst b/user_guide_src/source/changelogs/v4.6.2.rst index 3e45e3c2409e..7ebf81108938 100644 --- a/user_guide_src/source/changelogs/v4.6.2.rst +++ b/user_guide_src/source/changelogs/v4.6.2.rst @@ -36,6 +36,7 @@ Bugs Fixed ********** - **Cache:** Fixed a bug where a corrupted or unreadable cache file could cause an unhandled exception in ``FileHandler::getItem()``. +- **Commands:** Fixed a bug in ``make:test`` where it would always error on Windows. - **CURLRequest:** Fixed a bug where intermediate HTTP responses were not properly removed from the response chain in certain scenarios, causing incorrect status codes and headers to be returned instead of the final response. - **Database:** Fixed a bug where ``when()`` and ``whenNot()`` in ``ConditionalTrait`` incorrectly evaluated certain falsy values (such as ``[]``, ``0``, ``0.0``, and ``'0'``) as truthy, causing callbacks to be executed unexpectedly. These methods now cast the condition to a boolean using ``(bool)`` to ensure consistent behavior with PHP's native truthiness. - **Database:** Fixed encapsulation violation in ``BasePreparedQuery`` when accessing ``BaseConnection::transStatus`` protected property.