Skip to content

Commit 261108b

Browse files
committed
issue #909: fix PHPUnit warnings
1 parent 706d8b3 commit 261108b

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

tests/application_trait.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function compatible_assertMatchesRegularExpression(string $pattern, strin
104104
if (method_exists($this, 'assertMatchesRegularExpression')) {
105105
$this->assertMatchesRegularExpression($pattern, $string, $message);
106106
} else {
107-
$this->assertRegExp($pattern, $string, $message);
107+
$this->assertDoesNotMatchRegularExpression($pattern, $string, $message);
108108
}
109109
}
110110

@@ -119,18 +119,7 @@ public function compatible_assertDoesNotMatchRegularExpression(string $pattern,
119119
if (method_exists($this, 'assertDoesNotMatchRegularExpression')) {
120120
$this->assertDoesNotMatchRegularExpression($pattern, $string, $message);
121121
} else {
122-
$this->assertNotRegExp($pattern, $string, $message);
123-
}
124-
}
125-
126-
/**
127-
* Asserts that an error was expected
128-
*/
129-
public function compatible_expectError(): void {
130-
if (method_exists($this, 'expectError')) {
131-
$this->expectError();
132-
} else {
133-
$this->expectException(\PHPUnit\Framework\Error\Error::class);
122+
$this->assertDoesNotMatchRegularExpression($pattern, $string, $message);
134123
}
135124
}
136125
// @codingStandardsIgnoreEnd

tests/tool_dataflows_variables_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function test_variable_parsing_involving_indirect_self_recursion() {
140140
// Expecting it to throw an exception during execution, particularly
141141
// when preparing the SQL and finding out it contains an unparsed
142142
// expression.
143-
$this->compatible_expectError();
143+
$this->expectException(\TypeError::class);
144144
try {
145145
$engine->execute();
146146
} finally {

0 commit comments

Comments
 (0)