Skip to content

Commit

Permalink
[general] Use global date provider for doctrine timestampable (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 29, 2024
1 parent d9935e2 commit a916575
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 14 additions & 0 deletions tests/cases/unit/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
);
}

/**
Expand Down

0 comments on commit a916575

Please sign in to comment.