]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
api: copy entry object before sending, to keep id
[github/wallabag/wallabag.git] / tests / Wallabag / ApiBundle / Controller / EntryRestControllerTest.php
index b0d4c4e1a609bfb8778fc1da9b310fe6cb64b082..2e9b93050e335456ca723d926ac40bbde001a727 100644 (file)
@@ -408,6 +408,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
 
         $this->assertSame($entry->getTitle(), $content['title']);
         $this->assertSame($entry->getUrl(), $content['url']);
+        $this->assertSame($entry->getId(), $content['id']);
 
         // We'll try to delete this entry again
         $this->client->request('DELETE', '/api/entries/' . $entry->getId() . '.json');
@@ -501,6 +502,8 @@ class EntryRestControllerTest extends WallabagApiTestCase
             $content = json_decode($this->client->getResponse()->getContent(), true);
             $this->assertGreaterThan(0, $content['id']);
             $this->assertSame('http://www.example.com/', $content['url']);
+            $this->assertSame('www.example.com', $content['domain_name']);
+            $this->assertSame('www.example.com', $content['title']);
         } finally {
             // Remove the created entry to avoid side effects on other tests
             if (isset($content['id'])) {