@@ -445,17 +445,16 @@ of the UUID parameters::
445445 }
446446 }
447447
448- MockUuidFactory
449- ===============
448+ Testing UUIDs
449+ ~~~~~~~~~~~~~
450450
451- ..versionadded ::7.4
452-
453- The:class: `Symfony\\ Component\\ Uid\\ Factory\\ MockUuidFactory ` class was introduced in Symfony 7.4.
454-
455- The:class: `Symfony\\ Component\\ Uid\\ Factory\\ MockUuidFactory ` class allows you to
456- control the UUIDs generated during your tests, making them predictable and reproducible.
451+ Many UUID versions include random or time-dependent parts, which makes them
452+ hard to use in tests. The:class: `Symfony\\ Component\\ Uid\\ Factory\\ MockUuidFactory `
453+ class allows you to control the UUIDs generated during your tests, making them
454+ predictable and reproducible.
457455
458- Suppose you have a service that generates a UUID for each new user::
456+ First, make sure that your service generates UUID values using the
457+ :class: `Symfony\\ Component\\ Uid\\ Factory\\ UuidFactory `::
459458
460459 use Symfony\Component\Uid\Factory\UuidFactory;
461460 use Symfony\Component\Uid\Uuid;
@@ -473,15 +472,16 @@ Suppose you have a service that generates a UUID for each new user::
473472 }
474473 }
475474
476- In your tests, you can use ``MockUuidFactory `` to inject predictable UUIDs and verify the expected behavior::
475+ Then, in your tests, you can use ``MockUuidFactory `` to define a sequence of the
476+ UUIDs that will be returned each time you generate one::
477477
478478 use PHPUnit\Framework\TestCase;
479479 use Symfony\Component\Uid\Factory\MockUuidFactory;
480480 use Symfony\Component\Uid\UuidV4;
481481
482482 class UserServiceTest extends TestCase
483483 {
484- public functiontestCreateUserIdReturnsExpectedUuid()
484+ public functiontestCreateUserId(): void
485485 {
486486 $factory = new MockUuidFactory([
487487 UuidV4::fromString('11111111-1111-4111-8111-111111111111'),
@@ -495,15 +495,14 @@ In your tests, you can use ``MockUuidFactory`` to inject predictable UUIDs and v
495495 }
496496 }
497497
498- .. warning ::
499-
500- `` MockUuidFactory `` is intended for use intests only and should never be used in production .
498+ In addition to the `` create() `` method, the `` MockUuidFactory `` also works for
499+ the `` randomBased() ``, `` timeBased() ``, and `` nameBased() `` methods. You can even
500+ mix different UUID versions inthe same sequence .
501501
502502..note ::
503503
504- - Supports the:method: `Symfony\\ Component\\ Uid\\ Factory\\ MockUuidFactory::create `,:method: `Symfony\\ Component\\ Uid\\ Factory\\ MockUuidFactory::randomBased `,:method: `Symfony\\ Component\\ Uid\\ Factory\\ MockUuidFactory::timeBased `, and:method: `Symfony\\ Component\\ Uid\\ Factory\\ MockUuidFactory::nameBased ` methods.
505- - You can mix different UUID versions in the same sequence.
506- - Throws an exception if the sequence is exhausted or the type does not match.
504+ ``MockUuidFactory `` throws an exception if the sequence is exhausted or the
505+ available UUID types don't match the requested type.
507506
508507.. _ulid :
509508