From 4b0930c2384d2eac734ad1cf6887c9d00e0c39cd Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 13 Feb 2024 11:23:31 +0000 Subject: [PATCH] Add redirect fields to entry blueprint in test --- tests/FrontendTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/FrontendTest.php b/tests/FrontendTest.php index b67d294861..bb6eb271db 100644 --- a/tests/FrontendTest.php +++ b/tests/FrontendTest.php @@ -925,6 +925,24 @@ public function redirect_http_status_is_applied_when_present_in_blueprint() ], ]))->save(); + Blueprint::shouldReceive('find') + ->with('collections/pages/page') + ->andReturn($entry->blueprint()->setContents([ + 'fields' => [ + ['handle' => 'title', 'field' => ['type' => 'text']], + [ + 'handle' => 'redirect', + 'field' => [ + 'type' => 'group', 'required' => true, 'width' => '100', + 'fields' => [ + ['handle' => 'url', 'field' => ['type' => 'link']], + ['handle' => 'status', 'field' => ['type' => 'radio', 'options' => [301 => __('301 (Permanent)'), 302 => __('302 (Temporary)')]]], + ], + ], + ], + ], + ])); + $response = $this->get('/about'); $response->assertRedirect('/test');