Skip to content

Improve fake testing #19

@edgarsn

Description

@edgarsn

Description

We broke current testcases in version 2.0.0 and released 2.0.2 fixing it (59beaca, 0065913), but the fix looks hacky one.

Let's improve it in the next major version and make some examples in README how 3rd party developers should properly write tests using this package.

The problem which lead to the behaviour changed was $pendingClient = clone $this->clients[$name];. Meaning it clones a new client every time TmsApi::client('default') is called. This solved the problem in v1 where timeouts and middleware were global for all further requests using that client, but made a testing with laravel HTTP client (preventStrays, fake) much harder in 3rd party code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions