Skip to content

Commit 5fe2d9b

Browse files
committed
extend test
1 parent 5f2c8ca commit 5fe2d9b

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
@@ -11,6 +11,22 @@ class PolicyResourceTest extends TestCase {
1111
use RefreshDatabase;
1212

1313
public function testActiveFrom(): void {
14+
$policy = Policy::create([
15+
'policy_type' => 'terms-of-use',
16+
'content_vue_file' => 'terms-of-use/example.vue',
17+
'active_from' => '2022-02-02',
18+
]);
19+
20+
$resource = new PolicyResource($policy);
21+
$data = json_decode($resource->toJson());
22+
23+
$this->assertEquals(
24+
data_get($data, 'metadata.active_from'),
25+
'2022-02-02',
26+
);
27+
}
28+
29+
public function testActiveFromNull(): void {
1430
$policy = Policy::create([
1531
'policy_type' => 'terms-of-use',
1632
'content_vue_file' => 'terms-of-use/example.vue',

0 commit comments

Comments
 (0)