phpunit-dom-assertions icon indicating copy to clipboard operation
phpunit-dom-assertions copied to clipboard

AssertTag

Open ddaffie opened this issue 10 years ago • 14 comments

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.

ddaffie avatar Dec 04 '14 11:12 ddaffie

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.

jhedstrom avatar Dec 31 '14 17:12 jhedstrom

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.

whatthejeff avatar Dec 31 '14 17:12 whatthejeff

#4 is related to Drupal and here is issue link https://www.drupal.org/node/2331685 on drupal.org.

jibran avatar Jan 05 '15 18:01 jibran

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. :-)

ddaffie avatar Jan 21 '15 11:01 ddaffie

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.

davidyell avatar Jun 24 '15 10:06 davidyell

assertTag has been removed on the master branch now btw.

GrahamCampbell avatar Jun 24 '15 10:06 GrahamCampbell

Any updates?

sergeyklay avatar Nov 15 '15 19:11 sergeyklay

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 avatar Nov 18 '15 19:11 timothy-r

@timothy-r It sounds good :+1:

sergeyklay avatar Nov 18 '15 19:11 sergeyklay

Any updates? I have 59 tests that I really don't want to rewrite to fix the assertTag stuff

photodude avatar Nov 23 '16 17:11 photodude

I have no intention on improving this or even maintaining this, sorry.

sebastianbergmann avatar Nov 23 '16 17:11 sebastianbergmann

Hi Sebastian, can you clarify please. Do you not want to maintain assertTag() or this whole repo?

timothy-r avatar Nov 23 '16 22:11 timothy-r

@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.

photodude avatar Nov 23 '16 23:11 photodude

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.

lstrojny avatar Nov 24 '16 21:11 lstrojny