#970328: Fatal Error during Media Browser upload was an issue that identified a breakage of being able to add media to wysiwyg when Drupal went from beta2 to beta3 (or rc1). It's been fixed, but it sure would have been nice for an automated test to have caught it.

SimpleTest can't be used to test JavaScript code, but the breakage in this case wasn't in the JavaScript, but in the PHP. SimpleTest can be used to emulate the client-side code and at least ensure that the server-side code is doing what's needed. In this case, we want a test covering the full process of uploading a file, and then selecting a format on the format form.

CommentFileSizeAuthor
#3 1026532.diff4.88 KBarthurf

Comments

bbinkovitz’s picture

There are simpletests for parsing markup generated by the WYSIWYG editor here included in patches for #1268116: WYSIWYG does not record file usage. They might be helpful.

ParisLiakos’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue tags: +Needs tests
arthurf’s picture

Priority: Normal » Minor
StatusFileSize
new4.88 KB

I agree with bbinkovitz that #1268116 likely covers most of this. The patch included here explicitly checks the insertion. A question that I have is that it looks like there are two possible types of insertion code- json and urlencoded json. Looking at includes/media.filter.inc there are two regexs that are (maybe) being used for the code: MEDIA_TOKEN_REGEX and MEDIA_TOKEN_REGEX_ALT. I'm unclear if the second one ever actually happens. The test in this patch fails on this. This maybe because this data isn't urlencoded or something else. It would be good for somebody to weigh in on this.

Setting this priority to minor because these tests are at least partially covered in #1268116

chris matthews’s picture

Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -Needs tests

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team