Replace (new \Illuminate\Testing\TestResponse)->assertStatus(200)
with (new \Illuminate\Testing\TestResponse)->assertOk()
class ExampleTest extends \Illuminate\Foundation\Testing\TestCase
{
public function testFoo()
{
- $this->get('/')->assertStatus(200);
- $this->get('/')->assertStatus(204);
- $this->get('/')->assertStatus(401);
- $this->get('/')->assertStatus(403);
- $this->get('/')->assertStatus(404);
- $this->get('/')->assertStatus(405);
- $this->get('/')->assertStatus(422);
- $this->get('/')->assertStatus(410);
- $this->get('/')->assertStatus(500);
- $this->get('/')->assertStatus(503);
+ $this->get('/')->assertOk();
+ $this->get('/')->assertNoContent();
+ $this->get('/')->assertUnauthorized();
+ $this->get('/')->assertForbidden();
+ $this->get('/')->assertNotFound();
+ $this->get('/')->assertMethodNotAllowed();
+ $this->get('/')->assertUnprocessable();
+ $this->get('/')->assertGone();
+ $this->get('/')->assertInternalServerError();
+ $this->get('/')->assertServiceUnavailable();
}
}
Configure your rector.php
:
<?php
use RectorLaravel\Rector\MethodCall\AssertStatusToAssertMethodRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
AssertStatusToAssertMethodRector::class,
]);