diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-06-07 15:40:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-07 15:40:59 +0200 |
commit | c0d756f67d1cc0fc6832d404a09729f9219f0595 (patch) | |
tree | 0a6ca6138d6de94529202dccebd0bcd9c2fdb21b /tests/Wallabag | |
parent | 4e4a5b534ff241f25c35fad24c9c79eb12f4adde (diff) | |
parent | db0c48af361eb20fbfcac625869de6f26112d3f7 (diff) | |
download | wallabag-c0d756f67d1cc0fc6832d404a09729f9219f0595.tar.gz wallabag-c0d756f67d1cc0fc6832d404a09729f9219f0595.tar.zst wallabag-c0d756f67d1cc0fc6832d404a09729f9219f0595.zip |
Merge pull request #3181 from wallabag/api-content-patch
Add ability to patch an entry with more fields
Diffstat (limited to 'tests/Wallabag')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 0968cfaf..74ec34b1 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |||
@@ -477,6 +477,10 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
477 | 'tags' => 'new tag '.uniqid(), | 477 | 'tags' => 'new tag '.uniqid(), |
478 | 'starred' => '1', | 478 | 'starred' => '1', |
479 | 'archive' => '0', | 479 | 'archive' => '0', |
480 | 'language' => 'de_DE', | ||
481 | 'preview_picture' => 'http://preview.io/picture.jpg', | ||
482 | 'authors' => 'bob,sponge', | ||
483 | 'content' => 'awesome', | ||
480 | ]); | 484 | ]); |
481 | 485 | ||
482 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | 486 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
@@ -488,6 +492,11 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
488 | $this->assertEquals('New awesome title', $content['title']); | 492 | $this->assertEquals('New awesome title', $content['title']); |
489 | $this->assertGreaterThan($nbTags, count($content['tags'])); | 493 | $this->assertGreaterThan($nbTags, count($content['tags'])); |
490 | $this->assertEquals(1, $content['user_id']); | 494 | $this->assertEquals(1, $content['user_id']); |
495 | $this->assertEquals('de_DE', $content['language']); | ||
496 | $this->assertEquals('http://preview.io/picture.jpg', $content['preview_picture']); | ||
497 | $this->assertContains('sponge', $content['published_by']); | ||
498 | $this->assertContains('bob', $content['published_by']); | ||
499 | $this->assertEquals('awesome', $content['content']); | ||
491 | } | 500 | } |
492 | 501 | ||
493 | public function testPatchEntryWithoutQuotes() | 502 | public function testPatchEntryWithoutQuotes() |
@@ -509,6 +518,7 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
509 | 'tags' => 'new tag '.uniqid(), | 518 | 'tags' => 'new tag '.uniqid(), |
510 | 'starred' => 1, | 519 | 'starred' => 1, |
511 | 'archive' => 0, | 520 | 'archive' => 0, |
521 | 'authors' => ['bob', 'sponge'], | ||
512 | ]); | 522 | ]); |
513 | 523 | ||
514 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | 524 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
@@ -519,6 +529,7 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
519 | $this->assertEquals($entry->getUrl(), $content['url']); | 529 | $this->assertEquals($entry->getUrl(), $content['url']); |
520 | $this->assertEquals('New awesome title', $content['title']); | 530 | $this->assertEquals('New awesome title', $content['title']); |
521 | $this->assertGreaterThan($nbTags, count($content['tags'])); | 531 | $this->assertGreaterThan($nbTags, count($content['tags'])); |
532 | $this->assertTrue(empty($content['published_by']), 'Authors were not saved because of an array instead of a string'); | ||
522 | } | 533 | } |
523 | 534 | ||
524 | public function testGetTagsEntry() | 535 | public function testGetTagsEntry() |