Problem/Motivation
$this->assertTrue($output instanceof MarkupInterface || is_string($output), new FormattableMarkup('\Drupal::theme() returns an object that implements MarkupInterface or a string for data type @type.', ['@type' => $type]));
Proposed resolution
Refactor the test to test independently the string and the MarkupInterface cases.
Remaining tasks
Discuss
Review patch
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | interdiff-16-19.txt | 2.55 KB | hardik_patel_12 |
| #19 | 3155495-19.patch | 2.13 KB | hardik_patel_12 |
Issue fork drupal-3155495
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
hardik_patel_12 commentedKindly review the patch.
Comment #4
Lal_Putting them inside the condition..
Comment #6
Lal_Comment #7
kunalgautam commentedComment #8
s_bhandari commentedComment #9
mondrakeUmm I'm afraid #7 is not really touching the point:
this is always true
this is irrelevant since it's in an
if {}block that is executed only if $output is an instance of MarkupInterface...We now have a MarkupInterfaceComparator that can seamlessly compare strings and MarkupInterface objects through
assertEquals, so we can just forget about the casting.But, I think in this test we want to really assert that when the theme returns an empty string, the renderer returns a string as well. So let's refactor the test to make that explicit.
Not interdiff, it's a new patch.
Comment #15
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #16
nikhil_110 commentedAttached patch against Drupal 10.1.x
Comment #18
hardik_patel_12 commentedAttached patch against Drupal 11.x
Comment #19
hardik_patel_12 commentedRerolling patch against Drupal 11.x and adding interdiff.
Comment #21
smustgrave commentedBreaking apart the test seems fine. Not coverage lost.
Comment #22
quietone commented@mondrake, thanks for the explanation given in #9. That made this much easier to review.
I think a comment can be improved but it would be fine to add this. However, according to GitLab this can be merged but the diff does not apply to HEAD. Not sure why that is. So, since this needs work I added a suggestion for the comment.