Skip to content

Commit fc00a0d

Browse files
committed
add explicit null test case
1 parent a26d10d commit fc00a0d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/Resources/PolicyResourceTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,20 @@ public function testActiveFromNull(): void {
4040
data_get($data, 'metadata.active_from'),
4141
);
4242
}
43+
44+
public function testActiveFromNullExplicit(): void {
45+
$policy = Policy::create([
46+
'policy_type' => 'terms-of-use',
47+
'content_vue_file' => 'terms-of-use/example.vue',
48+
'active_from' => null,
49+
]);
50+
51+
$resource = new PolicyResource($policy);
52+
$data = $resource->resolve();
53+
54+
$this->assertSame(
55+
null,
56+
data_get($data, 'metadata.active_from'),
57+
);
58+
}
4359
}

0 commit comments

Comments
 (0)