@@ -42,17 +42,20 @@ public function testCreate()
4242}
4343```
4444
45- Methods list:
46- * ` assertNotificationsSent($fixture, $options = [], $exportMode = false) ` - compares all the sent
47- notifications with the ` $fixture ` , exporting it instead of comparing when ` $exportMode ` is enabled,
48- the same way the other fixture assertions of the package work.
45+ ### assertNotificationsSent()
46+
47+ ` assertNotificationsSent(string $fixture, array $options = [], bool $exportMode = false): void `
48+
49+ Compares all the sent notifications with the ` $fixture ` , exporting it instead of comparing when
50+ ` $exportMode ` is enabled, the same way the other fixture assertions of the package work.
4951
5052Every entry of the fixture is placed under the notification class name and contains the
5153` notification ` properties of any visibility except ` id ` , the ` channels ` returned by ` via() ` , the
52- ` notifiable ` and the ` locale ` . The ` notifiable ` always keeps its ` class ` next to the ` attributes ` , so
53- notifiables of different classes sharing a primary key stay distinguishable. The attributes of a
54- model are its primary key, of any other notifiable, e.g. ` Illuminate\Notifications\AnonymousNotifiable ` ,
55- its public properties:
54+ ` notifiable ` and the ` locale ` . The ` id ` is dropped because it is a random uuid assigned on sending,
55+ which would make every fixture unstable. The ` notifiable ` always keeps its ` class ` next to the
56+ ` attributes ` , so notifiables of different classes sharing a primary key stay distinguishable. The
57+ attributes of a model are its primary key. For any other notifiable, e.g.
58+ ` Illuminate\Notifications\AnonymousNotifiable ` , they are its public properties:
5659
5760``` json
5861{
@@ -81,7 +84,7 @@ notifiable key, and only then by the send order within that group. Sending a not
8184notifiable, then to another one, and then to the first one again puts the third entry before the
8285second one, so the fixture must not be read as a chronological sequence.
8386
84- The properties of a notification rarely describe what a channel delivers, the channel methods do.
87+ The properties of a notification rarely describe what a channel delivers — the channel methods do.
8588The ` $options ` argument adds such data to every entry, describing each field by a chain of steps
8689resolved on the notification:
8790
@@ -91,7 +94,6 @@ properties, the magic ones exposed via `__isset()` and the attributes of an Eloq
9194* the notifiable is passed as the first argument to every method that accepts at least one parameter,
9295the way Laravel dispatches channel methods, so parameterless methods of nested objects, e.g.
9396` DateTimeImmutable::getTimestamp() ` , are called without arguments,
94- * a non-public member is not resolvable, a step pointing at one fails the test,
9597* field names must not collide with the reserved ones: ` notification ` , ` channels ` , ` notifiable ` ,
9698` locale ` .
9799
@@ -108,8 +110,8 @@ $this->assertNotificationsSent(
108110);
109111```
110112
111- The chain of a channel is the same in every test, so declare an assertion per channel in the project
112- ` TestCase ` and keep the tests free of the chain definitions.
113+ The chain of a channel is usually the same in every test, so declare an assertion per channel in the
114+ project ` TestCase ` and keep the tests free of the chain definitions.
113115
114116** Example**
115117
@@ -150,7 +152,7 @@ An internal helper of `NotificationsMockTrait`, not meant to be used directly.
150152Methods list:
151153* ` getObjectAttributes($object) ` - dumps the object properties of any visibility into an array,
152154skipping the static ones and the typed ones that were never initialized. Private properties declared
153- on parent classes are not captured, since they are not accessible on the object class reflection .
155+ on parent classes are not captured.
154156
155157## SearchTrait
156158
0 commit comments