Add a rudimentary API endpoint. TODO: Add auth to the API

This commit is contained in:
Lewis Dale committed 2023-03-21 08:42:01 +00:00
1 parent ec83d67bde
commit 7dc9d0a5cb
6 files changed
+161 -15

No files matched your search

+61
View File
@@ -241,4 +241,65 @@ class SqliteGatewayTest extends TestCase
$retrieved = $this->gateway->find(["author_name" => "Carl Weathers"]);
$this->assertCount(2, $retrieved);
}
public function testCanListAllWebmentions()
{
$this->gateway->save(new Webmention(
null,
"https://a-target-url.com",
"https://a-source-url.com",
MentionType::Like,
"Liked this post",
new \Lewisdale\Webmentions\Models\Author(
null,
"Doreen Mifah",
"https://my-homepage.com",
"https://cdn.imgserver.com/400/400"
)
));
$this->gateway->save(new Webmention(
null,
"https://a-target-url.com",
"https://a-source-url.com",
MentionType::Like,
"Liked this post",
new \Lewisdale\Webmentions\Models\Author(
null,
"Carl Weathers",
"https://carl-weathers.com",
"https://cdn.imgserver.com/400/400"
)
));
$this->gateway->save(new Webmention(
null,
"https://a-target-url.com",
"https://a-source-url.com",
MentionType::Like,
"Liked this post",
new \Lewisdale\Webmentions\Models\Author(
null,
"Barry White",
"https://barry.white.com",
"https://cdn.imgserver.com/400/400"
)
));
$this->gateway->save(new Webmention(
null,
"https://a-target-url.com",
"https://a-source-url.com",
MentionType::Reply,
"This was a cool post!",
new \Lewisdale\Webmentions\Models\Author(
null,
"Carl Weathers",
"https://carl-weathers.com",
"https://cdn.imgserver.com/400/400"
)
));
$this->assertCount(4, $this->gateway->list());
}
}