stevegrunwell / phpunit-markup-assertions

Assertions for PHPUnit to verify the presence or state of elements within markup

Home Page:https://stevegrunwell.com/blog/phpunit-markup-assertions/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

assertHasElementWithAttributes fails if the attribute value contains commas or spaces

dweingart opened this issue · comments

Markup:

<div>
  <label for="company">Company</label>
  <input required type="text" id="company" name="company" value="Russel, Nader and Kutch">
</div>  

PHP:

$this->aassertHasElementWithAttributes(['value' => 'Russel, Nader and Kutch'], $html);

Expected result is that the test passes. Actual result is that the test fails.

This is due to a bug with the underlying Zend_Dom library: zendframework/zend-dom#17.

@dweingart Thanks for bringing this to my attention and linking to the relevant issue on Zend's repo!

zendframework/zend-dom#20 has been opened in an attempt to address this upstream.

My pull request was just merged upstream, so this should be resolved once zendframework/zend-dom 2.7.0 ships.