- Issue created by @nicxvan
- 🇬🇧United Kingdom joachim
Well spotted!
At the very least the comment that mentions a totally outdated version of PHPUnit needs to be updated!
- 🇦🇺Australia mstrelan
I think there are two separate issues here, not sure if we need to split this. One issue being that
::linkExists
(and similar methods) do not add anything to the assertion count. The other is thatWebAssertTest
doesn't cover everything inWebAssert
.To highlight the first issue, I've put up an MR that undoes the workarounds added in 📌 Convert WebAssertTest to a Unit test Needs review . When this was a functional test it was passing because
BrowserTestBase::setUp
increments the assertion count. Now since the assertion count is 0 we get a risky test reported.To fix this we can replace calls to
$this->assert()
with code likeAssert::assertNotEmpty()
and similar methods. - Status changed to Needs review
about 1 month ago 12:48am 6 August 2024 - 🇦🇺Australia mstrelan
Apparently our CI doesn't complain about risky tests, but if I run them locally it does. Anyway, I've replaced all calls to
$this->assert
but noticed this changes the behaviour in that we're no longer throwing exceptions. I think that's probably a good thing, but maybe it's not great for BC. Alternatively we could changeWebAssert::assert()
to callAssert::assertTrue((bool) $condition, $message);
but again, that has BC implications. Not sure where to go from here. - 🇦🇺Australia mstrelan
Turns out some of this is a dupe of #2805849: WebAssert does not track assertions, Test marked as risky → .
- Status changed to Needs work
17 days ago 12:50pm 22 August 2024 - 🇺🇸United States smustgrave
So from what I can tell some methods are being completely removed like testInvalidLinkExistsExact. Even though not used can we be sure they aren't used in contrib? May have to deprecate just to be safe.
That said if easier this maybe could be broken up for smaller chunks. Dealers choice.
- 🇦🇺Australia mstrelan
So from what I can tell some methods are being completely removed like testInvalidLinkExistsExact.
That is one of the tests being removed from WebAssertTest, not a method removed from WebAssert. They're removed because they no longer make sense since the methods are refactored.
That said I think we need to figure out what should be done here and what should be done in #2805849: WebAssert does not track assertions, Test marked as risky → .