PHPUNIT testing failing

Posted 4 months ago by nhayder

phpUnit testing

    /** @test */
    public function a_user_can_browse_single_thread()
    {
        $thread = factory('App\Thread')->create();

    $response = $this->get('/threads/', $thread->id);
 
        $response->assertSee($thread->title);
        $response->assertSee($thread->body);

    }

error

MacBook-$ ./vendor/phpunit/phpunit/phpunit
PHPUnit 7.1.5 by Sebastian Bergmann and contributors.

.E                                                                  2 / 2 (100%)

Time: 190 ms, Memory: 18.00MB

There was 1 error:

1) Tests\Feature\ThreadsTest::a_user_can_browse_single_thread
TypeError: Argument 2 passed to Illuminate\Foundation\Testing\TestCase::get() must be of the type array, integer given, called in /Applications/MAMP/htdocs/tests/Feature/ThreadsTest.php on line 37

/Applications/MAMP/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:164
/Applications/MAMP/htdocs/tests/Feature/ThreadsTest.php:37

ERRORS!
Tests: 2, Assertions: 2, Errors: 1.

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.