Skip to content

Commit ffe974e

Browse files
authored
[TESTS] Backported ClockMock mocking (#91)
1 parent 8980c90 commit ffe974e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/bootstrap.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@
44
* @copyright Copyright (C) Ibexa AS. All rights reserved.
55
* @license For full copyright and license information view LICENSE file distributed with this source code.
66
*/
7+
use Ibexa\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase;
8+
use Ibexa\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase\QueryBuilder;
9+
use Ibexa\Core\Repository\ContentService;
10+
use Symfony\Bridge\PhpUnit\ClockMock;
11+
712
$file = __DIR__ . '/../vendor/autoload.php';
813
if (!file_exists($file)) {
914
throw new RuntimeException('Install dependencies using composer to run the test suite.');
1015
}
1116

17+
// Register ClockMock, as otherwise they are mocked until first method call.
18+
// Those Mocks are needed for core integration setup.
19+
20+
ClockMock::register(DoctrineDatabase::class);
21+
ClockMock::register(ContentService::class);
22+
ClockMock::register(QueryBuilder::class);
23+
1224
$autoload = require_once $file;

0 commit comments

Comments
 (0)