mirror of
https://github.com/shlinkio/shlink.git
synced 2025-01-11 00:22:04 -06:00
Improved ShortUrlRepositoryTest
This commit is contained in:
parent
501a933d2e
commit
433a5a923d
@ -62,4 +62,21 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
||||
$this->assertNull($this->repo->findOneByShortCode($bar->getShortCode()));
|
||||
$this->assertNull($this->repo->findOneByShortCode($baz->getShortCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function countListReturnsProperNumberOfResults()
|
||||
{
|
||||
$count = 5;
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$this->getEntityManager()->persist(
|
||||
(new ShortUrl())->setOriginalUrl((string) $i)
|
||||
->setShortCode((string) $i)
|
||||
);
|
||||
}
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
$this->assertEquals($count, $this->repo->countList());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user