Renamed DatasetAlreadyExists exception

This commit is contained in:
Fabio Ivona
2022-09-22 11:01:31 +02:00
parent 98b04632ce
commit db00fc8c09
3 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ use Symfony\Component\Console\Exception\ExceptionInterface;
/** /**
* @internal * @internal
*/ */
final class DatasetAlreadyExist extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace final class DatasetAlreadyExists extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{ {
/** /**
* Creates a new Exception instance. * Creates a new Exception instance.

View File

@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Pest\Repositories; namespace Pest\Repositories;
use Closure; use Closure;
use Pest\Exceptions\DatasetAlreadyExist; use Pest\Exceptions\DatasetAlreadyExists;
use Pest\Exceptions\DatasetDoesNotExist; use Pest\Exceptions\DatasetDoesNotExist;
use Pest\Exceptions\ShouldNotHappen; use Pest\Exceptions\ShouldNotHappen;
use SebastianBergmann\Exporter\Exporter; use SebastianBergmann\Exporter\Exporter;
@ -43,7 +43,7 @@ final class DatasetsRepository
$datasetKey = "$scope".self::SEPARATOR."$name"; $datasetKey = "$scope".self::SEPARATOR."$name";
if (array_key_exists("$datasetKey", self::$datasets)) { if (array_key_exists("$datasetKey", self::$datasets)) {
throw new DatasetAlreadyExist($name, $scope); throw new DatasetAlreadyExists($name, $scope);
} }
self::$datasets[$datasetKey] = $data; self::$datasets[$datasetKey] = $data;

View File

@ -1,6 +1,6 @@
<?php <?php
use Pest\Exceptions\DatasetAlreadyExist; use Pest\Exceptions\DatasetAlreadyExists;
use Pest\Exceptions\DatasetDoesNotExist; use Pest\Exceptions\DatasetDoesNotExist;
use Pest\Plugin; use Pest\Plugin;
use Pest\Repositories\DatasetsRepository; use Pest\Repositories\DatasetsRepository;
@ -18,7 +18,7 @@ it('throws exception if dataset does not exist', function () {
it('throws exception if dataset already exist', function () { it('throws exception if dataset already exist', function () {
DatasetsRepository::set('second', [[]], __DIR__); DatasetsRepository::set('second', [[]], __DIR__);
$this->expectException(DatasetAlreadyExist::class); $this->expectException(DatasetAlreadyExists::class);
$this->expectExceptionMessage('A dataset with the name `second` already exist in scope ['.__DIR__.'].'); $this->expectExceptionMessage('A dataset with the name `second` already exist in scope ['.__DIR__.'].');
DatasetsRepository::set('second', [[]], __DIR__); DatasetsRepository::set('second', [[]], __DIR__);
}); });