toBeInstanceOf(HasTimestampIdentifier::class) ->and($brand->name)->toBe($brandName) ->and($brand->code)->toBe($brandCode) ->and($brand->arcadiaId)->toBe($arcadiaId) ->and($brand->createdAt())->toBeInstanceOf(\DateTimeInterface::class) ->and($brand->createdAt()->getTimestamp())->toBeLessThanOrEqual(time()); }); it('hydrates a brand correctly', function (): void { // GIVEN $uuid = Uuid::uuid7(); $brandId = new BrandId($uuid); $brandCode = new BrandCode('LGL89'); $arcadiaId = new ArcadiaId(123); $brandName = new BrandName('Arcadia Brand Name'); // WHEN $brand = Brand::hydrate( id: $brandId, name: $brandName, code: $brandCode, arcadiaId: $arcadiaId, ); // THEN expect($brand)->toBeInstanceOf(HasTimestampIdentifier::class) ->and($brand->id())->toBe($brandId) ->and($brand->name)->toBe($brandName) ->and($brand->code)->toBe($brandCode) ->and($brand->arcadiaId)->toBe($arcadiaId) ->and($brand->createdAt())->toBeInstanceOf(\DateTimeInterface::class) ->and($brand->createdAt()->getTimestamp())->toBeLessThanOrEqual(time()); }); });