Closed (outdated)
Project:
Drupal core
Version:
10.1.x-dev
Component:
phpunit
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Sep 2014 at 19:29 UTC
Updated:
12 Oct 2022 at 12:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
vijaycs85Comment #2
vijaycs85Looks like #2257519: Move content assertion methods into a trait, so DUTB can consume it, too has introduced the trait with undefined method and it works when we extend WebTestBase, but not with KernelTestBase.
Comment #3
vijaycs85So this is common problem when we use trait. "if trait calls methods that are not part of trait, but assuming that the class uses trait will have" can produce this type of regressions. one option is adding abstract methods as per http://stackoverflow.com/a/14866251/1366019
for this issue point of view, we can remove getUrl as it is not valid for KernalTestBase.
Comment #4
attiks commentedWe could also make sure that $this->getRawContent() contains valid html, we could wrap the rendered output inside
<html><body>, see KernelTestBase->renderComment #5
attiks commentedPatch to see how testbot will react on the removal
Comment #7
vijaycs85Nice, so we do test out tests :)
Comment #8
attiks commentedLet's see if this works
Comment #11
jhedstromA related fatal error occurs when using
AssertContentTraitwithBrowserTestBasetests:The patch from #8 no longer applies, so here's a partial reroll. PHPUnit doesn't appear to have a related method to 'pass', so just removing it seems easiest. Alternatively, we'd need to add this method into our base classes.
Comment #12
jhedstromThat patch just moves on to a different error. I don't think the existing
AssertContentTraitis going to be compatible withBrowserTestBase.Comment #22
quietone commentedTriaging issues in simpletest.module as part of the Bug Smash Initiative to determine if they should be in the Simpletest Project or core.
This looks like it a Phpunit issue, changing component.
Comment #28
longwaveThe original report here was solved by #2387019: String field formatters cannot link to their parent entity, see comment #11 where
getUrl()is explicitly mentioned.Since then this has been refactored away and following #3135077: Remove usage of AssertLegacyTrait::pass() from traits
getUrl()is no longer called at all from AssertContentTrait.Therefore, closing as outdated.