siewlon6093's avatar

This test did not perform any assertions

$ vendor/bin/phpunit --filter ParticipateInFormTest
PHPUnit 8.5.2 by Sebastian Bergmann and contributors.

R                                                                   1 / 1 (100%)

Time: 6.52 seconds, Memory: 24.00 MB

There was 1 risky test:

1) Tests\Feature\ParticipateInFormTest::test_an_authenticated_user_may_participate_in_forum_threads
This test did not perform any assertions

C:\xampp\htdocs\blog\tests\Feature\ParticipateInFormTest.php:21

OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 0, Risky: 1.

<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Tests\TestCase;

class ParticipateInFormTest extends TestCase
{
    use DatabaseMigrations;

    /** @test */
  //  function unauthenticated_users_may_not_add_replies()
  //  {
  //      $this->expectException('Illuminate\Auth\AuthenticationException');
//
  //      $this->post('/threads/1/replies', []);
  //  }

    /** @test */
    function test_an_authenticated_user_may_participate_in_forum_threads()
    {
        $this->be($user = factory('App\User')->create());

        $thread = factory('App\Thread')->create();
        $reply = factory('App\Reply')->make();

        $this->post($thread->path() . '/replies', $reply->toArray());

       // $this->get($thread->path())->assertSee($reply->body);
    }
}

ParticipateInFormTest.php

0 likes
1 reply
STEREOH's avatar
STEREOH
Best Answer
Level 18

well yeah , you commented the line with the assertion.

    $this->get($thread->path())->assertSee($reply->body);
2 likes

Please or to participate in this conversation.