@@ -69,9 +69,13 @@ public function it_returns_page_entity_with_filled_properties()
6969 // check properties
7070 $ this ->assertSame ('Notion Is Awesome ' , $ pageResult ->getTitle ());
7171 $ 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 ());
7579
7680 $ this ->assertInstanceOf (Carbon::class, $ pageResult ->getCreatedTime ());
7781 $ this ->assertInstanceOf (Carbon::class, $ pageResult ->getLastEditedTime ());
@@ -179,6 +183,7 @@ public function it_assembles_properties_for_a_new_page()
179183 $ this ->assertTrue ($ dateRangeProp ->isRange ());
180184 $ this ->assertEquals ($ dateRangeStartValue , $ dateRangeProp ->getStart ());
181185 $ this ->assertEquals ($ dateRangeEndValue , $ dateRangeProp ->getEnd ());
186+ $ this ->assertFalse ($ dateRangeProp ->hasTime ());
182187 $ this ->assertJson ($ dateRangeProp ->asText ());
183188 $ this ->assertStringContainsString ($ dateRangeStartValue ->format ('Y-m-d H:i:s ' ), $ dateRangeProp ->asText ());
184189 $ 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()
200205 $ this ->assertTrue ($ dateTimeRangeProp ->isRange ());
201206 $ this ->assertEquals ($ dateRangeStartValue , $ dateTimeRangeProp ->getStart ());
202207 $ this ->assertEquals ($ dateRangeEndValue , $ dateTimeRangeProp ->getEnd ());
208+ $ this ->assertTrue ($ dateTimeRangeProp ->hasTime ());
203209 $ this ->assertJson ($ dateTimeRangeProp ->asText ());
204210 $ this ->assertStringContainsString ($ dateRangeStartValue ->format ('Y-m-d H:i:s ' ), $ dateTimeRangeProp ->asText ());
205211 $ 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()
216222 $ this ->assertInstanceOf (RichDate::class, $ dateProp ->getContent ());
217223 $ this ->assertFalse ($ dateProp ->isRange ());
218224 $ this ->assertEquals ($ dateValue , $ dateProp ->getStart ());
225+ $ this ->assertNull ($ dateProp ->getEnd ());
226+ $ this ->assertFalse ($ dateProp ->hasTime ());
219227 $ dateContent = $ dateProp ->getRawContent ();
220228 $ this ->assertArrayHasKey ('date ' , $ dateContent );
221229 $ this ->assertCount (1 , $ dateContent ['date ' ]);
@@ -227,6 +235,8 @@ public function it_assembles_properties_for_a_new_page()
227235 $ this ->assertInstanceOf (RichDate::class, $ dateTimeProp ->getContent ());
228236 $ this ->assertFalse ($ dateTimeProp ->isRange ());
229237 $ this ->assertEquals ($ dateValue , $ dateTimeProp ->getStart ());
238+ $ this ->assertNull ($ dateTimeProp ->getEnd ());
239+ $ this ->assertTrue ($ dateTimeProp ->hasTime ());
230240 $ dateTimeContent = $ dateTimeProp ->getRawContent ();
231241 $ this ->assertArrayHasKey ('date ' , $ dateTimeContent );
232242 $ this ->assertCount (1 , $ dateTimeContent ['date ' ]);
0 commit comments