phpunit-dom-assertions
phpunit-dom-assertions copied to clipboard
AssertTag
The Drupal project uses PHPUnit for its testing. And currently we are using PHPUnit 4.1. To upgrade to the latest stable release of PHPUnit is at the moment not possible for us because we use the functions assertSelectEquals() and assertTag(). Now this package is going to support both functions. I would like to get a stable release for this package with support for both functions.
A direct port of the assertTag() method seems difficult. The current version (in PHPUnit) supports array 'matchers', while the Symfony DOM Crawler works off of the more standard xpath selectors. To make the method backward compatible would require a way to convert the array-based matchers to xpath.
Sorry for the delays, everyone. I had to take a break from open source for a bit, but I should have time to finish this up in the next week or so.
To make the method backward compatible would require a way to convert the array-based matchers to xpath.
I actually wrote something to do this a couple years ago. The work for this project is honestly almost done, I just need some time to get it in a releasable state.
#4 is related to Drupal and here is issue link https://www.drupal.org/node/2331685 on drupal.org.
At the moment we have fixed our problem with an home-made solution. I am not sure if we want to use this library in the future for drupal 8. Thank you for all the time that you put in this issue. :-)
What is the current status of this issue?
The readme shows that assertTag has not been ported yet, but this ticket now six months old and other updates have been made to the repo, but I can't see a method in the code.
assertTag has been removed on the master branch now btw.
Any updates?
We're updating our tests cases that use assertTag and found this project. We considered doing the port ourselves and submitting a PR, but on second thoughts we chose to migrate the tests to use either XPath or CSS selectors which at least are standard ways to interact with DOM documents.
I have put in a PR to add assertions using XPath to complement the CSS asserts in this project, but if you need to use assertTag it looks like your best bet will be to port it from phpunit yourself.
@timothy-r It sounds good :+1:
Any updates? I have 59 tests that I really don't want to rewrite to fix the assertTag stuff
I have no intention on improving this or even maintaining this, sorry.
Hi Sebastian, can you clarify please. Do you not want to maintain assertTag() or this whole repo?
@timothy-r I believe it's the whole repo... but someone has come forward that has offered to be a maintainer for the repo. We'll have to wait and see what happens next.
So I took over this repository and pushed a first v0.1.0 to get things going after a bit of housekeeping. Contributions for assertTag() (or others) are obviously more than welcome.