Weird PHP Testing Changes with Laravel 5.6.3 How's this test passing, when my index method /course has nothing inside it.
/** @test */
public function to_see_all_courses()
{
$courses = factory(Course::class, 2)->create();
$this->get('course');
$this->assertCount(2, $courses);
}
If you are trying to see courses on the /courses page the I would test first that you could see them and then check the number requested for pagination. Something like:
$course = factory(Course::class, 1)->create();
$this->get('/course');
$this->assertSee('$course->title');
When i tried to use that, it gives me this error.
Error: Call to undefined method CreateCourseTest::assertSee()
Please sign in or create an account to participate in this conversation.