mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Improved ShortUrlRepositoryTest
This commit is contained in:
parent
501a933d2e
commit
433a5a923d
1 changed files with 17 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue