mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Add a validator on URL entity
This commit is contained in:
parent
3f491fe9ca
commit
67c5270fdc
5 changed files with 78 additions and 5 deletions
|
@ -601,6 +601,25 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
|||
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
public function testBadFormatURL()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', [
|
||||
'url' => 'wallabagIsAwesome',
|
||||
'tags' => 'google',
|
||||
'title' => 'New title for my article',
|
||||
'content' => 'my content',
|
||||
'language' => 'de',
|
||||
'published_at' => '2016-09-08T11:55:58+0200',
|
||||
'authors' => 'bob,helen',
|
||||
'public' => 1,
|
||||
]);
|
||||
|
||||
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
$this->assertStringContainsString('The url \'"wallabagIsAwesome"\' is not a valid url', $content['message']);
|
||||
}
|
||||
|
||||
public function testPostEntry()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue