Skip to content

Commit 525823c

Browse files
Merge pull request #36 from stevegrunwell/release/v1.4.0
Version 1.4.0
2 parents e2445a9 + e0ba870 commit 525823c

File tree

9 files changed

+163
-81
lines changed

9 files changed

+163
-81
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [stevegrunwell]

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "10:00"
8+
open-pull-requests-limit: 10
9+
ignore:
10+
- dependency-name: phpunit/phpunit
11+
versions:
12+
- "> 6.0"

.github/workflows/unit-tests.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
11
name: Unit Tests
22

3-
on: [push, pull_request]
3+
on: [pull_request]
44

55
jobs:
6-
run:
7-
runs-on: ${{ matrix.operating-system }}
6+
phpunit:
7+
name: PHP ${{ matrix.php-version }}
8+
runs-on: ubuntu-latest
89
strategy:
910
matrix:
10-
operating-system: [ubuntu-latest]
11-
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
12-
name: PHP ${{ matrix.php-versions }}
13-
11+
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
1412
steps:
1513
- name: Checkout
16-
uses: actions/checkout@v1
14+
uses: actions/checkout@v2
1715

1816
- name: Setup PHP
1917
uses: shivammathur/setup-php@v2
2018
with:
21-
php-version: ${{ matrix.php-versions }}
19+
php-version: ${{ matrix.php-version }}
2220
coverage: none
2321

24-
- name: Get composer cache directory
25-
id: composer-cache
26-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
27-
28-
- name: Cache dependencies
29-
uses: actions/cache@v2
30-
with:
31-
path: ${{ steps.composer-cache.outputs.dir }}
32-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
33-
restore-keys: ${{ runner.os }}-composer-
34-
35-
- name: Install dependencies
36-
run: composer install --no-interaction --prefer-dist --no-suggest --no-progress
22+
- name: Install Composer dependencies
23+
uses: ramsey/composer-install@v2
3724

3825
- name: Run test suite
3926
run: composer test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
tests/coverage
22
vendor
33
.phpunit.result.cache
4+
.vscode
45

56
# The composer.lock file is not needed, as this is a library whose dependencies
67
# will depend on the version of PHP being used.

CHANGELOG.md

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

