mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-26 18:21:02 +00:00
Keep url in exists endpoint
- Add migration - Use md5 instead of sha512 (we don't need security here, just a hash) - Update tests
This commit is contained in:
parent
bfe02a0b48
commit
9c2b2aae70
8 changed files with 155 additions and 78 deletions
|
@ -22,7 +22,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
|||
'command' => $command->getName(),
|
||||
]);
|
||||
|
||||
$this->assertContains('Generating hashed urls for the 3 user account entries', $tester->getDisplay());
|
||||
$this->assertContains('Generating hashed urls for "3" users', $tester->getDisplay());
|
||||
$this->assertContains('Finished generated hashed urls', $tester->getDisplay());
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
|||
'username' => 'admin',
|
||||
]);
|
||||
|
||||
$this->assertContains('Generated hashed urls for user admin', $tester->getDisplay());
|
||||
$this->assertContains('Generated hashed urls for user: admin', $tester->getDisplay());
|
||||
}
|
||||
|
||||
public function testGenerateUrls()
|
||||
|
@ -88,11 +88,11 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
|||
'username' => 'admin',
|
||||
]);
|
||||
|
||||
$this->assertContains('Generated hashed urls for user admin', $tester->getDisplay());
|
||||
$this->assertContains('Generated hashed urls for user: admin', $tester->getDisplay());
|
||||
|
||||
$entry = $em->getRepository('WallabagCoreBundle:Entry')->findOneByUrl($url);
|
||||
|
||||
$this->assertEquals($entry->getHashedUrl(), hash('sha512', $url));
|
||||
$this->assertSame($entry->getHashedUrl(), hash('md5', $url));
|
||||
|
||||
$query = $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.url = :url');
|
||||
$query->setParameter('url', $url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue