From 2a76f69553eee0b6a77c2ef1deac1d0ba2868c16 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 24 Apr 2026 11:01:34 +0300 Subject: [PATCH] test create plan 400 when date end missing --- tests/e2e/Controllers/PlanControllerTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/e2e/Controllers/PlanControllerTest.php b/tests/e2e/Controllers/PlanControllerTest.php index 8bf03ce..6ade21a 100644 --- a/tests/e2e/Controllers/PlanControllerTest.php +++ b/tests/e2e/Controllers/PlanControllerTest.php @@ -162,4 +162,22 @@ class PlanControllerTest extends TestCase $body = json_decode($response->getBody(), true); $this->assertArrayHasKey('error', $body); } + + public function test_create_plan_returns_400_when_date_end_missing(): void + { + $response = $this->controller->createPlan( + $this->makeRequest([ + 'userId' => 0, + 'textId' => 0, + 'name' => 'My Plan', + 'dateStart' => '2025-01-01', + ]), + new Response(), + $this->createPlan, + ); + + $this->assertEquals(400, $response->getStatusCode()); + $body = json_decode($response->getBody(), true); + $this->assertArrayHasKey('error', $body); + } }