|
6 | 6 | use Bdf\Prime\Behaviors\Behavior; |
7 | 7 | use Bdf\Prime\Bench\HydratorGeneration; |
8 | 8 | use Bdf\Prime\Clock\ClockAwareInterface; |
| 9 | +use Bdf\Prime\Clock\NativeClock; |
9 | 10 | use Bdf\Prime\Customer; |
10 | 11 | use Bdf\Prime\CustomerCriteria; |
11 | 12 | use Bdf\Prime\CustomerMapper; |
|
16 | 17 | use Bdf\Prime\Entity\Hydrator\MapperHydratorInterface; |
17 | 18 | use Bdf\Prime\Exception\DBALException; |
18 | 19 | use Bdf\Prime\IdGenerators\AbstractGenerator; |
19 | | -use Bdf\Prime\IdGenerators\GeneratorInterface; |
20 | 20 | use Bdf\Prime\IdGenerators\GuidGenerator; |
21 | 21 | use Bdf\Prime\IdGenerators\NullGenerator; |
22 | 22 | use Bdf\Prime\IdGenerators\TableGenerator; |
@@ -83,8 +83,20 @@ public function test_default() |
83 | 83 | $this->assertTrue($mapper->hasSchemaManager()); |
84 | 84 | $this->assertInstanceOf(MapperHydrator::class, $mapper->hydrator()); |
85 | 85 | $this->assertNull($mapper->allowUnknownAttribute()); |
| 86 | + $this->assertSame(NativeClock::instance(), $mapper->clock()); |
86 | 87 | } |
87 | | - |
| 88 | + |
| 89 | + public function test_setClock() |
| 90 | + { |
| 91 | + $mapper = new TestEntityMapper(Prime::service(), TestEntity::class); |
| 92 | + $mapper->build(); |
| 93 | + |
| 94 | + $clock = $this->createMock(ClockInterface::class); |
| 95 | + $mapper->setClock($clock); |
| 96 | + |
| 97 | + $this->assertSame($clock, $mapper->clock()); |
| 98 | + } |
| 99 | + |
88 | 100 | /** |
89 | 101 | * |
90 | 102 | */ |
|
0 commit comments