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() {
208
208
}
209
209
210
210
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
+
211
219
$ result = img_caption_shortcode (
212
220
array (
213
221
'width ' => 20 ,
214
- 'caption ' => self ::HTML_CONTENT ,
222
+ 'caption ' => $ mark . self ::HTML_CONTENT . $ mark ,
215
223
)
216
224
);
217
225
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
+ );
219
239
}
220
240
221
241
public function test_new_img_caption_shortcode_new_format () {
You can’t perform that action at this time.
0 commit comments