From 621f18bf40063db42725307bd7a05c6ba7529566 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 28 Jan 2023 10:20:57 +0100 Subject: [PATCH] Recover DB test only for platforms in which it passes --- .../ShortUrl/Repository/ShortUrlRepositoryTest.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/module/Core/test-db/ShortUrl/Repository/ShortUrlRepositoryTest.php b/module/Core/test-db/ShortUrl/Repository/ShortUrlRepositoryTest.php index b5633ee6..dd0cc4f0 100644 --- a/module/Core/test-db/ShortUrl/Repository/ShortUrlRepositoryTest.php +++ b/module/Core/test-db/ShortUrl/Repository/ShortUrlRepositoryTest.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace ShlinkioDbTest\Shlink\Core\ShortUrl\Repository; use Cake\Chronos\Chronos; +use Doctrine\DBAL\Platforms\SQLServerPlatform; use Shlinkio\Shlink\Core\Domain\Entity\Domain; use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl; use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation; @@ -60,10 +61,13 @@ class ShortUrlRepositoryTest extends DatabaseTestCase ShortUrlIdentifier::fromShortCodeAndDomain('fOo'), ShortUrlMode::LOOSELY, )); -// self::assertNull($this->repo->findOneWithDomainFallback( // TODO MS is doing loosely checks always -// ShortUrlIdentifier::fromShortCodeAndDomain('foo'), -// ShortUrlMode::STRICT, -// )); + // TODO MS is doing loosely checks always, making this fail. + if (! $this->getEntityManager()->getConnection()->getDatabasePlatform() instanceof SQLServerPlatform) { + self::assertNull($this->repo->findOneWithDomainFallback( + ShortUrlIdentifier::fromShortCodeAndDomain('foo'), + ShortUrlMode::STRICT, + )); + } self::assertSame($regularOne, $this->repo->findOneWithDomainFallback( ShortUrlIdentifier::fromShortCodeAndDomain($withDomainDuplicatingRegular->getShortCode()), ShortUrlMode::STRICT,