-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
sync clock #863
base: main
Are you sure you want to change the base?
sync clock #863
Conversation
This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested. If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.
For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
* fix: Ensure name_filter are local scoped * fix test on macos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we should have a comment in the students stub that missing methods need to be added.
public function testOnTheHour(): void | ||
{ | ||
$clock = new Clock(8); | ||
|
||
$this->assertEquals('08:00', $clock->__toString()); | ||
$this->assertEquals('08:00', $clock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the magic tricks in PHP, but we currently have no concept (concept exercise) for students to learn this. So we should either explain the magic in the stub (for now) or explicitly call the method as done before:
$this->assertEquals('08:00', $clock); | |
$this->assertEquals('08:00', $clock->__toString()); |
or
$this->assertEquals('08:00', $clock); | |
$this->assertEquals('08:00', (string)$clock); | |
// plus use `implements Stringable` in the students stub | |
// plus a comment in the stub pointing to PHP docs on interface `Stringable` |
@homersimpsons What do you think about this?
Resolves #845