How to mock dependency injection with phpunit?
问题 I wish to test methods in this class: class EmailerService { protected $mailer; protected $router; protected $em; protected $emailMan; protected $emailReminderMan; protected $secret; /** * Construct * * @param \Swift_Mailer $mailer * @param \Symfony\Bundle\FrameworkBundle\Routing\Router $router * @param \Doctrine\ORM\EntityManager $em * @param EmailManager $emailMan * @param EmailReminderManager $emailReminderMan * @param $secret */ public function __construct(Swift_Mailer $mailer, Router