public function setUpApp($env = array(), $withCache = false) { \Slim\Environment::mock($env); $this->app = new App(); $this->dataConnectionMock = $this->getMock('\\MABI\\Testing\\MockDataConnection', array('findOneByField', 'query', 'insert', 'save', 'deleteByField', 'clearAll', 'getNewId', 'findAll', 'findAllByField')); $this->app->addDataConnection('default', $this->dataConnectionMock); if ($withCache) { $this->app->addCacheRepository('system', 'file', array('path' => 'TestApp/cache')); } $this->app->getErrorResponseDictionary()->overrideErrorResponses(new Errors()); }