Skip to content

Commit

Permalink
issue #909: fix PHPUnit warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriim committed Nov 14, 2024
1 parent 706d8b3 commit 261108b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
15 changes: 2 additions & 13 deletions tests/application_trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function compatible_assertMatchesRegularExpression(string $pattern, strin
if (method_exists($this, 'assertMatchesRegularExpression')) {
$this->assertMatchesRegularExpression($pattern, $string, $message);
} else {
$this->assertRegExp($pattern, $string, $message);
$this->assertDoesNotMatchRegularExpression($pattern, $string, $message);
}
}

Expand All @@ -119,18 +119,7 @@ public function compatible_assertDoesNotMatchRegularExpression(string $pattern,
if (method_exists($this, 'assertDoesNotMatchRegularExpression')) {
$this->assertDoesNotMatchRegularExpression($pattern, $string, $message);
} else {
$this->assertNotRegExp($pattern, $string, $message);
}
}

/**
* Asserts that an error was expected
*/
public function compatible_expectError(): void {
if (method_exists($this, 'expectError')) {
$this->expectError();
} else {
$this->expectException(\PHPUnit\Framework\Error\Error::class);
$this->assertDoesNotMatchRegularExpression($pattern, $string, $message);
}
}
// @codingStandardsIgnoreEnd
Expand Down
2 changes: 1 addition & 1 deletion tests/tool_dataflows_variables_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function test_variable_parsing_involving_indirect_self_recursion() {
// Expecting it to throw an exception during execution, particularly
// when preparing the SQL and finding out it contains an unparsed
// expression.
$this->compatible_expectError();
$this->expectException(\TypeError::class);
try {
$engine->execute();
} finally {
Expand Down

0 comments on commit 261108b

Please sign in to comment.