test create plan 400 when user id missing

This commit is contained in:
Yisroel Baum 2026-04-24 11:00:37 +03:00
parent ef71708abe
commit ecb43fda2d
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -90,4 +90,22 @@ class PlanControllerTest extends TestCase
$this->assertArrayHasKey('id', $body);
$this->assertEquals('My Plan', $body['name']);
}
public function test_create_plan_returns_400_when_user_id_missing(): void
{
$response = $this->controller->createPlan(
$this->makeRequest([
'textId' => 0,
'name' => 'My Plan',
'dateStart' => '2025-01-01',
'dateEnd' => '2025-01-01',
]),
new Response(),
$this->createPlan,
);
$this->assertEquals(400, $response->getStatusCode());
$body = json_decode($response->getBody(), true);
$this->assertArrayHasKey('error', $body);
}
}