Skip to content

Quantum::fake() should accept stubbed responses like Http::fake() #7

Description

@corgab

Context

Quantum::fake() is explicitly modelled on Http::fake() / Mail::fake() (README and the QuantumFake docblock say so). But the parity is incomplete: Http::fake(['url' => Http::response(...)]) lets you stub the response the code under test receives, whereas QuantumFake::executeCircuit() always returns a hardcoded deterministic 50/50 result ($zeros => half, $ones => shots - half) and generateEntropy() always returns the fixed 0xAA pattern.

This means tests can assert that a circuit ran, but cannot exercise application logic that branches on a specific measurement outcome (e.g. "if mostFrequent() is 11, do X"). The component the package names as its model supports exactly this, so the gap is relative to the package's own stated reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions