public function setUp()
 {
     $this->setApplicationConfig(include __DIR__ . '/../../../../test.application.config.php');
     parent::setUp();
     $serviceLocator = $this->getApplicationServiceLocator()->get('shard.default.servicemanager');
     $this->documentManager = $serviceLocator->get('modelmanager');
     static::$staticDocumentManager = $this->documentManager;
     if (!static::$dbDataCreated) {
         //Create data in the db to query against
         TestData::create($serviceLocator, $this->documentManager);
         static::$dbDataCreated = true;
     }
     //ensure that all tests start in a logged out state
     $this->getApplicationServiceLocator()->get('Zend\\Authentication\\AuthenticationService')->logout();
 }
 public function setUp()
 {
     $appConfig = (include __DIR__ . '/../../../test.application.config.php');
     $appConfig['module_listener_options']['config_glob_paths'][] = __DIR__ . '/../../../test.module.perrequest.config.php';
     $this->setApplicationConfig($appConfig);
     parent::setUp();
     $serviceLocator = $this->getApplicationServiceLocator()->get('shard.default.servicemanager');
     $this->documentManager = $serviceLocator->get('modelmanager');
     static::$staticDocumentManager = $this->documentManager;
     if (!static::$dbDataCreated) {
         //Create data in the db to query against
         TestData::create($serviceLocator, $this->documentManager);
         static::$dbDataCreated = true;
     }
     //reset status code after setup
     $this->getResponse()->setStatusCode(200);
 }