You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Tests\TestCase;
|
|
|
|
class MobileCourseEndpointValidationTest extends TestCase
|
|
{
|
|
public function test_course_list_rejects_page_size_above_public_limit(): void
|
|
{
|
|
$response = $this->getJson('/api/mobile/course/course?page_size=51');
|
|
|
|
$response->assertOk()
|
|
->assertJsonPath('errcode', 10001);
|
|
}
|
|
|
|
public function test_course_list_rejects_non_public_status_filter(): void
|
|
{
|
|
$response = $this->getJson('/api/mobile/course/course?status=0');
|
|
|
|
$response->assertOk()
|
|
->assertJsonPath('errcode', 10001);
|
|
}
|
|
|
|
public function test_course_detail_rejects_non_integer_course_id(): void
|
|
{
|
|
$response = $this->getJson('/api/mobile/course/course-detail?course_id=not-an-id');
|
|
|
|
$response->assertOk()
|
|
->assertJsonPath('errcode', 10001);
|
|
}
|
|
|
|
public function test_pc_course_detail_rejects_non_integer_course_id(): void
|
|
{
|
|
$response = $this->getJson('/api/mobile/course/course-detail-pc?course_id=not-an-id');
|
|
|
|
$response->assertOk()
|
|
->assertJsonPath('errcode', 10001);
|
|
}
|
|
}
|