aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
index fcfa8ccf..4164e516 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -130,7 +130,7 @@ class WallabagRestControllerTest extends WallabagTestCase
130 $entry = $client->getContainer() 130 $entry = $client->getContainer()
131 ->get('doctrine.orm.entity_manager') 131 ->get('doctrine.orm.entity_manager')
132 ->getRepository('WallabagCoreBundle:Entry') 132 ->getRepository('WallabagCoreBundle:Entry')
133 ->findOneByIsDeleted(false); 133 ->findOneByUser(1);
134 134
135 if (!$entry) { 135 if (!$entry) {
136 $this->markTestSkipped('No content found in db.'); 136 $this->markTestSkipped('No content found in db.');
@@ -140,10 +140,14 @@ class WallabagRestControllerTest extends WallabagTestCase
140 140
141 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 141 $this->assertEquals(200, $client->getResponse()->getStatusCode());
142 142
143 $res = $client->getContainer() 143 // We'll try to delete this entry again
144 ->get('doctrine.orm.entity_manager') 144 $client->request('GET', '/api/salts/admin.json');
145 ->getRepository('WallabagCoreBundle:Entry') 145 $salt = json_decode($client->getResponse()->getContent());
146 ->findOneById($entry->getId()); 146
147 $this->assertEquals($res->isDeleted(), true); 147 $headers = $this->generateHeaders('admin', 'test', $salt[0]);
148
149 $client->request('DELETE', '/api/entries/'.$entry->getId().'.json', array(), array(), $headers);
150
151 $this->assertEquals(404, $client->getResponse()->getStatusCode());
148 } 152 }
149} 153}