@@ -559,14 +559,12 @@ public function test_wp_mail_resets_properties() {
559559 * Tests that wp_mail() can send embedded images.
560560 *
561561 * @ticket 28059
562+ *
563+ * @dataProvider data_wp_mail_can_send_embedded_images
564+ *
565+ * @param string[] $embeds The embeds to send.
562566 */
563- public function test_wp_mail_can_send_embedded_images () {
564- $ embeds = array (
565- 'canola ' => DIR_TESTDATA . '/images/canola.jpg ' ,
566- DIR_TESTDATA . '/images/test-image-2.gif ' ,
567- DIR_TESTDATA . '/images/avif-lossy.avif ' ,
568- );
569-
567+ public function test_wp_mail_can_send_embedded_images ( $ embeds ) {
570568 $ message = '' ;
571569 foreach ( $ embeds as $ key => $ path ) {
572570 $ message .= '<p><img src="cid: ' . $ key . '" alt="" /></p> ' ;
@@ -593,6 +591,37 @@ public function test_wp_mail_can_send_embedded_images() {
593591 }
594592 }
595593
594+ /**
595+ * Data provider for test_wp_mail_can_send_embedded_images().
596+ *
597+ * @return array
598+ */
599+ public static function data_wp_mail_can_send_embedded_images () {
600+ return array (
601+ 'Mixed Array Embeds ' => array (
602+ 'embeds ' => array (
603+ 'canola ' => DIR_TESTDATA . '/images/canola.jpg ' ,
604+ DIR_TESTDATA . '/images/test-image-2.gif ' ,
605+ DIR_TESTDATA . '/images/avif-lossy.avif ' ,
606+ ),
607+ ),
608+ 'Associative Array Embeds ' => array (
609+ 'embeds ' => array (
610+ 'canola ' => DIR_TESTDATA . '/images/canola.jpg ' ,
611+ 'test-image-2 ' => DIR_TESTDATA . '/images/test-image-2.gif ' ,
612+ 'avif-lossy ' => DIR_TESTDATA . '/images/avif-lossy.avif ' ,
613+ ),
614+ ),
615+ 'Indexed Array Embeds ' => array (
616+ 'embeds ' => array (
617+ DIR_TESTDATA . '/images/canola.jpg ' ,
618+ DIR_TESTDATA . '/images/test-image-2.gif ' ,
619+ DIR_TESTDATA . '/images/avif-lossy.avif ' ,
620+ ),
621+ ),
622+ );
623+ }
624+
596625 /**
597626 * Tests that wp_mail() can send embedded images as a multiple line string.
598627 *
0 commit comments