title: Symfony 3.4: How to get serviceContainer in UnitTest
body: <p>I want to access the object of my class import</p>
  
  <p>but I passed LoggerInterface $logger in its container:</p>
  
  <pre><code>class Import
  {
  ....
      public function __construct(LoggerInterface $logger)
      {
       ...
      }
  
  ....
   }
  </code></pre>
  
  <p>so when I accessed this object in my testimport class</p>
  
  <pre><code>class ImportTest extends TestCase {
  ....
     protected function setUp()
      {
        $this-&gt;ImportObj = new Import(); // I have to pass some 
                                         // object as an object is passed 
                                         // in import class   
      ....   
      }
  ....
  }
  </code></pre>
  
  <p>And as we know instead of new Import() we can use serviceContainer logic to achieve this</p>
  
  <pre><code>$this-&gt;ImportObj=$this-&gt;getContainer()-&gt;get('\Import'); 
  </code></pre>
  
  <p><strong>But i cant't access this service container outside my bundle , so my question is how i can make it workable.</strong></p>