Files
shipping-portal/tests/Feature/Segments/ControllersLogic/FetchSegmentLogicTest.php
T
2026-04-06 11:26:16 +08:00

33 lines
943 B
PHP

<?php
/**
* Original controller logic file:
* app/Classes/Modules/Segments/ControllersLogic/FetchSegmentLogic.php
*/
namespace Tests\Feature\Segments\ControllersLogic;
use PHPUnit\Framework\Attributes\Group;
#[Group('feature')]
#[Group('segments')]
#[Group('controllers_logic')]
#[Group('ok_to_run')]
class FetchSegmentLogicTest extends SegmentsControllerLogicTestCase
{
public function test_it_can_fetch_a_segment_via_controller_logic()
{
// A R R A N G E
$segment = $this->createSegment('fetch_segment_logic');
// A C T
$response = $this->actingAsAdmin()
->getJson("/api/v1/segment/{$segment->id}/show");
// A S S E R T
$response->assertStatus(200);
$response->assertJsonPath('payload.data.id', $segment->id);
$response->assertJsonPath('payload.data.name', 'Fetch Segment Logic');
$response->assertJsonPath('payload.data.price', 0);
}
}