Add a test for JSON request to endpoint
This commit is contained in:
parent
72e61032d8
commit
7d381eaf81
2 changed files with 20 additions and 1 deletions
|
@ -100,6 +100,25 @@ class MicropubTest extends TestCase
|
|||
$this->seeInDatabase('places', ['slug' => 'the-barton-arms']);
|
||||
}
|
||||
|
||||
public function testMicropubJSONRequestCreateNewNote()
|
||||
{
|
||||
$faker = \Faker\Factory::create();
|
||||
$note = $faker->text;
|
||||
$this->json(
|
||||
'POST',
|
||||
$this->appurl . '/api/post',
|
||||
[
|
||||
'type' => ['h-entry'],
|
||||
'properties' => [
|
||||
'content' => [$note],
|
||||
],
|
||||
],
|
||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||
)->seeJson([
|
||||
'response' => 'created'
|
||||
]);
|
||||
}
|
||||
|
||||
private function getToken()
|
||||
{
|
||||
$signer = new Sha256();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue