Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegrunwell committed Mar 27, 2018
2 parents 004b169 + 9a5ae88 commit 41d5064
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2018-03-27

* Bumped the minimum version of zendframework/zend-dom to 2.7, which includes a fix for attribute values that include spaces ([#13]).

## [1.1.0] - 2018-01-14

* Added the `assertElementContains()`, `assertElementNotContains()`, `assertElementRegExp()`, and `assertElementNotRegExp()` assertions, for verifying the contents of elements that match the given DOM query ([#6]).
Expand All @@ -17,9 +21,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.


[Unreleased]: https://github.com/stevegrunwell/phpunit-markup-assertions/compare/master...develop
[1.2.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.2.0
[1.1.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.1.0
[1.0.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.0.0
[#6]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/6
[#7]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/7
[#8]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/8
[#9]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/9
[#13]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/13
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"source": "https://github.com/stevegrunwell/phpunit-markup-assertions/"
},
"require": {
"zendframework/zend-dom": "^2.2.5"
"zendframework/zend-dom": "^2.7"
},
"require-dev": {
"phpunit/phpunit": ">=6.0"
Expand Down
22 changes: 22 additions & 0 deletions tests/MarkupAssertionsTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ public function testAssertHasElementWithAttributes()
);
}

/**
* @link https://github.com/stevegrunwell/phpunit-markup-assertions/issues/13
*/
public function testAssertHasElementWithAttributesWithSpacesInTheAttributeValue()
{
$this->testcase->assertHasElementWithAttributes(
[
'data-attr' => 'foo bar baz',
],
'<div data-attr="foo bar baz">Contents</div>'
);
}

public function testAssertNotHasElementWithAttributes()
{
$this->testcase->assertNotHasElementWithAttributes(
Expand All @@ -92,6 +105,15 @@ public function testAssertElementContains()
);
}

public function testAssertElementContainsMultipleSelectors()
{
$this->testcase->assertElementContains(
'ipsum',
'#main .foo',
'<div id="main"><span class="foo">Lorem ipsum</span></div>'
);
}

public function testAssertElementContainsScopesToSelector()
{
$this->expectException(AssertionFailedError::class);
Expand Down

0 comments on commit 41d5064

Please sign in to comment.