Complete the code to run PHPUnit tests in Laravel using the artisan command.
php artisan [1]Use php artisan test to run PHPUnit tests in Laravel.
Complete the code to specify the test directory when running PHPUnit directly.
vendor/bin/phpunit [1]Specify the test directory like tests/Feature to run tests in that folder.
Fix the error in the PHPUnit configuration file by completing the missing XML tag.
<?xml version="1.0" encoding="UTF-8"?> <phpunit bootstrap="vendor/autoload.php" colors="true"> <testsuites> <testsuite name="Feature"> <directory>[1]</directory> </testsuite> </testsuites> </phpunit>
The <directory> tag should point to the folder containing the tests, usually tests/Feature.
Fill both blanks to create a basic test method in a Laravel test class.
public function [1]() { $response = $this->get('/'); $response->assertStatus([2]); }
The test method name should start with 'test'. The status code 200 means the page loaded successfully.
Fill all three blanks to write a test that checks if the home page contains a welcome message.
public function [1]() { $response = $this->get('/'); $response->assertStatus([2]); $response->assertSee('[3]'); }
The method name should start with 'test'. Status 200 means success. The string checked is the welcome message.