title: Test controller action by phpunit, symfony
body: <p>I need to test my controller action and i need advice. 
  It's how my controller looks: </p>
  
  <pre><code>class SampleController extends Controller
  {    
      public function sampleAction(Request $request)
      {
          $lang = 'en';
  
          return $this-&gt;render('movie.html.twig', [
              'icons' =&gt; $this-&gt;container-&gt;getParameter('icons'),
              'language' =&gt; $lang,
              'extraServiceUrl' =&gt; $this-&gt;getAccount()-&gt;getExtraServiceUrl(),
              'websiteUrl' =&gt; $this-&gt;getAccount()-&gt;getWebsiteUrl(),
              'myProfileUrl' =&gt; $this-&gt;getAccount()-&gt;getMyProfileUrl(),
              'redirectForAnonUser' =&gt; $this-&gt;container-&gt;get('router')-&gt;generate('login'),
              'containerId' =&gt; $request-&gt;getSession()-&gt;get("_website"),
              'isRestricted' =&gt; $this-&gt;getLicense()-&gt;isRestricted(),
              'isPremiumAvaible' =&gt; $this-&gt;getLicense()-&gt;isPremiumAvaible()
          ]);
      }
  
      private function getAccount()
      {
          return $this-&gt;container-&gt;get('context')-&gt;getAccount();
      }
  
      private function getLicense()
      {
          return $this-&gt;container-&gt;get('license');
      }
  }
  </code></pre>
  
  <p>And now, normally I test controllers by behat, but this one just render twig and set variables in  so I probably can't test it by behat. I tried to test it by phpUnit and it can work, but what is the best way to mock chain methods? Or maybe you have other way to test it?
  btw container is private so I need reflection?
  Greetings</p>