@@ -95,6 +95,7 @@ public function testUpdatedAtOnStory(): void
9595 {
9696 $ story = $ this ->makeStory ();
9797 $ this ->assertSame ("2024-02-08 " , $ story ->updatedAt ());
98+ $ this ->assertSame ("2024-02-08 16:27:10 " , $ story ->updatedAt ("Y-m-d H:i:s " ));
9899 }
99100
100101 public function testUpdatedAtOnStoryCollectionItem (): void
@@ -224,4 +225,66 @@ public function testNameOnStoryCollectionItem(): void
224225 $ item = $ this ->makeStoryCollectionItem ();
225226 $ this ->assertSame ("My third post " , $ item ->name ());
226227 }
228+
229+ public function testHasUnpublishedChangesOnStory (): void
230+ {
231+ $ story = $ this ->makeStory ();
232+ $ this ->assertFalse ($ story ->hasUnpublishedChanges ());
233+ }
234+
235+ public function testHasUnpublishedChangesTrue (): void
236+ {
237+ $ item = StoryCollectionItem::make ([
238+ "name " => "Draft story " ,
239+ "slug " => "draft-story " ,
240+ "unpublished_changes " => true ,
241+ ]);
242+ $ this ->assertTrue ($ item ->hasUnpublishedChanges ());
243+ }
244+
245+ public function testHasUnpublishedChangesDefault (): void
246+ {
247+ $ item = $ this ->makeStoryCollectionItem ();
248+ $ this ->assertFalse ($ item ->hasUnpublishedChanges ());
249+ }
250+
251+ public function testWorkflowStageIdOnStory (): void
252+ {
253+ $ story = $ this ->makeStory ();
254+ $ this ->assertNull ($ story ->workflowStageId ());
255+ }
256+
257+ public function testWorkflowStageIdWithValue (): void
258+ {
259+ $ item = StoryCollectionItem::make ([
260+ "name " => "Reviewed story " ,
261+ "slug " => "reviewed-story " ,
262+ "stage " => [
263+ "workflow_stage_id " => 653554 ,
264+ ],
265+ ]);
266+ $ this ->assertSame (653554 , $ item ->workflowStageId ());
267+ }
268+
269+ public function testWorkflowStageIdDefault (): void
270+ {
271+ $ item = $ this ->makeStoryCollectionItem ();
272+ $ this ->assertNull ($ item ->workflowStageId ());
273+ }
274+
275+ public function testContentTypeWithValue (): void
276+ {
277+ $ item = StoryCollectionItem::make ([
278+ "name " => "Article story " ,
279+ "slug " => "article-story " ,
280+ "content_type " => "page " ,
281+ ]);
282+ $ this ->assertSame ("page " , $ item ->contentType ());
283+ }
284+
285+ public function testContentTypeDefault (): void
286+ {
287+ $ item = $ this ->makeStoryCollectionItem ();
288+ $ this ->assertSame ("" , $ item ->contentType ());
289+ }
227290}
0 commit comments