Skip to content

Commit 2ca6f9a

Browse files
committed
Add test for nullable property
1 parent 89aee26 commit 2ca6f9a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/ActivityLoggerTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,21 @@
148148
expect($firstActivity->getExtraProperty('property.subProperty'))->toEqual('value');
149149
});
150150

151+
it('can log activity with null properties', function () {
152+
$properties = [
153+
'property' => null
154+
];
155+
156+
activity()
157+
->withProperties($properties)
158+
->log($this->activityDescription);
159+
160+
$firstActivity = Activity::first();
161+
162+
expect($firstActivity->properties)->toBeInstanceOf(Collection::class);
163+
expect($firstActivity->getExtraProperty('property'))->toBeNull();
164+
});
165+
151166
it('can log activity with a single properties', function () {
152167
activity()
153168
->withProperty('key', 'value')

0 commit comments

Comments
 (0)