Skip to content

Commit 6b8db67

Browse files
committed
Re-add test
1 parent 7678ce5 commit 6b8db67

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/Unit/AnonymizedModelTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,20 @@
131131
->and($model->getAttributeValue('address'))->toBe('1600 Pennsylvania Avenue');
132132
});
133133

134+
it('disables anonymization within withoutAnonymization block', function () {
135+
Anonymize::enable();
136+
137+
$original = [
138+
'name' => 'Foo Bar',
139+
'address' => '1600 Pennsylvania Avenue',
140+
];
141+
142+
$attributes = (new AnonymizedModel($original))
143+
->withoutAnonymization(fn ($model) => $model->attributesToArray());
144+
145+
expect($attributes)->toBe($original);
146+
});
147+
134148
it('includes id in seed by default', function () {
135149
$id = fake()->randomNumber();
136150

0 commit comments

Comments
 (0)