File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -208,14 +208,34 @@ public function test_img_caption_shortcode_with_old_format_and_class() {
208208 }
209209
210210 public function test_new_img_caption_shortcode_with_html_caption () {
211+ $ mark = "\u{203B}" ;
212+
213+ $ this ->assertStringNotContainsString (
214+ self ::HTML_CONTENT ,
215+ $ mark ,
216+ 'Test caption content should not contain the mark surround it: check test setup. '
217+ );
218+
211219 $ result = img_caption_shortcode (
212220 array (
213221 'width ' => 20 ,
214- 'caption ' => self ::HTML_CONTENT ,
222+ 'caption ' => $ mark . self ::HTML_CONTENT . $ mark ,
215223 )
216224 );
217225
218- $ this ->assertSame ( 1 , substr_count ( $ result , self ::HTML_CONTENT ) );
226+ $ result_chunks = explode ( $ mark , $ result );
227+ $ this ->assertSame (
228+ 3 ,
229+ count ( $ result_chunks ),
230+ 'Expected to find embedded caption inside marks, but failed to do so. '
231+ );
232+
233+ $ this ->assertEqualHTML (
234+ self ::HTML_CONTENT ,
235+ $ result_chunks [1 ],
236+ '<body> ' ,
237+ 'Should have embedded the caption inside the image output. '
238+ );
219239 }
220240
221241 public function test_new_img_caption_shortcode_new_format () {
You can’t perform that action at this time.
0 commit comments