@@ -69,9 +69,13 @@ public function it_returns_page_entity_with_filled_properties()
69
69
// check properties
70
70
$ this ->assertSame ('Notion Is Awesome ' , $ pageResult ->getTitle ());
71
71
$ this ->assertSame ('page ' , $ pageResult ->getObjectType ());
72
- $ this ->assertCount (7 , $ pageResult ->getRawProperties ());
73
- $ this ->assertCount (7 , $ pageResult ->getProperties ());
74
- $ this ->assertCount (7 , $ pageResult ->getPropertyKeys ());
72
+ $ this ->assertCount (9 , $ pageResult ->getRawProperties ());
73
+ $ this ->assertCount (9 , $ pageResult ->getProperties ());
74
+ $ this ->assertCount (9 , $ pageResult ->getPropertyKeys ());
75
+
76
+ // check date and datetime properties
77
+ $ this ->assertTrue ($ pageResult ->getProperty ('DateWithTime ' )->hasTime ());
78
+ $ this ->assertFalse ($ pageResult ->getProperty ('DateWithoutTime ' )->hasTime ());
75
79
76
80
$ this ->assertInstanceOf (Carbon::class, $ pageResult ->getCreatedTime ());
77
81
$ this ->assertInstanceOf (Carbon::class, $ pageResult ->getLastEditedTime ());
@@ -179,6 +183,7 @@ public function it_assembles_properties_for_a_new_page()
179
183
$ this ->assertTrue ($ dateRangeProp ->isRange ());
180
184
$ this ->assertEquals ($ dateRangeStartValue , $ dateRangeProp ->getStart ());
181
185
$ this ->assertEquals ($ dateRangeEndValue , $ dateRangeProp ->getEnd ());
186
+ $ this ->assertFalse ($ dateRangeProp ->hasTime ());
182
187
$ this ->assertJson ($ dateRangeProp ->asText ());
183
188
$ this ->assertStringContainsString ($ dateRangeStartValue ->format ('Y-m-d H:i:s ' ), $ dateRangeProp ->asText ());
184
189
$ this ->assertStringContainsString ($ dateRangeEndValue ->format ('Y-m-d H:i:s ' ), $ dateRangeProp ->asText ());
@@ -200,6 +205,7 @@ public function it_assembles_properties_for_a_new_page()
200
205
$ this ->assertTrue ($ dateTimeRangeProp ->isRange ());
201
206
$ this ->assertEquals ($ dateRangeStartValue , $ dateTimeRangeProp ->getStart ());
202
207
$ this ->assertEquals ($ dateRangeEndValue , $ dateTimeRangeProp ->getEnd ());
208
+ $ this ->assertTrue ($ dateTimeRangeProp ->hasTime ());
203
209
$ this ->assertJson ($ dateTimeRangeProp ->asText ());
204
210
$ this ->assertStringContainsString ($ dateRangeStartValue ->format ('Y-m-d H:i:s ' ), $ dateTimeRangeProp ->asText ());
205
211
$ this ->assertStringContainsString ($ dateRangeEndValue ->format ('Y-m-d H:i:s ' ), $ dateTimeRangeProp ->asText ());
@@ -216,6 +222,8 @@ public function it_assembles_properties_for_a_new_page()
216
222
$ this ->assertInstanceOf (RichDate::class, $ dateProp ->getContent ());
217
223
$ this ->assertFalse ($ dateProp ->isRange ());
218
224
$ this ->assertEquals ($ dateValue , $ dateProp ->getStart ());
225
+ $ this ->assertNull ($ dateProp ->getEnd ());
226
+ $ this ->assertFalse ($ dateProp ->hasTime ());
219
227
$ dateContent = $ dateProp ->getRawContent ();
220
228
$ this ->assertArrayHasKey ('date ' , $ dateContent );
221
229
$ this ->assertCount (1 , $ dateContent ['date ' ]);
@@ -227,6 +235,8 @@ public function it_assembles_properties_for_a_new_page()
227
235
$ this ->assertInstanceOf (RichDate::class, $ dateTimeProp ->getContent ());
228
236
$ this ->assertFalse ($ dateTimeProp ->isRange ());
229
237
$ this ->assertEquals ($ dateValue , $ dateTimeProp ->getStart ());
238
+ $ this ->assertNull ($ dateTimeProp ->getEnd ());
239
+ $ this ->assertTrue ($ dateTimeProp ->hasTime ());
230
240
$ dateTimeContent = $ dateTimeProp ->getRawContent ();
231
241
$ this ->assertArrayHasKey ('date ' , $ dateTimeContent );
232
242
$ this ->assertCount (1 , $ dateTimeContent ['date ' ]);
0 commit comments