lundi 30 mars 2015

Mocking classes that created with app()->make

I have this code in my __construrct:



public function __construct(Guard $auth)
{
$this->auth = $auth;
$this->dbUserService = app()->make('DBUserService');
}


Now, when i'm unit testing i know that i can mock Guard and pass it's mock to $auth, but how can i mock dbUserService ? it's instantiated trough the IoC container.


Aucun commentaire:

Enregistrer un commentaire