Danieloplata
11 months ago

Syntax error, unexpected ')'

Posted 11 months ago by Danieloplata

Hi guys, following the build forum with TDD videos and I'm getting the following error when running the ParticipateInForumTest

1) Tests\Feature\ParticipateInForumTest::an_authenticated_user_can_reply_to_threads
Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected ')'
C:\Laragon\www\forum\tests\Feature\ParticipateInForumTest.php:26

I've added which line is line 26 in my code below - it doesn't look incorrect to me, so I'm assuming we're getting this unexpected ) from somewhere else.

class ParticipateInForumTest extends TestCase
{
    use RefreshDatabase;

    /** @test */
    public function an_authenticated_user_can_reply_to_threads()
    {
        // Create a user and sign them in
        $this->be($user = factory('App\User')->create());

        // Create a thread
        $thread = factory('App\Thread')->create();

        // Create a reply
        $reply = factory('App\Reply')->create();

        // Post the reply (below is line 26)
        $this->post('/threads/' . $thread->id . '/replies', $reply->toArray());
        
        // Assert that it worked
        $this->get($thread->path())
            ->assertSee($reply->body);
    }
}

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