title: Symfony2 access to Global Variables from a twig template in phpunit test
body: <p>I have a twig template with <code>{{ app.user }}</code>. The problem is, that in a phpunit test (a class, which extends <code>WebTestCase</code>) it is defined as NULL. Simulating Authentication with a Token (<a href="http://symfony.com/doc/current/cookbook/testing/simulating_authentication.html">http://symfony.com/doc/current/cookbook/testing/simulating_authentication.html</a>) or simulating HTTP Authentification (<a href="http://symfony.com/doc/current/cookbook/testing/http_authentication.html">http://symfony.com/doc/current/cookbook/testing/http_authentication.html</a>) does not help.
  So how can I set a twig global variable from a phpunit test? And why simulating authentification is not working in this case?</p>