Sylius/tests/Api/Shop/AdjustmentsTest.php

52 lines
1.2 KiB
PHP

<?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\Tests\Api\Shop;
use Sylius\Tests\Api\JsonApiTestCase;
use Sylius\Tests\Api\Utils\OrderPlacerTrait;
use Symfony\Component\HttpFoundation\Response;
final class AdjustmentsTest extends JsonApiTestCase
{
use OrderPlacerTrait;
protected function setUp(): void
{
parent::setUp();
$this->setUpOrderPlacer();
}
/** @test */
public function it_returns_not_found_on_get_adjustment(): void
{
$this->loadFixturesFromFiles([
'channel/channel.yaml',
'cart.yaml',
'country.yaml',
'shipping_method.yaml',
'payment_method.yaml',
]);
$order = $this->placeOrder('token');
$this->client->request(
method: 'GET',
uri: '/api/v2/shop/adjustments/' . $order->getAdjustments()->first()->getId(),
server: $this->headerBuilder()->withJsonLdAccept()->build(),
);
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
}
}