PHP 8 and PHPUnit 9.3 support

This commit is contained in:
Graham Campbell
2020-08-07 11:23:45 +01:00
parent 051ca73cae
commit 3cfadee2bb
11 changed files with 95 additions and 48 deletions

View File

@ -9,6 +9,7 @@ use Pest\Factories\TestCaseFactory;
use Pest\Support\Backtrace;
use Pest\Support\NullClosure;
use Pest\TestSuite;
use PHPUnit\Framework\ExecutionOrderDependency;
use SebastianBergmann\Exporter\Exporter;
/**
@ -91,6 +92,12 @@ final class TestCall
*/
public function depends(string ...$tests): TestCall
{
$className = $this->testCaseFactory->getClassName();
$tests = array_map(function (string $test) use ($className): ExecutionOrderDependency {
return ExecutionOrderDependency::createFromDependsAnnotation($className, $test);
}, $tests);
$this->testCaseFactory
->factoryProxies
->add(Backtrace::file(), Backtrace::line(), 'setDependencies', [$tests]);