Uuid::uuid7()->toString(), 'hashcode' => Uuid::uuid4()->toString(), 'email' => new Email('test@example.com'), ]); // WHEN $result = $directory->find(Uuid::fromString($customer->id)); // THEN expect($result)->not->toBeNull(); expect($result->id)->toBe($customer->id); }); it('returns null if customer not found', function () { // GIVEN $directory = new EloquentCustomerDirectory(); // WHEN $result = $directory->find(Uuid::uuid7()); // THEN expect($result)->toBeNull(); }); it('gets a customer by email', function () { // GIVEN $directory = new EloquentCustomerDirectory(); $email = new Email('testfind@example.com'); $customer = Customer::forceCreate([ 'id' => Uuid::uuid7()->toString(), 'hashcode' => Uuid::uuid4()->toString(), 'email' => $email, ]); // WHEN $result = $directory->getCustomerByEmail($email); // THEN expect($result)->not->toBeNull(); expect($result->id)->toBe($customer->id); }); it('returns null if customer by email not found', function () { // GIVEN $directory = new EloquentCustomerDirectory(); $email = new Email('notfound@example.com'); // WHEN $result = $directory->getCustomerByEmail($email); // THEN expect($result)->toBeNull(); }); });