test create plan 404 when text not found
This commit is contained in:
parent
2238202384
commit
165f08f04d
1 changed files with 19 additions and 0 deletions
|
|
@ -218,4 +218,23 @@ class PlanControllerTest extends TestCase
|
|||
$body = json_decode($response->getBody(), true);
|
||||
$this->assertArrayHasKey('error', $body);
|
||||
}
|
||||
|
||||
public function test_create_plan_returns_404_when_text_not_found(): void
|
||||
{
|
||||
$response = $this->controller->createPlan(
|
||||
$this->makeRequest([
|
||||
'userId' => 0,
|
||||
'textId' => 99,
|
||||
'name' => 'My Plan',
|
||||
'dateStart' => '2025-01-01',
|
||||
'dateEnd' => '2025-01-01',
|
||||
]),
|
||||
new Response(),
|
||||
$this->createPlan,
|
||||
);
|
||||
|
||||
$this->assertEquals(404, $response->getStatusCode());
|
||||
$body = json_decode($response->getBody(), true);
|
||||
$this->assertArrayHasKey('error', $body);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue