mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
refactor: move logic into boolean method in TestCaseFactory
This commit is contained in:
@ -235,4 +235,12 @@ final class TestCaseFactory
|
||||
|
||||
return $classFQN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the test case will receive argument input from Pest, or not.
|
||||
*/
|
||||
public function receivesArguments(): bool
|
||||
{
|
||||
return $this->dependent === true || count($this->datasets) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ final class TestRepository
|
||||
throw new TestAlreadyExist($test->filename, $test->description);
|
||||
}
|
||||
|
||||
if ($test->dependent === false && count($test->datasets) === 0) {
|
||||
if (!$test->receivesArguments()) {
|
||||
$arguments = Reflection::getFunctionArguments($test->test);
|
||||
|
||||
if (count($arguments) > 0) {
|
||||
|
||||
@ -580,5 +580,5 @@
|
||||
✓ it is a test
|
||||
✓ it uses correct parent class
|
||||
|
||||
Tests: 4 incompleted, 7 skipped, 363 passed
|
||||
Tests: 4 incompleted, 7 skipped, 364 passed
|
||||
|
||||
Reference in New Issue
Block a user