Call to undefined method ViewTransactionListTest::visit()
I'm just getting started with testing and following the series here and on TestDrivenLaravel however when I try to create my first test I immediately get the following error:
PHP Fatal error: Call to undefined method ViewTransactionListTest::visit()
This is the code for my Test file:
class ViewTransactionListTest extends TestCase
{
/** @test */
function user_can_view_tx_list() {
// Act
$this->visit('/home');
// Assert
$this->see('Latest Transactions');
}
}
I'm using Laravel 5.4 and I have phpunit 5.7.14 installed globally on a Windows machine. When I run using ./vendor/bin/phpunit I get the same error. I also tried running phpunit from Homestead and see the same error.
For those that upgraded from 5.3 to 5.4 there are some additional steps that don't seem to be included in the upgrade guide. Some additional files need to be changed/created in the /tests directory. Further instructions can be found here: https://github.com/laravel/dusk/issues/40
Dusk requires a lot of changes to your tests that is different from the code Adam writes in the course. To get tests working in a similar manner using >= Laravel 5.5 you can use: