I have to admit that it's the first time I use this method
Before the description, here is the Laravel and PHP version in this case. Laravel: 8.15 PHP: 7.4.13
- My Route:
Route::get('/', function () {
return ['a' => 1, 'b' => 2, 'c' => 3];
- When my testing method was as follows, it failed, it's what I expected
public function testDemo()
{
$response = $this->get('/')->assertJsonMissing(['a' => 1, 'b' => 3]);
}
- And then, I used assertJsonMissingExact, and I expected it would pass.
public function testDemo()
{
$response = $this->get('/')->assertJsonMissingExact(['a' => 1, 'b' => 3]);
}
- However, it didn't pass. Instead, here is the message
This test did not perform any assertions
Time: 00:00.178, Memory: 20.00 MB
OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 0, Risky: 1.
Process finished with exit code 0
It says that the test didn't perform any assertion. I'm wondering if it's normal? Because I'm expecting a passed
result.
Anyone could help me with that will be so much appreciated.