title: How is it possible to test services with Laravel using PhpUnit?
body: <p>I would like to test some of my services, but I can not find any example on Laravel's website:
  <a href="https://laravel.com/docs/5.1/testing" rel="noreferrer">https://laravel.com/docs/5.1/testing</a></p>
  
  <p>They show how to test simple classes, entities, controllers, but I have no idea how to test services. How is it possible to instantiate a service with complex dependencies?</p>
  
  <hr>
  
  <p>Example service:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Services;
  
  // Dependencies
  use App\Services\FooService;
  use App\Services\BarService;
  
  class DemoService {
  
      private $foo_srv;
      private $bar_srv;
  
      function __construct(
          FooService $foo_srv,
          BarService $bar_srv
      ) {
          $this-&gt;foo_srv = $foo_srv;
          $this-&gt;bar_srv = $bar_srv;
      }
  
      // I would like to test these two functions
  
      public function demoFunctionOne() {
          // ...
      }
  
      public function demoFunctionTwo() {
          // ...
      }
  
  }
  </code></pre>