-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/Component/tests/Exception/RaceConditionExceptionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\Resource\Tests\Exception; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Sylius\Resource\Exception\RaceConditionException; | ||
use Sylius\Resource\Exception\UpdateHandlingException; | ||
|
||
final class RaceConditionExceptionTest extends TestCase | ||
{ | ||
public function testItExtendsAnUpdateHandlingException(): void | ||
{ | ||
$exception = new RaceConditionException(); | ||
$this->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()); | ||
} | ||
} |