Use Laravel 6’s new test methods for HTTP tests

This commit is contained in:
Jonny Barnes 2020-01-26 19:03:34 +00:00
parent e0c021cca2
commit c1b316b641

View file

@ -124,8 +124,7 @@ class MicropubControllerTest extends TestCase
{ {
$faker = \Faker\Factory::create(); $faker = \Faker\Factory::create();
$note = $faker->text; $note = $faker->text;
$response = $this->call( $response = $this->post(
'POST',
'/api/post', '/api/post',
[ [
'h' => 'entry', 'h' => 'entry',
@ -133,8 +132,6 @@ class MicropubControllerTest extends TestCase
'published' => Carbon::now()->toW3CString(), 'published' => Carbon::now()->toW3CString(),
'location' => 'geo:1.23,4.56', 'location' => 'geo:1.23,4.56',
], ],
[],
[],
['HTTP_Authorization' => 'Bearer ' . $this->getToken()] ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
); );
$response->assertJson(['response' => 'created']); $response->assertJson(['response' => 'created']);