feat(describe): fixes missing beforeAll exception

This commit is contained in:
Nuno Maduro
2023-05-13 23:24:31 +01:00
parent a1208b5876
commit 8442b9a6e4

View File

@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Pest\Repositories; namespace Pest\Repositories;
use Closure; use Closure;
use Pest\Exceptions\BeforeEachAlreadyExist; use Pest\Exceptions\BeforeAllAlreadyExist;
use Pest\Support\NullClosure; use Pest\Support\NullClosure;
use Pest\Support\Reflection; use Pest\Support\Reflection;
@ -39,7 +39,7 @@ final class BeforeAllRepository
$filename = Reflection::getFileNameFromClosure($closure); $filename = Reflection::getFileNameFromClosure($closure);
if (array_key_exists($filename, $this->state)) { if (array_key_exists($filename, $this->state)) {
throw new BeforeEachAlreadyExist($filename); throw new BeforeAllAlreadyExist($filename);
} }
$this->state[$filename] = $closure; $this->state[$filename] = $closure;