@@ -104,12 +104,23 @@ public function testConvertToYotiAttributeDocumentImages()
104
104
$ this ->assertEquals (2 , count ($ multiValue ->getValue ()));
105
105
$ this ->assertTrue (is_array ($ multiValue ->getValue ()));
106
106
107
- foreach ($ multiValue ->getValue () as $ image ) {
108
- $ this ->assertInstanceOf (Image::class, $ image );
109
- $ this ->assertEquals ('image/jpeg ' , $ image ->getMimeType ());
110
- $ this ->assertNotEmpty ($ image ->getContent ());
111
- $ this ->assertNotEmpty ($ image ->getBase64Content ());
112
- }
107
+ $ this ->assertIsExpectedImage ($ multiValue ->getValue ()[0 ], 'image/jpeg ' , 'vWgD//2Q== ' );
108
+ $ this ->assertIsExpectedImage ($ multiValue ->getValue ()[1 ], 'image/jpeg ' , '38TVEH/9k= ' );
109
+ }
110
+
111
+ /**
112
+ * Asserts that provided image is expected.
113
+ *
114
+ * @param \Yoti\Entity\Image $image
115
+ * @param string $mimeType
116
+ * @param string $base64last10
117
+ */
118
+ private function assertIsExpectedImage ($ image , $ mimeType , $ base64last10 )
119
+ {
120
+ $ this ->assertInstanceOf (Image::class, $ image );
121
+ $ this ->assertEquals ($ mimeType , $ image ->getMimeType ());
122
+ $ this ->assertNotEmpty ($ image ->getContent ());
123
+ $ this ->assertEquals (substr ($ image ->getBase64Content (), -10 ), $ base64last10 );
113
124
}
114
125
115
126
/**
0 commit comments