diff --git a/tests/e2e/Controllers/ScheduledNodeControllerTest.php b/tests/e2e/Controllers/ScheduledNodeControllerTest.php index c5f7b1c..0ff0766 100644 --- a/tests/e2e/Controllers/ScheduledNodeControllerTest.php +++ b/tests/e2e/Controllers/ScheduledNodeControllerTest.php @@ -50,7 +50,7 @@ class ScheduledNodeControllerTest extends TestCase private function makeRequest( ?string $date, - ?User $user = null, + ?User $user, ): ServerRequestInterface { $request = new ServerRequestFactory() ->createServerRequest( @@ -69,8 +69,8 @@ class ScheduledNodeControllerTest extends TestCase private function seedScheduledNode( User $user, string $date, - string $planName = 'My reading plan', - string $nodeTitle = 'Bereishis', + string $planName, + string $nodeTitle, ): void { $plan = $this->planRepo->create(new CreatePlanDto( name: $planName, @@ -90,7 +90,12 @@ class ScheduledNodeControllerTest extends TestCase public function test_returns_200_with_scheduled_nodes_for_user(): void { - $this->seedScheduledNode($this->user, '2025-01-02'); + $this->seedScheduledNode( + $this->user, + '2025-01-02', + 'My reading plan', + 'Bereishis', + ); $response = $this->controller->getScheduledNodes( $this->makeRequest('2025-01-02', $this->user), @@ -131,7 +136,7 @@ class ScheduledNodeControllerTest extends TestCase public function test_returns_401_when_no_user_attribute(): void { $response = $this->controller->getScheduledNodes( - $this->makeRequest('2025-01-02'), + $this->makeRequest('2025-01-02', null), new Response(), $this->getTodaysSchedule, ); @@ -154,7 +159,12 @@ class ScheduledNodeControllerTest extends TestCase public function test_excludes_future_scheduled_nodes(): void { - $this->seedScheduledNode($this->user, '2025-01-10'); + $this->seedScheduledNode( + $this->user, + '2025-01-10', + 'My reading plan', + 'Bereishis', + ); $response = $this->controller->getScheduledNodes( $this->makeRequest('2025-01-02', $this->user), @@ -168,7 +178,12 @@ class ScheduledNodeControllerTest extends TestCase public function test_excludes_completed_scheduled_nodes(): void { - $this->seedScheduledNode($this->user, '2025-01-02'); + $this->seedScheduledNode( + $this->user, + '2025-01-02', + 'My reading plan', + 'Bereishis', + ); $stored = $this->scheduledNodeRepo->find(0); $stored->setCompleted(true); $this->scheduledNodeRepo->update($stored);