From d8b3788322d3d2f6cddc2352d81f7ecbd8e63ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Wed, 11 Sep 2024 09:50:51 +0200 Subject: [PATCH] Move file on PHPUnit directory --- .../Exception/RaceConditionExceptionTest.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/Component/tests/Exception/RaceConditionExceptionTest.php diff --git a/src/Component/tests/Exception/RaceConditionExceptionTest.php b/src/Component/tests/Exception/RaceConditionExceptionTest.php new file mode 100644 index 000000000..d060c2855 --- /dev/null +++ b/src/Component/tests/Exception/RaceConditionExceptionTest.php @@ -0,0 +1,45 @@ +assertInstanceOf(UpdateHandlingException::class, $exception); + } + + public function testItHasAMessage(): void + { + $exception = new RaceConditionException(); + $this->assertSame('Operated entity was previously modified.', $exception->getMessage()); + } + + public function testItHasAFlash(): void + { + $exception = new RaceConditionException(); + $this->assertSame('race_condition_error', $exception->getFlash()); + } + + public function testItHasAnApiResponseCode(): void + { + $exception = new RaceConditionException(); + $this->assertSame(409, $exception->getApiResponseCode()); + } +}