Reduced amount of dead lines in tests

This commit is contained in:
Alejandro Celaya
2019-02-17 20:28:34 +01:00
parent 1bcd03b150
commit 687a1cc9c7
100 changed files with 481 additions and 938 deletions

View File

@@ -30,9 +30,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
$this->repo = $this->getEntityManager()->getRepository(ShortUrl::class);
}
/**
* @test
*/
/** @test */
public function findOneByShortCodeReturnsProperData()
{
$foo = new ShortUrl('foo');
@@ -62,9 +60,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
$this->assertNull($this->repo->findOneByShortCode($baz->getShortCode()));
}
/**
* @test
*/
/** @test */
public function countListReturnsProperNumberOfResults()
{
$count = 5;
@@ -78,9 +74,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
$this->assertEquals($count, $this->repo->countList());
}
/**
* @test
*/
/** @test */
public function findListProperlyFiltersByTagAndSearchTerm()
{
$tag = new Tag('bar');
@@ -125,9 +119,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
$this->assertSame($bar, $result[0]);
}
/**
* @test
*/
/** @test */
public function findListProperlyMapsFieldNamesToColumnNamesWhenOrdering()
{
$urls = ['a', 'z', 'c', 'b'];

View File

@@ -21,17 +21,13 @@ class TagRepositoryTest extends DatabaseTestCase
$this->repo = $this->getEntityManager()->getRepository(Tag::class);
}
/**
* @test
*/
/** @test */
public function deleteByNameDoesNothingWhenEmptyListIsProvided()
{
$this->assertEquals(0, $this->repo->deleteByName([]));
}
/**
* @test
*/
/** @test */
public function allTagsWhichMatchNameAreDeleted()
{
$names = ['foo', 'bar', 'baz'];