From c6a32325a8ae6687ea8a7eb01992b3c8084dd600 Mon Sep 17 00:00:00 2001 From: Sergio Mendolia Date: Fri, 26 Jan 2024 16:35:14 +0100 Subject: [PATCH] Fix tests --- data/database.sqlite | 0 src/Twig/UniqueIdExtension.php | 2 +- tests/GedmoTest.php | 11 +++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 data/database.sqlite diff --git a/data/database.sqlite b/data/database.sqlite new file mode 100644 index 00000000..e69de29b diff --git a/src/Twig/UniqueIdExtension.php b/src/Twig/UniqueIdExtension.php index b05e8abe..531165e2 100644 --- a/src/Twig/UniqueIdExtension.php +++ b/src/Twig/UniqueIdExtension.php @@ -7,7 +7,7 @@ class UniqueIdExtension extends AbstractExtension { - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('unique_id', [$this, 'uniqueID']), diff --git a/tests/GedmoTest.php b/tests/GedmoTest.php index 3b9dcee5..4a4cdf04 100644 --- a/tests/GedmoTest.php +++ b/tests/GedmoTest.php @@ -5,9 +5,11 @@ use App\Entity\Book; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; + class GedmoTest extends KernelTestCase { - protected function setUp(): void{ + protected function setUp(): void + { self::bootKernel(); /** @var EntityManagerInterface $entityManager */ @@ -16,7 +18,8 @@ protected function setUp(): void{ $entityManager->getConnection()->executeQuery("DELETE FROM book"); } - public function testTimestamp(): void{ + public function testTimestamp(): void + { /** @var EntityManagerInterface $entityManager */ $entityManager = self::getContainer()->get('doctrine.orm.entity_manager'); @@ -34,6 +37,6 @@ public function testTimestamp(): void{ self::assertNotNull($book->getCreated(), 'The created date should be set by Doctrine Extensions'); self::assertNotNull($book->getUpdated(), 'The updated date should be set by Doctrine Extensions'); - } + } -} \ No newline at end of file +}