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 @@ -222,14 +222,34 @@ public function test_img_caption_shortcode_with_old_format_and_class() {
222222 }
223223
224224 public function test_new_img_caption_shortcode_with_html_caption () {
225+ $ mark = "\u{203B}" ;
226+
227+ $ this ->assertStringNotContainsString (
228+ self ::HTML_CONTENT ,
229+ $ mark ,
230+ 'Test caption content should not contain the mark surround it: check test setup. '
231+ );
232+
225233 $ result = img_caption_shortcode (
226234 array (
227235 'width ' => 20 ,
228- 'caption ' => self ::HTML_CONTENT ,
236+ 'caption ' => $ mark . self ::HTML_CONTENT . $ mark ,
229237 )
230238 );
231239
232- $ this ->assertSame ( 1 , substr_count ( $ result , self ::HTML_CONTENT ) );
240+ $ result_chunks = explode ( $ mark , $ result );
241+ $ this ->assertSame (
242+ 3 ,
243+ count ( $ result_chunks ),
244+ 'Expected to find embedded caption inside marks, but failed to do so. '
245+ );
246+
247+ $ this ->assertEqualHTML (
248+ self ::HTML_CONTENT ,
249+ $ result_chunks [1 ],
250+ '<body> ' ,
251+ 'Should have embedded the caption inside the image output. '
252+ );
233253 }
234254
235255 public function test_new_img_caption_shortcode_new_format () {
You can’t perform that action at this time.
0 commit comments