8+
## [1.4.0] – 2022-12-28
9+
10+
* Force UTF-8 encoding for better support for non-Latin character sets ([#35])
11+
* Move away from deprecated classes in laminas/laminas-dom ([#32])
12+
813
## [1.3.1] — 2020-01-14
914

1015
* Fix PHPUnit warnings regarding `assertContains()` and `assertRegExp()`. Props [@jakobbuis](https://github.com/jakobbuis) ([#20], [#27], [#28])
@@ -35,7 +40,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3540
* Initial release of the PHPUnit Markup Assertions Composer package.
3641

3742

38-
[Unreleased]: https://github.com/stevegrunwell/phpunit-markup-assertions/compare/master...develop
43+
[Unreleased]: https://github.com/stevegrunwell/phpunit-markup-assertions/compare/main...develop
44+
[1.4.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.4.0
3945
[1.3.1]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.3.1
4046
[1.3.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.3.0
4147
[1.2.0]: https://github.com/stevegrunwell/phpunit-markup-assertions/releases/tag/v1.2.0
@@ -53,3 +59,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5359
[#26]: https://github.com/stevegrunwell/phpunit-markup-assertions/pull/26
5460
[#27]: https://github.com/stevegrunwell/phpunit-markup-assertions/pull/27
5561
[#28]: https://github.com/stevegrunwell/phpunit-markup-assertions/pull/28
62+
[#32]: https://github.com/stevegrunwell/phpunit-markup-assertions/pull/32
63+
[#35]: https://github.com/stevegrunwell/phpunit-markup-assertions/pull/35

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
This library introduces the `MarkupAssertionsTrait` trait for use in [PHPUnit](https://phpunit.de) tests.
77

8-
These assertions enable you to inspect generated markup without having to muddy tests with [`DOMDocument`](http://php.net/manual/en/class.domdocument.php) or nasty regular expressions. If you're generating markup at all with PHP, the PHPUnit Markup Assertions trait aims to make the output testable.
8+
These assertions enable you to inspect generated markup without having to muddy tests with [`DOMDocument`](http://php.net/manual/en/class.domdocument.php) or nasty regular expressions. If you're generating markup at all with PHP, the PHPUnit Markup Assertions trait aims to make the output testable without making your tests fragile.
99

1010
## Example
1111

@@ -22,10 +22,10 @@ class MyUnitTest extends TestCase
2222
*/
2323
public function testRenderFormContainsInputs()
2424
{
25-
$output = render_form();
25+
$markup = render_form();
2626

27-
$this->assertContainsSelector('#first-name', $output);
28-
$this->assertContainsSelector('#last-name', $output);
27+
$this->assertContainsSelector('#first-name', $markup);
28+
$this->assertContainsSelector('#last-name', $markup);
2929
}
3030
}
3131
```
@@ -104,8 +104,8 @@ Assert that the given string contains an element matching the given selector.
104104
<dl>
105105
<dt>(string) $selector</dt>
106106
<dd>A query selector for the element to find.</dd>
107-
<dt>(string) $output</dt>
108-
<dd>The output that should contain the <code>$selector</code>.</dd>
107+
<dt>(string) $markup</dt>
108+
<dd>The markup that should contain the <code>$selector</code>.</dd>
109109
<dt>(string) $message</dt>
110110
<dd>A message to display if the assertion fails.</dd>
111111
</dl>
@@ -130,8 +130,8 @@ This method is the inverse of [`assertContainsSelector()`](#assertcontainsselect
130130
<dl>
131131
<dt>(string) $selector</dt>
132132
<dd>A query selector for the element to find.</dd>
133-
<dt>(string) $output</dt>
134-
<dd>The output that should not contain the <code>$selector</code>.</dd>
133+
<dt>(string) $markup</dt>
134+
<dd>The markup that should not contain the <code>$selector</code>.</dd>
135135
<dt>(string) $message</dt>
136136
<dd>A message to display if the assertion fails.</dd>
137137
</dl>
@@ -145,7 +145,7 @@ Assert the number of times an element matching the given selector is found.
145145
<dd>The number of matching elements expected.</dd>
146146
<dt>(string) $selector</dt>
147147
<dd>A query selector for the element to find.</dd>
148-
<dt>(string) $output</dt>
148+
<dt>(string) $markup</dt>
149149
<dd>The markup to run the assertion against.</dd>
150150
<dt>(string) $message</dt>
151151
<dd>A message to display if the assertion fails.</dd>
@@ -171,8 +171,8 @@ Assert that an element with the given attributes exists in the given markup.
171171
<dl>
172172
<dt>(array) $attributes</dt>
173173
<dd>An array of HTML attributes that should be found on the element.</dd>
174-
<dt>(string) $output</dt>
175-
<dd>The output that should contain an element with the provided <code>$attributes</code>.</dd>
174+
<dt>(string) $markup</dt>
175+
<dd>The markup that should contain an element with the provided <code>$attributes</code>.</dd>
176176
<dt>(string) $message</dt>
177177
<dd>A message to display if the assertion fails.</dd>
178178
</dl>
@@ -203,8 +203,8 @@ Assert that an element with the given attributes does not exist in the given mar
203203
<dl>
204204
<dt>(array) $attributes</dt>
205205
<dd>An array of HTML attributes that should not be found on the element.</dd>
206-
<dt>(string) $output</dt>
207-
<dd>The output that should not contain an element with the provided <code>$attributes</code>.</dd>
206+
<dt>(string) $markup</dt>
207+
<dd>The markup that should not contain an element with the provided <code>$attributes</code>.</dd>
208208
<dt>(string) $message</dt>
209209
<dd>A message to display if the assertion fails.</dd>
210210
</dl>
@@ -218,8 +218,8 @@ Assert that the element with the given selector contains a string.
218218
<dd>The string to look for within the DOM node's contents.</dd>
219219
<dt>(string) $selector</dt>
220220
<dd>A query selector for the element to find.</dd>
221-
<dt>(string) $output</dt>
222-
<dd>The output that should contain the <code>$selector</code>.</dd>
221+
<dt>(string) $markup</dt>
222+
<dd>The markup that should contain the <code>$selector</code>.</dd>
223223
<dt>(string) $message</dt>
224224
<dd>A message to display if the assertion fails.</dd>
225225
</dl>
@@ -252,8 +252,8 @@ This method is the inverse of [`assertElementContains()`](#assertelementcontains
252252
<dd>The string to look for within the DOM node's contents.</dd>
253253
<dt>(string) $selector</dt>
254254
<dd>A query selector for the element to find.</dd>
255-
<dt>(string) $output</dt>
256-
<dd>The output that should contain the <code>$selector</code>.</dd>
255+
<dt>(string) $markup</dt>
256+
<dd>The markup that should contain the <code>$selector</code>.</dd>
257257
<dt>(string) $message</dt>
258258
<dd>A message to display if the assertion fails.</dd>
259259
</dl>
@@ -269,8 +269,8 @@ This method works just like [`assertElementContains()`](#assertelementcontains),
269269
<dd>The regular expression pattern to look for within the DOM node.</dd>
270270
<dt>(string) $selector</dt>
271271
<dd>A query selector for the element to find.</dd>
272-
<dt>(string) $output</dt>
273-
<dd>The output that should contain the <code>$selector</code>.</dd>
272+
<dt>(string) $markup</dt>
273+
<dd>The markup that should contain the <code>$selector</code>.</dd>
274274
<dt>(string) $message</dt>
275275
<dd>A message to display if the assertion fails.</dd>
276276
</dl>
@@ -286,8 +286,8 @@ This method is the inverse of [`assertElementRegExp()`](#assertelementregexp) an
286286
<dd>The regular expression pattern to look for within the DOM node.</dd>
287287
<dt>(string) $selector</dt>
288288
<dd>A query selector for the element to find.</dd>
289-
<dt>(string) $output</dt>
290-
<dd>The output that should contain the <code>$selector</code>.</dd>
289+
<dt>(string) $markup</dt>
290+
<dd>The markup that should contain the <code>$selector</code>.</dd>
291291
<dt>(string) $message</dt>
292292
<dd>A message to display if the assertion fails.</dd>
293293
</dl>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"laminas/laminas-dom": "~2.7.2 || ^2.8"
2020
},
2121
"require-dev": {
22-
"symfony/phpunit-bridge": "^5.2"
22+
"symfony/phpunit-bridge": "^5.2 || ^6.2"
2323
},
2424
"autoload": {
2525
"psr-4": {

0 commit comments

Comments
 (0)