當我運行PHPUnit的Laravel 5.5測試 - 調用未定義的方法::看到()
錯誤我得到這個錯誤:調用未定義的方法測試\功能\ ViewConcertListingTest ::看到()
這是我的代碼:
類ViewConcertListingTest擴展的TestCase { 使用DatabaseMigrations;
/** @test */
public function user_can_view_a_concert_listing()
{
// Arrange
// Create a concert
$concert = Concert::create([
'title' => 'The Red Chord',
'subtitle' => 'with Animosity and Lethargy',
'date' => Carbon::parse('December 13, 2016 8:00pm'),
'ticket_price' => 3250,
'venue' => 'The Mosh Pit',
'venue_address' => '123 Example Lane',
'city' => 'Laraville',
'state' => 'ON',
'zip' => '17916',
'additional_information' => 'For tickets, call (555) 555-5555'
]);
// Act
// View the concert listing
$this->get('/concerts/' . $concert->id);
// Assert
// See the concert details
$this->see('The Red Chord');
$this->see('with Animosity and Lethargy');
$this->see('December 13, 2016');
$this->see('8:00pm');
$this->see('32.50');
$this->see('The Mosh Pit');
$this->see('123 Example Lane');
$this->see('Laraville, ON 17916');
$this->see('For tickets, call (555) 555-5555');
}
}
任何幫助嗎? 謝謝!