Releases: rasuvaeff/understudy-phpunit
Release list
v0.4.1
- Requires
rasuvaeff/understudy^0.9 || ^0.10. The engine's 0.10 closes six
defects of the 1.0 review, the widest of them being that an optional
parameter no longer has to be spelled in a specification:when(fn () => $repository->find(1))now matches a contract whose remaining parameters
carry defaults, and an unspelled position is rendered as…in reports so
it is never mistaken for a writtenany(). Nothing this adapter does changes
— the arity suppression it carries is aboutArg::rest(), which still
covers the contract's required parameters and only those. - Drops the
^0.8term, as 0.4.0 said it would in the release that
follows the engine's. - Moves the Pest fixture's path-repository pins with the release, as this
package's own rule requires: the engine to0.10.0, this package to
0.4.1, and the fixture's requirement to^0.4. A path repository is
canonical, so a stale pin does not fall back to Packagist — left alone,
^0.8would have kept the README's recipe resolvable and never once run
it against 0.10.
v0.4.0
A minor rather than a patch: the trait's PHPUnit lifecycle hooks are all
@internal. Their protected visibility is required for PHPUnit discovery,
not an invitation to override them. A test class that owns post-conditions
must use the documented trait alias to compose them explicitly.
v0.3.0
A minor rather than a patch: two methods of the trait become @internal, and
roave/backward-compatibility-check reads that as the contract narrowing it is
— which Composer's caret already treats as breaking on 0.x.
- Allows
rasuvaeff/understudy^0.8 || ^0.9. A bridge, not a widening for
its own sake: the engine's 0.9 is the 1.0 candidate — every contract decision
of the 1.0 review lands there, and 1.0 follows once it has been driven by real
packages — and a project taking it must be able to keep this adapter without a
window in whichcomposer requiresilently installs the 0.8 engine beside
it. The^0.8term is dropped in the release that follows the engine's. - The two hook methods of the trait,
understudyPrepareContext()and
understudyResetContext(), are@internal. They areprotectedbecause
PHPUnit discovers hooks by attribute and a trait cannot hide them from the
class using it, not as override points: a subclass that overrode one would
silently lose the guard or the reset.understudyStrictStubs()stays the
one documented override, andassertPostConditions()stays public API
because the README's explicit-composition recipe calls it through an alias. - Both READMEs stop dating
lean()to «understudy 0.4+»: with a floor of
^0.8every engine this adapter installs beside has it.llms.txtcarries
the family's# rasuvaeff/…heading.
v0.2.0
- Requires
rasuvaeff/understudy^0.8, and requires it as a single term. The
accumulating union it carried (^0.4 || ^0.5 || …) had to be widened by hand
on every core release, and a package that misses one becomes uninstallable
beside its own engine. #[DoesNotPerformAssertions]works again. The trait counted an assertion
unconditionally, so a test marked with that attribute reported "performed 1
assertion" and went risky — on exactly the tests the attribute is written for
("this should simply not throw"), in a class that inherits the trait from a
project-wide base class along with everything else. A test that created no
double is now left alone entirely.- The context guard no longer blames a test that never ran. A double
created insetUpBeforeClass()fills the context before#[Before], and the
message sent the reader looking for an earlier test that skipped cleanup, an
unused trait and a swallowedassertPostConditions()— none of which was the
case. It now namessetUpBeforeClass()first. - The Pest example runs. The second snippet of that section called
when()
without importing it —Call to undefined function when()— in a section
whose whole subject is which functions to import under which names. Both
READMEs are fixed; the package's own Pest fixture had it right all along. - Both READMEs and
llms.txtstop pointing atUnderstudy::strict($double)as
the per-double form of strict stubs. It is strict dispatch — "fail on any
call no expectation matched" — and says nothing about a stub that was
configured and never called; the per-double equivalent is
when(…)->times(n). - Both READMEs and
llms.txtsay that verification runs before your
teardown here and after it underunderstudy-testo, so a test whose
expectation is fulfilled by teardown itself fails in one runner and passes in
the other.
v0.1.7
- Documentation review fixes. Both READMEs gained the missing Security
section; the API table no longer says «reset-in-finally» (the reset has
always lived in#[After]). The trait's docblock now shows the explicit
composition in the order the README mandates — the user's post-conditions
first, verification second. The stale engine-constraint comment in
examples/readme-usage.phpcaught up with^0.7. AGENTS.md no longer links
to the retired_plans/UNDERSTUDY-PLAN.md.
v0.1.6
- Allow
rasuvaeff/understudy^0.7. Widened rather than raised. - The
#[Before]guard is checked through real PHPUnit. It was covered only
by a unit test callingrunGuard()directly, which proves the condition and
nothing about what a user sees — the guard fires from#[Before], so the
failure lands on the BLAMELESS class, the one that ran after the leak, and
that attribution is the whole diagnostic. A fixture now leaks a context from
a class without the trait and pins the report, the attribution and the exit
code. - The Pest recipe runs in CI, and it was broken. The test that executes it
skips itself unless the fixture project is installed, which was every run of
every job — so the recipe had never actually been checked, and the fixture
still stubbedfind(7)withwhen()and claimed the same call with
expect(): two registrations of one call, which the engine has refused with
ConflictingExpectationsince 0.3. The README's Pest section has been right
all along; the fixture that was supposed to prove it had drifted, in the
third place this same mistake has now been found. The job has a checkout of
its own because the fixture's path repositories are written for the monorepo
layout — this package and the engine side by side — which is deliberate:
the recipe runs against the working tree of both. infection/infectionmoves to^0.35, matching the monorepo templates.
Re-measured: 12 of 12 mutants killed, unchanged.AGENTS.mdsaid the unit tests avoid PHPUnit's assertion counter; they use
it, by its new name. What actually guards the rename is thePHPUnit ^11.5
matrix job, and the note says so now.
v0.1.5
- Allow
rasuvaeff/understudy^0.6. Widened rather than raised: the adapter
works against every 0.x line it has ever supported, and consumers on the
older ones should not be cut off from it. - The shipped trait's docblock taught the usage this package documents as
wrong. It stubbedfind(7)withwhen()and claimed the same call with
expect()— two registrations of one call, which the engine refuses — and
it armed the expectation below the action, where it counts zero.llms.txt
carried the same snippet. Both now show the corrected form the README and
examples/readme-usage.phphave used since 0.1.0, and both name the two
engine rules that decide it. Fixes #13. DocumentedUsageTestpins the three copies of the Usage snippet to each
other. The original mistake survived two releases because nothing ran the
snippet; the fix reached the README and the runnable example and stopped
there, at the two copies nothing executes — which a consumer reads in their
IDE and an assistant reads asllms.txt.
v0.1.4
- The Requirements section of both READMEs said
rasuvaeff/understudy
^0.1 || ^0.2 || ^0.3whilecomposer.jsonhas allowed^0.4since 0.1.3,
and the usage examples already use 0.4 idioms. - Allow
rasuvaeff/understudy^0.5. The core release narrows what a
closingscope()verifies and refuses two impossible matcher
configurations — both changes to the consumer's own test code, neither
reaching this adapter, which needs no code change.
v0.1.3
-
Allow
rasuvaeff/understudy^0.4:Arg::rest(),Arg::captor(),
Understudy::delegate(),Understudy::lean()and rendered property hooks
are all additive — the adapter needs no code change. -
README (EN+RU): documented that the
#[After]reset runs after
tearDown()while the call log still retains returned values, the Windows
"Directory not empty" failure that surfaces it, and the two remedies —
Understudy::lean()(understudy 0.4+) andUnderstudy::scope()
(rasuvaeff/understudy#63).
v0.1.2
- Allow
rasuvaeff/understudy^0.3(the engine refuses colliding same-call
when()/expect()registrations withConflictingExpectationfrom 0.3.0;
nothing in this adapter changes behaviour).