test create plan 400 when name missing
This commit is contained in:
parent
088fa5b533
commit
0b4f7c61ef
1 changed files with 18 additions and 0 deletions
|
|
@ -126,4 +126,22 @@ class PlanControllerTest extends TestCase
|
||||||
$body = json_decode($response->getBody(), true);
|
$body = json_decode($response->getBody(), true);
|
||||||
$this->assertArrayHasKey('error', $body);
|
$this->assertArrayHasKey('error', $body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_create_plan_returns_400_when_name_missing(): void
|
||||||
|
{
|
||||||
|
$response = $this->controller->createPlan(
|
||||||
|
$this->makeRequest([
|
||||||
|
'userId' => 0,
|
||||||
|
'textId' => 0,
|
||||||
|
'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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue