From 9797a71dbc776f46d6fcacb708b002755da6f37a Mon Sep 17 00:00:00 2001 From: nuno maduro Date: Fri, 3 Apr 2026 14:43:28 +0100 Subject: [PATCH] feat(ai): allow temporary namesapce --- src/Factories/TestCaseFactory.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Factories/TestCaseFactory.php b/src/Factories/TestCaseFactory.php index 3349d03d..4599ee77 100644 --- a/src/Factories/TestCaseFactory.php +++ b/src/Factories/TestCaseFactory.php @@ -59,6 +59,11 @@ final class TestCaseFactory Concerns\Expectable::class, ]; + /** + * The namespace for the test case, overrides the path-based namespace when set. + */ + public ?string $namespace = null; + /** * Creates a new Factory instance. */ @@ -127,7 +132,7 @@ final class TestCaseFactory $partsFQN = explode('\\', $classFQN); $className = array_pop($partsFQN); - $namespace = implode('\\', $partsFQN); + $namespace = $this->namespace ?? implode('\\', $partsFQN); $baseClass = sprintf('\%s', $this->class); if (trim($className) === '') {