phpunit-injector

Injects services from a PSR-11 dependency injection container to PHPUnit test cases (by jakzal)

Phpunit-injector Alternatives

Similar projects and alternatives to phpunit-injector

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better phpunit-injector alternative or higher similarity.

phpunit-injector discussion

Log in or Post with

phpunit-injector reviews and mentions

Posts with mentions or reviews of phpunit-injector. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-03-04.
  • Testing with immutable PSR-7 objects and Prophecy
    3 projects | dev.to | 4 Mar 2021
    This unit test will fail when ran against the implementation from earlier. And in this situation a failing test is a good thing. But for this specific situation another "issue" has made it's way into the testcase; the unit test is now depending on the implementation that is being used for PSR-7. When working in a large codebase - like I currently am - one might have more than just a few usages of these interfaces and thus unit tests. Using the suggested approach, instantiating value objects instead of prophesizing, will lead to a large amount of object instantiations. And this will make switching to another implementation more work. Ideally this instantiating is centralized as much as possible. This is exactly why PSR-17 - HTTP Factories - was introduced. Typically dependencies - like these factories - are injected. For unit tests this is not feasible without plugins. My solution is a bit less fancy; a trait:

Stats

Basic phpunit-injector repo stats
1
62
5.0
about 2 months ago

jakzal/phpunit-injector is an open source project licensed under MIT License which is an OSI approved license.

The primary programming language of phpunit-injector is PHP.


Sponsored
Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com

Did you konow that PHP is
the 14th most popular programming language
based on number of metions?