From 7daf8e864a9aefcc19e4de747d88ef53068c81f4 Mon Sep 17 00:00:00 2001 From: Brian Faust Date: Fri, 12 May 2023 16:10:30 +0300 Subject: [PATCH] Add missing colon for index method for web controllers (#638) --- src/Lexers/ControllerLexer.php | 2 +- tests/Feature/Lexers/ControllerLexerTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Lexers/ControllerLexer.php b/src/Lexers/ControllerLexer.php index 0081b213..dddcf98d 100644 --- a/src/Lexers/ControllerLexer.php +++ b/src/Lexers/ControllerLexer.php @@ -118,7 +118,7 @@ private function resourceTokens() return [ 'index' => [ 'query' => 'all:[plural]', - 'render' => '[singular].index with [plural]', + 'render' => '[singular].index with:[plural]', ], 'create' => [ 'render' => '[singular].create', diff --git a/tests/Feature/Lexers/ControllerLexerTest.php b/tests/Feature/Lexers/ControllerLexerTest.php index a19bea86..24e5a769 100644 --- a/tests/Feature/Lexers/ControllerLexerTest.php +++ b/tests/Feature/Lexers/ControllerLexerTest.php @@ -46,7 +46,7 @@ public function it_returns_controllers(): void 'PostController' => [ 'index' => [ 'query' => 'all:posts', - 'render' => 'post.index with posts', + 'render' => 'post.index with:posts', ], 'show' => [ 'find' => 'id', @@ -63,7 +63,7 @@ public function it_returns_controllers(): void $this->statementLexer->shouldReceive('analyze') ->with([ 'query' => 'all:posts', - 'render' => 'post.index with posts', + 'render' => 'post.index with:posts', ]) ->andReturn(['index-statement-1', 'index-statement-2']); @@ -120,7 +120,7 @@ public function it_returns_a_web_resource_controller(): void $this->statementLexer->shouldReceive('analyze') ->with([ 'query' => 'all:comments', - 'render' => 'comment.index with comments', + 'render' => 'comment.index with:comments', ]) ->andReturn(['index-statements']); @@ -265,7 +265,7 @@ public function it_returns_a_specific_resource_controller(): void $this->statementLexer->expects('analyze') ->with([ 'query' => 'all:users', - 'render' => 'user.index with users', + 'render' => 'user.index with:users', ]) ->andReturn(['index-statements']);