Updated to coding standard v2.1

This commit is contained in:
Alejandro Celaya
2020-01-01 20:48:31 +01:00
parent 1070482629
commit 50100c251e
112 changed files with 253 additions and 300 deletions

View File

@@ -43,7 +43,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
$notYetValid = new ShortUrl(
'bar',
ShortUrlMeta::createFromParams(Chronos::now()->addMonth(), null, 'bar_very_long_text')
ShortUrlMeta::createFromParams(Chronos::now()->addMonth(), null, 'bar_very_long_text'),
);
$this->getEntityManager()->persist($notYetValid);
@@ -82,11 +82,11 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
$this->assertSame($withDomain, $this->repo->findOneByShortCode($withDomain->getShortCode(), 'example.com'));
$this->assertSame(
$withDomainDuplicatingRegular,
$this->repo->findOneByShortCode($withDomainDuplicatingRegular->getShortCode(), 'doma.in')
$this->repo->findOneByShortCode($withDomainDuplicatingRegular->getShortCode(), 'doma.in'),
);
$this->assertSame(
$regularOne,
$this->repo->findOneByShortCode($withDomainDuplicatingRegular->getShortCode(), 'other-domain.com')
$this->repo->findOneByShortCode($withDomainDuplicatingRegular->getShortCode(), 'other-domain.com'),
);
$this->assertNull($this->repo->findOneByShortCode('invalid'));
$this->assertNull($this->repo->findOneByShortCode($withDomain->getShortCode()));
@@ -160,7 +160,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
$this->assertCount(
2,
$this->repo->findList(null, null, null, [], null, new DateRange(Chronos::now()->subDays(2)))
$this->repo->findList(null, null, null, [], null, new DateRange(Chronos::now()->subDays(2))),
);
$this->assertEquals(2, $this->repo->countList(null, [], new DateRange(Chronos::now()->subDays(2))));
}
@@ -192,7 +192,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
$shortUrlWithDomain = new ShortUrl(
'foo',
ShortUrlMeta::createFromRawData(['domain' => 'doma.in', 'customSlug' => 'another-slug'])
ShortUrlMeta::createFromRawData(['domain' => 'doma.in', 'customSlug' => 'another-slug']),
);
$this->getEntityManager()->persist($shortUrlWithDomain);

View File

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

View File

@@ -85,10 +85,10 @@ class VisitRepositoryTest extends DatabaseTestCase
$this->assertCount(6, $this->repo->findVisitsByShortCode($shortUrl->getShortCode()));
$this->assertCount(2, $this->repo->findVisitsByShortCode($shortUrl->getShortCode(), new DateRange(
Chronos::parse('2016-01-02'),
Chronos::parse('2016-01-03')
Chronos::parse('2016-01-03'),
)));
$this->assertCount(4, $this->repo->findVisitsByShortCode($shortUrl->getShortCode(), new DateRange(
Chronos::parse('2016-01-03')
Chronos::parse('2016-01-03'),
)));
$this->assertCount(3, $this->repo->findVisitsByShortCode($shortUrl->getShortCode(), null, 3, 2));
$this->assertCount(2, $this->repo->findVisitsByShortCode($shortUrl->getShortCode(), null, 5, 4));
@@ -110,10 +110,10 @@ class VisitRepositoryTest extends DatabaseTestCase
$this->assertEquals(6, $this->repo->countVisitsByShortCode($shortUrl->getShortCode()));
$this->assertEquals(2, $this->repo->countVisitsByShortCode($shortUrl->getShortCode(), new DateRange(
Chronos::parse('2016-01-02'),
Chronos::parse('2016-01-03')
Chronos::parse('2016-01-03'),
)));
$this->assertEquals(4, $this->repo->countVisitsByShortCode($shortUrl->getShortCode(), new DateRange(
Chronos::parse('2016-01-03')
Chronos::parse('2016-01-03'),
)));
}
}