mirror of
https://github.com/pestphp/pest.git
synced 2026-04-21 14:37:29 +02:00
feat(ai): allow temporary namesapce
This commit is contained in:
@ -59,6 +59,11 @@ final class TestCaseFactory
|
|||||||
Concerns\Expectable::class,
|
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.
|
* Creates a new Factory instance.
|
||||||
*/
|
*/
|
||||||
@ -127,7 +132,7 @@ final class TestCaseFactory
|
|||||||
|
|
||||||
$partsFQN = explode('\\', $classFQN);
|
$partsFQN = explode('\\', $classFQN);
|
||||||
$className = array_pop($partsFQN);
|
$className = array_pop($partsFQN);
|
||||||
$namespace = implode('\\', $partsFQN);
|
$namespace = $this->namespace ?? implode('\\', $partsFQN);
|
||||||
$baseClass = sprintf('\%s', $this->class);
|
$baseClass = sprintf('\%s', $this->class);
|
||||||
|
|
||||||
if (trim($className) === '') {
|
if (trim($className) === '') {
|
||||||
|
|||||||
Reference in New Issue
Block a user