Support the ongoing development of Laravel.io →
posted 11 years ago
IOC

I'm new to testing and am trying to figure out how to inject dependencies. I am able to inject objects as parameters but am not sure how to do so when the dependency is resolved via the Container. In other words, I have a method that currently gets an instance of testClass via App::make('testClass'). How do I get this instance during testing?

Thanks

Last updated 3 years ago.
0

Anyone?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

mrberggg mrberggg Joined 10 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.