Repository navigation
test: add unit tests for Utils/ExecutionTime - #198
Conversation
|
Hi, friendly ping on this one. The CI workflows (PHP Composer, Code style) are waiting for maintainer approval since this is my first contribution here. Could someone approve the run and take a look when you have a moment? Happy to adjust anything. Thanks! |
There was a problem hiding this comment.
Thanks for adding coverage for ExecutionTime, and for the clear description!
I merged this against current master locally. phpcs -n is clean, and the new tests passed 30 out of 30 runs. I'm requesting a few small changes before merging: remove the redundant first measurement in the second test, make sure the output buffer is always closed on failure, and drop the DIRECTORY.md edit. The details are in the inline comments.
Thanks!
|
Thanks for the review, addressed in f0e47e3:
|
|
Thanks for the quick turnaround. f0e47e3 addresses everything: the second test does a single measured run, both tests close the output buffer in a finally, the patterns accept scientific notation, and the DIRECTORY.md change is gone. CI is green, so this is good to merge. |
Adds a dedicated PHPUnit test class for
Utils/ExecutionTime.php, which previously had no test coverage.Verified locally:
phpunit tests— 287 tests, OK (285 before this change)vendor/bin/phpcs -n tests/Utils/ExecutionTimeTest.php— cleanThe tests assert that no output is emitted while the timer is alive and that
__destruct()reports a plausible elapsed time, including that the reported interval covers the sleep duration.DIRECTORY.mdis updated to list the new test file, following the existing pattern.