expect/peridot-expect-plugin
Peridot plugin that adds Expect-style assertions to your specs, so you can write expressive expect($value)->to... checks inside Peridot tests. Install with Composer and enable the plugin in your Peridot configuration for readable, behavior-driven PHP testing.
Architecture fit. This is not a Laravel package — it is a Peridot plugin. Peridot is a standalone BDD/spec runner for PHP in the RSpec/Jasmine lineage, and its extension model is a peridot.php bootstrap that returns a closure receiving the Configuration object. This plugin uses that hook to register the expect() assertion DSL into the spec scope so tests read as expect($value)->to->be->equal(42) rather than $this->assertEquals(42, $value).
The integration surface is therefore narrow and well-bounded:
vendor/ directory.Integration feasibility. Mechanically trivial: composer require --dev expect/peridot-expect-plugin, add one line to peridot.php, write specs under spec/. The difficulty is not installation — it is that adoption presumes Peridot is (or becomes) your test runner. Laravel's first-party stack is PHPUnit, with Pest as the modern expressive layer. Choosing this plugin means running a second test framework and assertion vocabulary alongside the default one: a second binary, a second CI stage, a second directory convention, and two ways to write a test in the same repo.
Technical risk. The signals here are weak across the board: 1 star, 0 dependents, composite score 0.035. There is no observable production usage anywhere in the ecosystem, which means no community-derived bug surface, no Stack Overflow corpus, and no third-party tutorials.
| Risk | Severity | Notes |
|---|---|---|
| Abandonment | High | Near-zero adoption; single-maintainer org; verify last commit and open-issue count before anything else |
| Version/compat drift | Medium-High | Three coupled packages (plugin, Peridot, expect) must stay mutually compatible across PHP upgrades |
| Ecosystem/tooling | High | No PHPUnit-compatible output guarantees, no IDE/Pest plugin support, thin docs |
| Security | Low | Dev-only, but still enters the lockfile and CI supply chain |
| Blast radius | Low | Cannot affect production runtime if correctly scoped to require-dev |
| Silent non-execution | Medium | Misconfigured plugin bootstrap can leave specs not running while CI stays green |
The last row is the one that actually matters to a TPM: the worst outcome isn't the plugin breaking, it's the plugin appearing to work while assertions are inert.
Key questions.
expect()->toBe()) at zero marginal cost?Stack fit. Treat it as pure dev tooling, not a Laravel dependency.
composer require --dev only; confirm composer install --no-dev produces an image with zero trace of it.config/app.php or bootstrap/providers.php — the package has none to register, and none should be invented.composer test script if PHPUnit remains the primary runner; give it its own script alias and its own CI job.spec/ tree so the tests/ suite and its PHPUnit config remain untouched.Migration path. Do not frame this as a migration. Two honest paths:
expect() grammar) is already available in Pest with a vastly larger ecosystem. This is a spike, not a backlog ticket. My recommendation is to not adopt; if the goal is expressive assertions, standardize on Pest and revisit only if a team is already committed to Peridot for other reasons.Compatibility. Before writing a line of spec code, resolve the transitive graph:
expect/peridot-expect-plugin → peridot-php/peridot → PHP constraint.expect/peridot-expect-plugin → expectation-php/expect → PHP constraint.sebastian/*, mocking libraries) introduced by Peridot's own test deps.Pin all three explicitly in composer.json rather than floating ranges, and add a composer why-not php ^8.x check to the upgrade runbook. If a Laravel major upgrade bumps PHP, this plugin is a candidate to break first and be maintained last.
Sequencing.
Maintenance. Effectively zero upstream maintenance is the base case given the adoption numbers. Budget for a vendored fork carried in a private Composer repository, or accept that a composer update can silently strand the toolchain. Any fork inherits three packages, not one — the maintenance obligation is larger than the plugin's own footprint suggests. Assign a named owner before adoption; "the team" is not an owner.
Support. No vendor, no commercial option, no community. Support means reading the plugin source, then Peridot's source, then the expect library's source — in that order, and possibly all three for a single defect. Stack Overflow and blog coverage are effectively nil. Realistic MTTR for a novel failure: half a day to two days for a capable PHP engineer, with no escalation path.
Scaling. Adequate for small suites. Constraints compound at scale:
Failure modes.
| Failure | Detection | Impact |
|---|---|---|
| Plugin bootstrap missing/misconfigured | Only if you explicitly test for it | Specs don't run; CI green; false confidence |
| Upstream incompatibility after PHP bump | First CI run post-upgrade | Blocked upgrade, no upstream fix |
expect vs. Peridot version skew |
Composer resolution error (loud) or runtime Error (quiet until that spec runs) |
Intermittent, environment-specific |
| Abandoned package yanked/deleted | Composer install failure | Build breaks with no replacement path |
| Assertion semantics differ from PHPUnit | Code review only | Tests that read as strict but assert loosely |
Ramp-up. Laravel developers own PHPUnit fluency; Peridot's DSL is a new vocabulary with a chained grammar (->to->be->equal(), negation modifiers, custom matchers) that has its own idioms and edge cases. Realistic ramp-up is 1–2 days per engineer to productive, plus ongoing context-switching cost for anyone moving between tests/ and spec/. Onboarding material must be written in-house — nothing exists to link to.
Bottom line. Architecturally harmless and operationally cheap to trial, but it solves a problem the stack does not have, on a foundation with no adoption and no maintenance signal. Recommend a time-boxed spike at most; default position is to decline and standardize expressive assertions on Pest, which already occupies the same niche with a healthy ecosystem.
How can I help you explore Laravel packages today?