createSegment('list_segment_logic_matching_segment', $companyModuleId); $this->createSegment('list_segment_logic_other_segment', $companyModuleId + 1); $filters = json_encode([ 'company_module_id' => $companyModuleId, ]); // A C T $response = $this->actingAsAdmin() ->getJson('/api/v1/segment/list?filters=' . urlencode($filters)); // A S S E R T $response->assertStatus(200); $response->assertJsonCount(1, 'payload.data'); $response->assertJsonPath('payload.data.0.id', $matchingSegment->id); $response->assertJsonPath('payload.data.0.name', 'List Segment Logic Matching Segment'); } }