Skip to content

Update dependency texthtml/doctest to v1 - #33

Merged
mathroc merged 1 commit into
mainfrom
renovate/texthtml-doctest-1.x
Nov 15, 2026
Merged

mathroc merged 1 commit into
mainfrom
renovate/texthtml-doctest-1.x

Conversation

@text-html-renovate

@text-html-renovate text-html-renovate Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
texthtml/doctest ^0.3 → ^1.0 age confidence

Release Notes

texthtml/doctest (texthtml/doctest)

v1.2.1

Compare Source

v1.2.1

Fixed

  • --static-scan now applies the enclosing class's #[ExamplesSetup(...)]
    attributes to method examples, like the reflection backend does: the class
    setups are merged first, the method's own second (#​73, #​75).
  • --static-scan no longer fatals with Cannot redeclare function when two
    sibling methods' examples each declare a same-named helper function: method
    examples now evaluate in a per-method runtime namespace
    (TH\Doctest\Runtime\{Class}\{method}\Example{N}), matching the reflection
    backend (#​74, #​76).

v1.2.0

Compare Source

v1.2.0

Added

  • --static-scan option: discovers code examples by parsing files
    (nikic/php-parser) instead of including them. Because the reflection
    backend executes every matched file just to find their doc comments:

    • all code under test ran before any example ran (side effects, DB
      connections, environment requirements);
    • a file calling exit() silently killed discovery;
    • a parse error in any included file could abort the whole run.

    With --static-scan nothing is executed at discovery time: a parse error
    skips one file instead of failing the run, and each file is included lazily,
    just before its first example runs (so side effects are only paid when an
    example actually references the code — also making --filter runs cheap).
    Setups declared via #[ExamplesSetup(...)] are captured from the AST,
    name-resolved and instantiated at test time.

    The reflection backend is unchanged and remains the default; expect to flip
    the default in a future release.

  • TestSuite::fromPaths() accepts a staticScan parameter so library
    consumers can opt into the static backend as well.

Fixed

  • Files yielded every file twice (double Finder->in() call), running every
    example twice.

Internal

  • doc comments sitting between an attribute group and the declaration are
    dropped by php-parser though reflection still sees them: they are recovered
    from the raw token stream, keeping static output byte-identical to the
    reflection backend's.
  • dogfooding: bin/doctest --static-scan examples produces byte-identical
    results to the reflection backend (same names, line ranges and ordering).
  • nikic/php-parser ^5.0 added to the requirements.

v1.1.0

Compare Source

v1.1.0

Added

  • --coverage-clover <path> option: collects code coverage of what the
    examples actually execute, via a php-code-coverage driver bracketed around
    the suite run and filtered to the analyzed paths. Feed the report to Codecov
    or any Clover-aware tool to see how much of your code your documentation
    covers.
  • pcov misconfigurations that would silently yield an all-zero report (e.g.
    pcov.directory excluding the analyzed paths) are refused up front with a
    -d pcov.directory=… hint instead of publishing misleading numbers.
  • Without pcov or xdebug installed, the option fails with actionable guidance
    ("install & enable pcov (recommended) or xdebug").

Internal

  • dogfooding: the CI run on doctest's own examples now produces its coverage
    report from a single doctest invocation (console + JUnit + Clover snapshots),
    and both the unit-test and examples coverage reports are uploaded to Codecov
    on the PHP 8.5 leg.
  • composer.lock is committed (export-ignored, so dist archives stay lean) and
    config.platform.php is pinned to 8.2: every CI leg resolves the same
    dependency set instead of drifting per PHP version.

v1.0.0

Compare Source

v1.0.0

First stable release. doctest executes the PHP examples found in your
doc-comments as part of your test suite, so documentation examples fail CI
instead of quietly rotting.

Breaking changes

  • #[ExamplesSetup] now takes a setup instance, not a class-string:
    #[ExamplesSetup(new MySetup())] instead of #[ExamplesSetup(MySetup::class)].
    The attribute is repeatable, so multiple setups are expressed by stacking it.
    Setups are no longer constrained by any interface — any object works; it is
    instantiated fresh before each example it applies to and released right after.
  • The TH\DocTest\SetUp interface was removed (it is implied by passing an object).
  • --no-bail was removed from the CLI — it could only ever restate the default.
    --bail / -b is unchanged.
  • Requires PHP >= 8.2 (8.1 support dropped) and symfony/console & finder ^7.0|^8.0
    (symfony 6 support dropped).

Added

  • --junit option: write test results to a file in JUnit XML format.
  • PSR-3 logging (psr/log): iterator warnings (e.g. unreadable files) go to a
    logger instead of being swallowed; the CLI wires a console logger.
  • Deterministic example ordering: files are visited alphabetically, so test
    output is stable across filesystems and machines.

Internal

  • Replaced phpcs + phpstan with Mago,
    baselines at zero.
  • PHPUnit 13, webmozart/assert v2.
  • Code coverage uploaded to Codecov on PHP 8.5.
  • README badges (CI, Codecov, Packagist version, PHP, License).

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4c1b69b) to head (0e19dfe).

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #33   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity         5         5           
===========================================
  Files              1         1           
  Lines             15        15           
===========================================
  Hits              15        15           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@text-html-renovate
text-html-renovate Bot force-pushed the renovate/texthtml-doctest-1.x branch from bb794a5 to 0e19dfe Compare November 15, 2026 22:24
@mathroc
mathroc merged commit 6399fa5 into main Nov 15, 2026
7 checks passed
@mathroc
mathroc deleted the renovate/texthtml-doctest-1.x branch November 15, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant