Skip to content

Commit 0c957b3

Browse files
committed
Since we've effectively dropped PHPUnit 6.x and lower from the running, we no longer need to see whether or not assertStringContainsString() is defined
1 parent 919eb56 commit 0c957b3

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/MarkupAssertionsTrait.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,7 @@ public function assertNotHasElementWithAttributes($attributes = [], $markup = ''
127127
*/
128128
public function assertElementContains($contents, $selector = '', $markup = '', $message = '')
129129
{
130-
$method = method_exists($this, 'assertStringContainsString')
131-
? 'assertStringContainsString'
132-
: 'assertContains'; // @codeCoverageIgnore
133-
134-
$this->$method(
130+
$this->assertStringContainsString(
135131
$contents,
136132
$this->getInnerHtmlOfMatchedElements($markup, $selector),
137133
$message
@@ -152,11 +148,7 @@ public function assertElementContains($contents, $selector = '', $markup = '', $
152148
*/
153149
public function assertElementNotContains($contents, $selector = '', $markup = '', $message = '')
154150
{
155-
$method = method_exists($this, 'assertStringNotContainsString')
156-
? 'assertStringNotContainsString'
157-
: 'assertNotContains'; // @codeCoverageIgnore
158-
159-
$this->$method(
151+
$this->assertStringNotContainsString(
160152
$contents,
161153
$this->getInnerHtmlOfMatchedElements($markup, $selector),
162154
$message
@@ -177,6 +169,7 @@ public function assertElementNotContains($contents, $selector = '', $markup = ''
177169
*/
178170
public function assertElementRegExp($regexp, $selector = '', $markup = '', $message = '')
179171
{
172+
// @phpstan-ignore function.alreadyNarrowedType (Introduced in PHPUnit 9.x, PHP 7.3+)
180173
$method = method_exists($this, 'assertMatchesRegularExpression')
181174
? 'assertMatchesRegularExpression'
182175
: 'assertRegExp'; // @codeCoverageIgnore
@@ -202,6 +195,7 @@ public function assertElementRegExp($regexp, $selector = '', $markup = '', $mess
202195
*/
203196
public function assertElementNotRegExp($regexp, $selector = '', $markup = '', $message = '')
204197
{
198+
// @phpstan-ignore function.alreadyNarrowedType (Introduced in PHPUnit 9.x, PHP 7.3+)
205199
$method = method_exists($this, 'assertDoesNotMatchRegularExpression')
206200
? 'assertDoesNotMatchRegularExpression'
207201
: 'assertNotRegExp'; // @codeCoverageIgnore

0 commit comments

Comments
 (0)