title: Mock a service provider - Laravel 5.4
body: <p>I am using a service provider in a specific controller, i registered the provider and resolved it successfully. </p>
  
  <p>But the test i used to run by mocking the actual classes are not working any more. </p>
  
  <p>I resolve the service in my controller using app(): </p>
  
  <pre><code>$cart = app()-&gt;make('Cart');
  </code></pre>
  
  <p>This is how i used to mock it before switching to a service provider: </p>
  
  <pre><code>$this-&gt;cart = $this-&gt;createMock(Cart::class);
  </code></pre>
  
  <p>Now if i want to mock it, i am doing something like this: </p>
  
  <pre><code>$this-&gt;createMock(app()-&gt;make('Cart'));
  </code></pre>
  
  <p>And the test fails with the error:</p>
  
  <pre><code>PHPUnit_Framework_MockObject_Generator::getMock() must be a array or string
  </code></pre>
  
  <p>Any ideas ?</p>