Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Annotations tests to run correctly #16926

Merged
merged 1 commit into from Dec 10, 2020
Merged

Rewrite Annotations tests to run correctly #16926

merged 1 commit into from Dec 10, 2020

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Dec 9, 2020

Description:

The tests actually didn't work anymore and passed silently. Will add some comments to explain that

Review

  • Functional review done
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@sgiehl sgiehl added c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Dec 9, 2020
Comment on lines -272 to +280
if ($checkException) {
try {
$request = new Request($request);
$request->process();
$this->fail($failMessage);
} catch (Exception $ex) {
$this->assertTrue(true); // pass
}
} else {
$request = new Request($request);
$request->process();

}
$request = new Request($request.'&format=original');
$request->process();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requests actually did not contain a format, so xml response was returned. In case of an error there was no exception thrown by the request. But with the meanwhile used PHPUnit version $this->fail() throws an AssertionFailedError exception, which was directly caught and $this->assertTrue(true) did make all tests pass.

Will look through the other tests as well and check where we use $this->fail() in a try/catch

@diosmosis diosmosis merged commit 5706eab into 4.x-dev Dec 10, 2020
@diosmosis diosmosis deleted the improvetest branch December 10, 2020 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants