@@ -231,6 +231,213 @@ public function object_to_uri_provider() {
231231 ),
232232 'https://example.com ' ,
233233 ),
234+ // Test Audio with simple string URL.
235+ array (
236+ array (
237+ 'type ' => 'Audio ' ,
238+ 'url ' => 'https://example.com/audio.mp3 ' ,
239+ ),
240+ 'https://example.com/audio.mp3 ' ,
241+ ),
242+ // Test Audio with Link object.
243+ array (
244+ array (
245+ 'type ' => 'Audio ' ,
246+ 'url ' => array (
247+ 'type ' => 'Link ' ,
248+ 'href ' => 'https://example.com/audio.mp3 ' ,
249+ ),
250+ ),
251+ 'https://example.com/audio.mp3 ' ,
252+ ),
253+ // Test Audio with array of Link objects.
254+ array (
255+ array (
256+ 'type ' => 'Audio ' ,
257+ 'url ' => array (
258+ array (
259+ 'type ' => 'Link ' ,
260+ 'href ' => 'https://example.com/audio.mp3 ' ,
261+ 'mediaType ' => 'audio/mpeg ' ,
262+ ),
263+ array (
264+ 'type ' => 'Link ' ,
265+ 'href ' => 'https://example.com/audio.ogg ' ,
266+ 'mediaType ' => 'audio/ogg ' ,
267+ ),
268+ ),
269+ ),
270+ 'https://example.com/audio.mp3 ' ,
271+ ),
272+ // Test Document with simple string URL.
273+ array (
274+ array (
275+ 'type ' => 'Document ' ,
276+ 'url ' => 'https://example.com/document.pdf ' ,
277+ ),
278+ 'https://example.com/document.pdf ' ,
279+ ),
280+ // Test Document with Link object.
281+ array (
282+ array (
283+ 'type ' => 'Document ' ,
284+ 'url ' => array (
285+ 'type ' => 'Link ' ,
286+ 'href ' => 'https://example.com/document.pdf ' ,
287+ ),
288+ ),
289+ 'https://example.com/document.pdf ' ,
290+ ),
291+ // Test Document with array of Link objects.
292+ array (
293+ array (
294+ 'type ' => 'Document ' ,
295+ 'url ' => array (
296+ array (
297+ 'type ' => 'Link ' ,
298+ 'href ' => 'https://example.com/document.pdf ' ,
299+ 'mediaType ' => 'application/pdf ' ,
300+ ),
301+ array (
302+ 'type ' => 'Link ' ,
303+ 'href ' => 'https://example.com/document.docx ' ,
304+ 'mediaType ' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document ' ,
305+ ),
306+ ),
307+ ),
308+ 'https://example.com/document.pdf ' ,
309+ ),
310+ // Test Video with simple string URL.
311+ array (
312+ array (
313+ 'type ' => 'Video ' ,
314+ 'url ' => 'https://example.com/video.mp4 ' ,
315+ ),
316+ 'https://example.com/video.mp4 ' ,
317+ ),
318+ // Test Video with Link object.
319+ array (
320+ array (
321+ 'type ' => 'Video ' ,
322+ 'url ' => array (
323+ 'type ' => 'Link ' ,
324+ 'href ' => 'https://example.com/video.mp4 ' ,
325+ ),
326+ ),
327+ 'https://example.com/video.mp4 ' ,
328+ ),
329+ // Test Video with array of Link objects.
330+ array (
331+ array (
332+ 'type ' => 'Video ' ,
333+ 'url ' => array (
334+ array (
335+ 'type ' => 'Link ' ,
336+ 'href ' => 'https://example.com/video.mp4 ' ,
337+ 'mediaType ' => 'video/mp4 ' ,
338+ ),
339+ array (
340+ 'type ' => 'Link ' ,
341+ 'href ' => 'https://example.com/video.webm ' ,
342+ 'mediaType ' => 'video/webm ' ,
343+ ),
344+ ),
345+ ),
346+ 'https://example.com/video.mp4 ' ,
347+ ),
348+ // Test complex Image with array of Link objects (user's example).
349+ array (
350+ array (
351+ '@context ' => 'https://www.w3.org/ns/activitystreams ' ,
352+ 'type ' => 'Image ' ,
353+ 'name ' => 'Cat Jumping on Wagon ' ,
354+ 'url ' => array (
355+ array (
356+ 'type ' => 'Link ' ,
357+ 'href ' => 'http://example.org/image.jpeg ' ,
358+ 'mediaType ' => 'image/jpeg ' ,
359+ ),
360+ array (
361+ 'type ' => 'Link ' ,
362+ 'href ' => 'http://example.org/image.png ' ,
363+ 'mediaType ' => 'image/png ' ,
364+ ),
365+ ),
366+ ),
367+ 'http://example.org/image.jpeg ' ,
368+ ),
369+ // Test complex Audio with full metadata and array of Link objects.
370+ array (
371+ array (
372+ '@context ' => 'https://www.w3.org/ns/activitystreams ' ,
373+ 'type ' => 'Audio ' ,
374+ 'name ' => 'Podcast Episode ' ,
375+ 'duration ' => 'PT1H30M ' ,
376+ 'attributedTo ' => 'https://example.com/users/podcaster ' ,
377+ 'url ' => array (
378+ array (
379+ 'type ' => 'Link ' ,
380+ 'href ' => 'https://example.com/podcast.mp3 ' ,
381+ 'mediaType ' => 'audio/mpeg ' ,
382+ ),
383+ array (
384+ 'type ' => 'Link ' ,
385+ 'href ' => 'https://example.com/podcast.ogg ' ,
386+ 'mediaType ' => 'audio/ogg ' ,
387+ ),
388+ ),
389+ ),
390+ 'https://example.com/podcast.mp3 ' ,
391+ ),
392+ // Test complex Document with full metadata and array of Link objects.
393+ array (
394+ array (
395+ '@context ' => 'https://www.w3.org/ns/activitystreams ' ,
396+ 'type ' => 'Document ' ,
397+ 'name ' => 'Annual Report ' ,
398+ 'attributedTo ' => 'https://example.com/users/author ' ,
399+ 'url ' => array (
400+ array (
401+ 'type ' => 'Link ' ,
402+ 'href ' => 'https://example.com/report.pdf ' ,
403+ 'mediaType ' => 'application/pdf ' ,
404+ ),
405+ array (
406+ 'type ' => 'Link ' ,
407+ 'href ' => 'https://example.com/report.docx ' ,
408+ 'mediaType ' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document ' ,
409+ ),
410+ ),
411+ ),
412+ 'https://example.com/report.pdf ' ,
413+ ),
414+ // Test complex Video with full metadata and array of Link objects.
415+ array (
416+ array (
417+ '@context ' => 'https://www.w3.org/ns/activitystreams ' ,
418+ 'type ' => 'Video ' ,
419+ 'name ' => 'Conference Talk ' ,
420+ 'duration ' => 'PT45M ' ,
421+ 'attributedTo ' => 'https://example.com/users/speaker ' ,
422+ 'url ' => array (
423+ array (
424+ 'type ' => 'Link ' ,
425+ 'href ' => 'https://example.com/talk.mp4 ' ,
426+ 'mediaType ' => 'video/mp4 ' ,
427+ 'width ' => 1920 ,
428+ 'height ' => 1080 ,
429+ ),
430+ array (
431+ 'type ' => 'Link ' ,
432+ 'href ' => 'https://example.com/talk.webm ' ,
433+ 'mediaType ' => 'video/webm ' ,
434+ 'width ' => 1920 ,
435+ 'height ' => 1080 ,
436+ ),
437+ ),
438+ ),
439+ 'https://example.com/talk.mp4 ' ,
440+ ),
234441 );
235442 }
236443
0 commit comments