Skip to content

Commit

Permalink
Move file on PHPUnit directory
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Sep 11, 2024
1 parent a58e312 commit d8b3788
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/Component/tests/Exception/RaceConditionExceptionTest.php
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());
}
}

0 comments on commit d8b3788

Please sign in to comment.