test create plan persists plan
This commit is contained in:
parent
165f08f04d
commit
0ff5043ba5
1 changed files with 19 additions and 0 deletions
|
|
@ -237,4 +237,23 @@ 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_persists_plan_in_repository(): void
|
||||||
|
{
|
||||||
|
$this->controller->createPlan(
|
||||||
|
$this->makeRequest([
|
||||||
|
'userId' => 0,
|
||||||
|
'textId' => 0,
|
||||||
|
'name' => 'Persistent Plan',
|
||||||
|
'dateStart' => '2025-01-01',
|
||||||
|
'dateEnd' => '2025-01-01',
|
||||||
|
]),
|
||||||
|
new Response(),
|
||||||
|
$this->createPlan,
|
||||||
|
);
|
||||||
|
|
||||||
|
$storedPlan = $this->planRepo->find(0);
|
||||||
|
$this->assertNotNull($storedPlan);
|
||||||
|
$this->assertEquals('Persistent Plan', $storedPlan->getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue