Skip to content

Commit 41d5064

Browse files
committed
Merge branch 'release/1.2.0'
2 parents 004b169 + 9a5ae88 commit 41d5064

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.2.0] - 2018-03-27
8+
9+
* Bumped the minimum version of zendframework/zend-dom to 2.7, which includes a fix for attribute values that include spaces ([#13]).
10+
711
## [1.1.0] - 2018-01-14
812

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

1822

1923
[Unreleased]: https://github.com/stevegrunwell/phpunit-markup-assertions/compare/master...develop
24+
[1.2.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.2.0
2025
[1.1.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.1.0
2126
[1.0.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.0.0
2227
[#6]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/6
2328
[#7]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/7
2429
[#8]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/8
2530
[#9]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/9
31+
[#13]: https://github.com/stevegrunwell/phpunit-markup-assertions/issues/13

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"source": "https://github.com/stevegrunwell/phpunit-markup-assertions/"
1616
},
1717
"require": {
18-
"zendframework/zend-dom": "^2.2.5"
18+
"zendframework/zend-dom": "^2.7"
1919
},
2020
"require-dev": {
2121
"phpunit/phpunit": ">=6.0"

tests/MarkupAssertionsTraitTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ public function testAssertHasElementWithAttributes()
7272
);
7373
}
7474

75+
/**
76+
* @link https://github.com/stevegrunwell/phpunit-markup-assertions/issues/13
77+
*/
78+
public function testAssertHasElementWithAttributesWithSpacesInTheAttributeValue()
79+
{
80+
$this->testcase->assertHasElementWithAttributes(
81+
[
82+
'data-attr' => 'foo bar baz',
83+
],
84+
'<div data-attr="foo bar baz">Contents</div>'
85+
);
86+
}
87+
7588
public function testAssertNotHasElementWithAttributes()
7689
{
7790
$this->testcase->assertNotHasElementWithAttributes(
@@ -92,6 +105,15 @@ public function testAssertElementContains()
92105
);
93106
}
94107

108+
public function testAssertElementContainsMultipleSelectors()
109+
{
110+
$this->testcase->assertElementContains(
111+
'ipsum',
112+
'#main .foo',
113+
'<div id="main"><span class="foo">Lorem ipsum</span></div>'
114+
);
115+
}
116+
95117
public function testAssertElementContainsScopesToSelector()
96118
{
97119
$this->expectException(AssertionFailedError::class);

0 commit comments

Comments
 (0)