Corrected documentation and comment drift, replaced expectation-free mocks with stubs, and trimmed the distribution archive. - #306
Conversation
… and info block docs, and dropped stale export-ignore entries.
…tale comment claims and added a guard clause.
…loper files from distribution archives.
…pinned it with a test.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (11)
💤 Files with no reviewable changes (1)
Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe pull request updates distribution archive exclusions, documents screenshot filename tokens and host normalization, and revises screenshot-related tests to use stubs and shared setup. ChangesScreenshot documentation and test maintenance
Distribution archive configuration
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to The change remains limited to documentation, test maintenance, and packaging metadata, with no established production regression. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 27.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 8 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #306 +/- ##
=======================================
Coverage 99.09% 99.09%
=======================================
Files 6 6
Lines 442 442
=======================================
Hits 438 438
Misses 4 4 ☔ View full report in Codecov by Harness. |
Summary
README.mddocumentsBEHAT_SCREENSHOT_TOKEN_HOSTand the{feature}token, states that the{step_name}token strips double quotes, and shows the literalnl2br()-generated markup for the info block; the comments onScreenshotContext::captureScreenshot()andBehatCliTrait::behatCliIsDebug()now describe what the code actually does; andbeforeScenarioUpdateBaseUrl()in theFeatureContextTestheredoc template returns early instead of nesting its body inside anif.BEHAT_SCREENSHOT_TOKEN_HOSThad no documentation at all,{feature}resolved throughTokenizer::replaceFeatureToken()identically to{feature_file}with nothing in the table or the tests recording it, the{step_name}row omitted the double-quote removalTokenizer::replaceStepToken()performs, the info-block example showed<br/>and a standalone<hr/>line rather than the<br />and same-line<hr/>thatnl2br()actually emits, the driver comment incaptureScreenshot()referenced a Goutte-shipped-with-Behat example this repo replaced withbehat/mink-browserkit-driver, the docblock onbehatCliIsDebug()claimed any non-empty string enables debug output when call sites use plain truthiness soBEHAT_CLI_DEBUG="0"disables it, andAnimationAssemblyProfileTest::createBeforeScenarioScope()duplicatedBehatScopeTrait::createBeforeScenarioScope()byte-for-byte while silently shadowing it.PHPUnit now doubles collaborators with
createStub()instead ofcreateMock()inBehatScopeTrait,ScreenshotContextTest,ScreenshotContextInfoTest,ScreenshotContextResizeTestandScreenshotContextAnimationTestwherever a test configures no expectation, dropping the notice count from 27 to 14 with the assertion count unchanged;.gitattributesadds.claude,CLAUDE.mdandlogo.pngtoexport-ignoreso the distribution archive holds onlysrc/, the four OSS docs,behat.dist.phpandcomposer.json; nosrc/behaviour changes anywhere - the solesrc/edit is the comment incaptureScreenshot().Before / After
Changes
README.md- documentedBEHAT_SCREENSHOT_TOKEN_HOST, added a{feature}row to the filename token table as an alias of{feature_file}, corrected the{step_name}token description, and corrected the info-block HTML example to match actualnl2br()output..gitattributes- droppedexport-ignoreentries fordocker-compose.yml,docker-compose.override.default.ymlandphpmd.xml(none exist in this repo), and added.claude,CLAUDE.mdandlogo.pngso they no longer ship in the distribution archive.src/DrevOps/BehatScreenshotExtension/Context/ScreenshotContext.php- rewrote thecaptureScreenshot()comment to describe a driver without screenshot support rather than a "Goutte shipped with Behat" example that does not apply to this project.tests/behat/bootstrap/BehatCliTrait.php- added a guard clause tobeforeScenarioUpdateBaseUrl(), removed a comment restating the line below it, and dropped the incorrect truthiness claim from thebehatCliIsDebug()docblock.tests/phpunit/Unit/TokenizerTest.php- added afeature token aliasdataset asserting{feature}.{feature_file}.{ext}resolves tofoo-file.foo-file.png, pinning the newly documented alias.tests/phpunit/Profile/AnimationAssemblyProfileTest.php- removedcreateBeforeScenarioScope()and its four now-unused imports; the class now usesBehatScopeTrait::createBeforeScenarioScope()exclusively.tests/phpunit/Traits/BehatScopeTrait.php,ScreenshotContextTest.php,ScreenshotContextInfoTest.php,ScreenshotContextResizeTest.php,ScreenshotContextAnimationTest.php- replacedcreateMock()withcreateStub()for every double that configures no expectations, and removed one inertScenarioInterface::hasTag()stub.Verification
composer lint- phpcs, phpstan, rector and gherkinlint all clean.composer test- 331 tests / 737 assertions passing. The 14 remaining PHPUnit notices all originate increatePartialMock(ScreenshotContext::class, ...), which has no stub equivalent.composer test-bdd -- --tags=~@selenium --tags=~@headless- 29 scenarios / 199 steps passing, covering the editedFeatureContextTestheredoc template.BEHAT_SCREENSHOT_PROFILE_STEPS=2 composer profile- confirms the removedcreateBeforeScenarioScope()was behaviour-identical to the trait method that now serves it.git archiveoutput confirmed clean, matching the newexport-ignorelist.