From a916575e206a9ea096802ced991ed72a398ea446 Mon Sep 17 00:00:00 2001 From: GitHub Date: Thu, 29 Aug 2024 09:47:05 +0000 Subject: [PATCH] [general] Use global date provider for doctrine timestampable (#310) --- composer.json | 1 - tests/cases/unit/BaseTestCase.php | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b63b9e0..5dd3a75 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,6 @@ "bunny/bunny": "0.6.x-dev", "cweagans/composer-patches": "^1.7", "fastybird/application-library": "dev-main", - "fastybird/datetime-factory": "^0.6", "fastybird/exchange-library": "dev-main", "fastybird/metadata-library": "dev-main", "nette/di": "^3.0", diff --git a/tests/cases/unit/BaseTestCase.php b/tests/cases/unit/BaseTestCase.php index 84fadd9..dcbeef6 100644 --- a/tests/cases/unit/BaseTestCase.php +++ b/tests/cases/unit/BaseTestCase.php @@ -7,6 +7,7 @@ use FastyBird\DateTimeFactory; use FastyBird\Library\Application\Boot as ApplicationBoot; use FastyBird\Library\Application\Exceptions as ApplicationExceptions; +use FastyBird\Library\Application\Utilities as ApplicationUtilities; use FastyBird\Plugin\RabbitMq; use Nette; use Nette\DI; @@ -43,6 +44,19 @@ protected function setUp(): void DateTimeFactory\Factory::class, $dateTimeFactory, ); + + $dateTimeProvider = $this->createMock(ApplicationUtilities\DateTimeProvider::class); + $dateTimeProvider + ->method('getDate') + ->willReturn($dateTimeFactory->getNow()); + $dateTimeProvider + ->method('getTimestamp') + ->willReturn($dateTimeFactory->getNow()->getTimestamp()); + + $this->mockContainerService( + ApplicationUtilities\DateTimeProvider::class, + $dateTimeProvider, + ); } /**