Let's Build A Forum Series - Handler.php

Posted 1 year ago by afonte15

Hi,

I am currently going though the "Let's Build a Forum" but I am having trouble with the code from episode 4. When I run the phpunit test I get the error below.

I made the change just as Jeff did on Handler.php. Any help would be helpful as I cannot continue working on the project and would like to. I am currently using Laravel 5.5.


1) Tests\Feature\ParticipateInForumTest::an_authenticated_user_may_participate_in_forum_threads
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: 

/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:255
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:242
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:176
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Router.php:599
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Router.php:588
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Router.php:577
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
/home/vagrant/Code/forum/vendor/fideloper/proxy/src/TrustProxies.php:56
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:30
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:30
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:46
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:102
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:294
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:144
/home/vagrant/Code/forum/tests/Feature/ParticipateInForumTest.php:34


There was 1 failure:

1) Tests\Feature\ParticipateInForumTest::unauthenticated_users_may_not_add_replies
Failed asserting that exception of type "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException" matches expected exception "Illuminate\Auth\AuthenticationException". Message was: "" at
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:255
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:242
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:176
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Router.php:599
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Router.php:588
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Router.php:577
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
/home/vagrant/Code/forum/vendor/fideloper/proxy/src/TrustProxies.php:56
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:30
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:30
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:46
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:102
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:294
/home/vagrant/Code/forum/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:144
/home/vagrant/Code/forum/tests/Feature/ParticipateInForumTest.php:20


Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.