Skip to content

Commit

Permalink
Don't throw exceptions in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Jan 9, 2025
1 parent a8ba5f4 commit 5e6ea9d
Show file tree
Hide file tree
Showing 5 changed files with 2,890 additions and 45 deletions.
2 changes: 1 addition & 1 deletion packages/playground/data-liberation/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
if ( ! function_exists( '_doing_it_wrong' ) ) {
$GLOBALS['_doing_it_wrong_messages'] = array();
function _doing_it_wrong( $method, $message, $version ) {
throw new Exception( $message );
// throw new Exception( $message );
$GLOBALS['_doing_it_wrong_messages'][] = $message;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/data-liberation/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<file>tests/WPHTMLEntityReaderTests.php</file>
<file>tests/WPEPubEntityReaderTests.php</file>
<file>tests/WPDirectoryTreeEntityReaderTests.php</file>
<file>tests/WPFilesystemToPostHierarchyTests.php</file>
<file>tests/WPFilesystemToPostTreeTests.php</file>
<file>tests/WPURLInTextProcessorTests.php</file>
<file>tests/WPBlockMarkupProcessorTests.php</file>
<file>tests/WPBlockMarkupUrlProcessorTests.php</file>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ public function test_handle_ls_refs_returns_matching_refs($request, $expected_re
array($this->main_branch_oid, $this->dev_branch_oid),
$expected_response
);
$response = $this->server->handle_ls_refs_request($request);
$this->assertEquals($expected_response, $response);
$response = new BufferingResponseWriter();
$this->server->handle_ls_refs_request($request, $response);
$this->assertEquals($expected_response, $response->get_buffered_body());
}

public function provideRefRequests() {
Expand Down
Loading

0 comments on commit 5e6ea9d

Please sign in to comment.