/**
  * Construct a test case.
  */
 public function __construct()
 {
     parent::__construct();
     self::$kernel = new \AppKernel('test', true);
     self::$kernel->boot();
     self::$application = new Application(self::$kernel);
     self::$application->setAutoExit(false);
     self::$container = self::$kernel->getContainer();
     self::$doctrine = $this->get('doctrine');
 }
 /**
  * Treat $application like a singleton and return it.
  *
  * @return Application
  */
 protected static function getApplication()
 {
     if (null === self::$application) {
         $client = static::createClient();
         self::$application = new Application($client->getKernel());
         self::$application->setAutoExit(false);
     }
     return self::$application;
 }