Follow up for #2863267: Convert web tests of views

Add \Drupal\simpletest\WebTestBase::assertBlockAppears and ::assertNoBlockAppears to \Drupal\FunctionalTests\AssertLegacyTrait.

These assertions are needed for #2863644: Convert web tests of block and #2864088: Convert web tests to browser tests for shortcut module

CommentFileSizeAuthor
#4 2865336-3.patch2.03 KBlendude

Comments

Lendude created an issue. See original summary.

lendude’s picture

lendude’s picture

Status: Active » Needs review

My new favourite way of testing if something is empty : $this->assertFalse(!empty($result));

Since these are all just wrappers for xpath, does this need tests in \Drupal\FunctionalTests\AssertLegacyTrait?

lendude’s picture

StatusFileSize
new2.03 KB
dawehner’s picture

#2864088: Convert web tests to browser tests for shortcut module adds the same kind of methods, but with @trigger_error which would be nice here, of course :)

michielnugter’s picture

Status: Needs review » Needs work

It seems to me it's best to add it here and not in another conversion?

Would mean we have to postpone #2864088: Convert web tests to browser tests for shortcut module on this I think?

The trigger error is a nice addition but then we could argue that every method in AssertLegacyTrait should have it. I'm in favor of not doing it in this issue and if we do see the need to open up a new issue for it.

The new assertions do need tests though, setting it back to needs work for that.

michielnugter’s picture

Issue tags: +phpunit initiative

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jonathan1055’s picture

Re-queued for 8.5.x
I thought it would be useful to check the patch again as the last test was at 8.4 more than four months ago.

jonathan1055’s picture

Assigned: Unassigned » jonathan1055

Patch failed to apply at 8.5.x. OK I will get the patch working again.

lendude’s picture

Hmm I'd forgotten about this one, in #2863644: Convert web tests of block, we've moved this to a Trait in the block module instead of onto AssertLegacyTrait

jonathan1055’s picture

OK, that sounds good. So #2864088: Convert web tests to browser tests for shortcut module can use the same Trait and then this issue can be discarded and closed.

I will test the patches on the Shortcut module and Block module together, locally, just to check it works. Those two modules are the only ones which use these assertions.

jonathan1055’s picture

Assigned: jonathan1055 » Unassigned
Status: Needs work » Closed (duplicate)

Closing this now, because the assertions will be added via #2863644: Convert web tests of block

Issue #2864088: Convert web tests to browser tests for shortcut module has a patch which uses the file from the Block module.

jonathan1055’s picture

Status: Closed (duplicate) » Closed (outdated)

"Duplicate" is not quite the right status. I've often wanted to have a "Closed (no longer required)" status.
Using "Outdated" because this solution has been abandoned, in favour of adding to the Block module.

dawehner’s picture

Maybe closed (fixed) is the right state so :)