mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
add more properties for entries #1634
This commit is contained in:
parent
9e3355ee4f
commit
816ad4051b
2 changed files with 53 additions and 0 deletions
|
@ -162,6 +162,40 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
|||
$this->assertCount(1, $content['tags']);
|
||||
}
|
||||
|
||||
public function testPostArchivedEntry()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', array(
|
||||
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
|
||||
'archive' => true,
|
||||
'starred' => false,
|
||||
));
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertGreaterThan(0, $content['id']);
|
||||
$this->assertEquals('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
|
||||
$this->assertEquals(true, $content['is_archived']);
|
||||
$this->assertEquals(false, $content['is_starred']);
|
||||
}
|
||||
|
||||
public function testPostEntryWithContent()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', array(
|
||||
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
|
||||
'content' => 'This is a new content for my entry',
|
||||
));
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertGreaterThan(0, $content['id']);
|
||||
$this->assertEquals('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
|
||||
$this->assertEquals('This is a new content for my entry', $content['content']);
|
||||
}
|
||||
|
||||
public function testPatchEntry()
|
||||
{
|
||||
$entry = $this->client->getContainer()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue