aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-20 15:36:25 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-03-06 20:50:30 +0100
commit1d14779154481b320e1c44fccf2558d8c9fa43a1 (patch)
tree45fbcb70457459b2359828fd035bb8936442fc02 /src/Wallabag/CoreBundle/Tests/Controller
parentaa4d6562c196926a55819326b0fbe504daf2156f (diff)
downloadwallabag-1d14779154481b320e1c44fccf2558d8c9fa43a1.tar.gz
wallabag-1d14779154481b320e1c44fccf2558d8c9fa43a1.tar.zst
wallabag-1d14779154481b320e1c44fccf2558d8c9fa43a1.zip
remove isDeleted flag
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php9
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php16
2 files changed, 13 insertions, 12 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 2634141e..99a3a945 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -161,18 +161,15 @@ class EntryControllerTest extends WallabagTestCase
161 $content = $client->getContainer() 161 $content = $client->getContainer()
162 ->get('doctrine.orm.entity_manager') 162 ->get('doctrine.orm.entity_manager')
163 ->getRepository('WallabagCoreBundle:Entry') 163 ->getRepository('WallabagCoreBundle:Entry')
164 ->findOneByIsDeleted(false); 164 ->findOneById(1);
165 165
166 $client->request('GET', '/delete/'.$content->getId()); 166 $client->request('GET', '/delete/'.$content->getId());
167 167
168 $this->assertEquals(302, $client->getResponse()->getStatusCode()); 168 $this->assertEquals(302, $client->getResponse()->getStatusCode());
169 169
170 $res = $client->getContainer() 170 $client->request('GET', '/delete/'.$content->getId());
171 ->get('doctrine.orm.entity_manager')
172 ->getRepository('WallabagCoreBundle:Entry')
173 ->findOneById($content->getId());
174 171
175 $this->assertEquals($res->isDeleted(), true); 172 $this->assertEquals(404, $client->getResponse()->getStatusCode());
176 } 173 }
177 174
178 public function testViewOtherUserEntry() 175 public function testViewOtherUserEntry()
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}