Squashed commit of the following:
commit fcebc08f6d89437ba84288a25498ae094fd4f16d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 10 21:59:33 2018 +0000 update changelog commit 74491698857cb2e111006efb349e1f10c2e3cf1d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 10 21:58:25 2018 +0000 Modify the micropub controller to look for the token in the right palce (as set by the token middleware commit 0fd11ff8391062fbe70f3a28d6a98694dc25b36b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 10 21:57:40 2018 +0000 If the access token is sent as a bearer token in the http headers, merge it into the request data so the controllers only have one place to look commit 9e154ec4bc17be3071280409a3f6bb7f02dad816 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 10 21:56:33 2018 +0000 Add a test with the access token being form encoded
This commit is contained in:
parent
a5f17944d2
commit
8772db973b
4 changed files with 37 additions and 9 deletions
|
@ -875,4 +875,22 @@ class MicropubControllerTest extends TestCase
|
|||
$response->assertStatus(400);
|
||||
$response->assertJson(['error_description' => 'The uploaded file failed validation']);
|
||||
}
|
||||
|
||||
public function test_access_token_form_encoded()
|
||||
{
|
||||
$faker = \Faker\Factory::create();
|
||||
$note = $faker->text;
|
||||
$response = $this->call(
|
||||
'POST',
|
||||
'/api/post',
|
||||
[
|
||||
'h' => 'entry',
|
||||
'content' => $note,
|
||||
'published' => Carbon::now()->toW3CString(),
|
||||
'access_token' => $this->getToken(),
|
||||
]
|
||||
);
|
||||
$response->assertJson(['response' => 'created']);
|
||||
$this->assertDatabaseHas('notes', ['note' => $note]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue