/**
  * Get a doctrine instance.
  *
  * @return Registry
  */
 public function getDoctrine()
 {
     if (null === self::$doctrine) {
         self::bootKernel();
         self::$doctrine = static::$kernel->getContainer()->get('doctrine');
     }
     return self::$doctrine;
 }
 /**
  * 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');
 }