To simplify the tests and make them easier to read, I suggest we drop the getEmbedDialog helper function.
- /**
- * Retrieves an embed dialog based on given parameters.
- *
- * @param string $filter_format_id
- * ID of the filter format.
- * @param string $embed_button_id
- * ID of the embed button.
- *
- * @return string
- * The retrieved HTML string.
- */
- public function getEmbedDialog($filter_format_id = NULL, $embed_button_id = NULL) {
- $url = 'entity-embed/dialog';
- if (!empty($filter_format_id)) {
- $url .= '/' . $filter_format_id;
- if (!empty($embed_button_id)) {
- $url .= '/' . $embed_button_id;
- }
- }
- return $this->drupalGet($url);
- }
-
}
It just obfuscates the url on drupalGet() calls, as it just concatenates a string to create a url that's easy to understand by looking at the url itself.
I think it's clearer to see the url in the test:
- $this->getEmbedDialog('custom_format', 'node');
+ $this->drupalGet('/entity-embed/dialog/custom_format/node');
Comments
Comment #2
oknateComment #3
oknateComment #4
wim leers+1
Comment #5
wim leersComment #6
iuana commentedComment #7
iuana commentedComment #9
oknateI would think this should be
not
etc.
If you can, run the test and see the output from each getEmbedDialog() and put that into drupalGet().
Comment #10
iuana commentedyes, I will do, thanks for the review.
Comment #11
phenaproxima+1 for this change. Once the tests are fixed, I'm comfortable committing this.
Comment #12
iuana commentedI couldn't run the tests.. an error occurred. I fixed the problem I see.
Here are the new changes.
Comment #13
iuana commentedComment #14
phenaproximaLooks good!
Comment #16
phenaproximaCommitted and pushed to 8.x-1.x. Thanks!