aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Command
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2019-04-01 11:50:33 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-04-01 13:24:40 +0200
commit9c2b2aae70b06411336e6eb6ac43b3ebd30dc38c (patch)
treeb8b37a0f8b3edd0c4db1678815d906a7b6126f31 /tests/Wallabag/CoreBundle/Command
parentbfe02a0b481055bb4e799200c8daa9a0ad987c71 (diff)
downloadwallabag-9c2b2aae70b06411336e6eb6ac43b3ebd30dc38c.tar.gz
wallabag-9c2b2aae70b06411336e6eb6ac43b3ebd30dc38c.tar.zst
wallabag-9c2b2aae70b06411336e6eb6ac43b3ebd30dc38c.zip
Keep url in exists endpoint
- Add migration - Use md5 instead of sha512 (we don't need security here, just a hash) - Update tests
Diffstat (limited to 'tests/Wallabag/CoreBundle/Command')
-rw-r--r--tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php b/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php
index 8ca772cb..cc1e3fbc 100644
--- a/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php
+++ b/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php
@@ -22,7 +22,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
22 'command' => $command->getName(), 22 'command' => $command->getName(),
23 ]); 23 ]);
24 24
25 $this->assertContains('Generating hashed urls for the 3 user account entries', $tester->getDisplay()); 25 $this->assertContains('Generating hashed urls for "3" users', $tester->getDisplay());
26 $this->assertContains('Finished generated hashed urls', $tester->getDisplay()); 26 $this->assertContains('Finished generated hashed urls', $tester->getDisplay());
27 } 27 }
28 28
@@ -55,7 +55,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
55 'username' => 'admin', 55 'username' => 'admin',
56 ]); 56 ]);
57 57
58 $this->assertContains('Generated hashed urls for user admin', $tester->getDisplay()); 58 $this->assertContains('Generated hashed urls for user: admin', $tester->getDisplay());
59 } 59 }
60 60
61 public function testGenerateUrls() 61 public function testGenerateUrls()
@@ -88,11 +88,11 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
88 'username' => 'admin', 88 'username' => 'admin',
89 ]); 89 ]);
90 90
91 $this->assertContains('Generated hashed urls for user admin', $tester->getDisplay()); 91 $this->assertContains('Generated hashed urls for user: admin', $tester->getDisplay());
92 92
93 $entry = $em->getRepository('WallabagCoreBundle:Entry')->findOneByUrl($url); 93 $entry = $em->getRepository('WallabagCoreBundle:Entry')->findOneByUrl($url);
94 94
95 $this->assertEquals($entry->getHashedUrl(), hash('sha512', $url)); 95 $this->assertSame($entry->getHashedUrl(), hash('md5', $url));
96 96
97 $query = $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.url = :url'); 97 $query = $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.url = :url');
98 $query->setParameter('url', $url); 98 $query->setParameter('url', $url);