From 568bca29743b11650592785fac681ba8fa3a15df Mon Sep 17 00:00:00 2001 From: Steve Grunwell Date: Fri, 23 Mar 2018 21:13:26 -0400 Subject: [PATCH 1/4] Add a [failing] test to reproduce #13 --- tests/MarkupAssertionsTraitTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/MarkupAssertionsTraitTest.php b/tests/MarkupAssertionsTraitTest.php index a2145e3..fe79ddb 100644 --- a/tests/MarkupAssertionsTraitTest.php +++ b/tests/MarkupAssertionsTraitTest.php @@ -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', + ], + '
Contents
' + ); + } + public function testAssertNotHasElementWithAttributes() { $this->testcase->assertNotHasElementWithAttributes( From 236b6854695a5c7a1c45b60fa46b77e6277a82d1 Mon Sep 17 00:00:00 2001 From: Steve Grunwell Date: Fri, 23 Mar 2018 21:13:55 -0400 Subject: [PATCH 2/4] Add another selector test to see if #13 impacts that as well (it doesn't) --- tests/MarkupAssertionsTraitTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/MarkupAssertionsTraitTest.php b/tests/MarkupAssertionsTraitTest.php index fe79ddb..a8ef54c 100644 --- a/tests/MarkupAssertionsTraitTest.php +++ b/tests/MarkupAssertionsTraitTest.php @@ -105,6 +105,15 @@ public function testAssertElementContains() ); } + public function testAssertElementContainsMultipleSelectors() + { + $this->testcase->assertElementContains( + 'ipsum', + '#main .foo', + '
Lorem ipsum
' + ); + } + public function testAssertElementContainsScopesToSelector() { $this->expectException(AssertionFailedError::class); From 5d1bcd5403119d7197d7da933e71739de75b5ddb Mon Sep 17 00:00:00 2001 From: Steve Grunwell Date: Tue, 27 Mar 2018 17:14:28 -0400 Subject: [PATCH 3/4] Update the minimum version of zendframework/zend-dom to 2.7 and add a changelog entry --- CHANGELOG.md | 5 +++++ composer.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc02bc3..a7e8c43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). +## [Unreleased] + +* 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]). @@ -23,3 +27,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [#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 diff --git a/composer.json b/composer.json index 3dc90af..768eb0c 100644 --- a/composer.json +++ b/composer.json @@ -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" From 9a5ae880e5388ae365c08bc27ba4171242c02e10 Mon Sep 17 00:00:00 2001 From: Steve Grunwell Date: Tue, 27 Mar 2018 17:20:23 -0400 Subject: [PATCH 4/4] Bump version in CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7e8c43..b45ad5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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). -## [Unreleased] +## [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]). @@ -21,6 +21,7 @@ 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