class CleanDuplicatesCommandTest extends WallabagCoreTestCase
{
- public function testTagAll()
+ public function testRunCleanDuplicates()
{
$application = new Application($this->getClient()->getKernel());
$application->add(new CleanDuplicatesCommand());
$this->assertContains('Finished cleaning. 0 duplicates found in total', $tester->getDisplay());
}
- public function testRunTagAllCommandWithBadUsername()
+ public function testRunCleanDuplicatesCommandWithBadUsername()
{
$application = new Application($this->getClient()->getKernel());
$application->add(new CleanDuplicatesCommand());
$this->assertContains('User "unknown" not found', $tester->getDisplay());
}
- public function testRunTagAllCommandForUser()
+ public function testRunCleanDuplicatesCommandForUser()
{
$application = new Application($this->getClient()->getKernel());
$application->add(new CleanDuplicatesCommand());
$nbEntries = $em->getRepository('WallabagCoreBundle:Entry')->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertCount(1, $nbEntries);
+
+ $query = $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.url = :url');
+ $query->setParameter('url', $url);
+ $query->execute();
}
}