test create plan 400 when date end before start
This commit is contained in:
parent
2a76f69553
commit
68554cb362
1 changed files with 19 additions and 0 deletions
|
|
@ -180,4 +180,23 @@ class PlanControllerTest extends TestCase
|
|||
$body = json_decode($response->getBody(), true);
|
||||
$this->assertArrayHasKey('error', $body);
|
||||
}
|
||||
|
||||
public function test_create_plan_returns_400_when_date_end_before_start(): void
|
||||
{
|
||||
$response = $this->controller->createPlan(
|
||||
$this->makeRequest([
|
||||
'userId' => 0,
|
||||
'textId' => 0,
|
||||
'name' => 'My Plan',
|
||||
'dateStart' => '2025-01-02',
|
||||
'dateEnd' => '2025-01-01',
|
||||
]),
|
||||
new Response(),
|
||||
$this->createPlan,
|
||||
);
|
||||
|
||||
$this->assertEquals(400, $response->getStatusCode());
|
||||
$body = json_decode($response->getBody(), true);
|
||||
$this->assertArrayHasKey('error', $body);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue