$configLoader = new ConfigFileLoader($basePath, $mode);
$configCache = Factory\ConfigFactory::createCache($configLoader);
$profiler = Factory\ProfilerFactory::create($configCache);
- Factory\DBFactory::init($configCache, $profiler, $_SERVER);
+ $database = Factory\DBFactory::init($configCache, $profiler, $_SERVER);
$config = Factory\ConfigFactory::createConfig($configCache);
- Factory\ConfigFactory::createPConfig($configCache);
- $logger = Factory\LoggerFactory::create('test', $config, $profiler);
+ Factory\ConfigFactory::createPConfig($configCache, new Config\Cache\PConfigCache());
+ $logger = Factory\LoggerFactory::create('test', $database, $config, $profiler);
$baseUrl = new BaseURL($config, $_SERVER);
- $this->app = new App($config, $mode, $router, $baseUrl, $logger, $profiler, false);
+ $this->app = new App($database, $config, $mode, $router, $baseUrl, $logger, $profiler, false);
parent::setUp();
public function testApiErrorWithJson()
{
$this->assertEquals(
- '{"status":{"error":"error_message","code":"200 Friendica\\\\Network\\\\HTTP","request":""}}',
- api_error('json', new HTTPException('error_message'))
+ '{"status":{"error":"error_message","code":"200 OK","request":""}}',
+ api_error('json', new HTTPException\OKException('error_message'))
);
}
'xmlns:friendica="http://friendi.ca/schema/api/1/" '.
'xmlns:georss="http://www.georss.org/georss">'."\n".
' <error>error_message</error>'."\n".
- ' <code>200 Friendica\Network\HTTP</code>'."\n".
+ ' <code>200 OK</code>'."\n".
' <request/>'."\n".
'</status>'."\n",
- api_error('xml', new HTTPException('error_message'))
+ api_error('xml', new HTTPException\OKException('error_message'))
);
}
'xmlns:friendica="http://friendi.ca/schema/api/1/" '.
'xmlns:georss="http://www.georss.org/georss">'."\n".
' <error>error_message</error>'."\n".
- ' <code>200 Friendica\Network\HTTP</code>'."\n".
+ ' <code>200 OK</code>'."\n".
' <request/>'."\n".
'</status>'."\n",
- api_error('rss', new HTTPException('error_message'))
+ api_error('rss', new HTTPException\OKException('error_message'))
);
}
'xmlns:friendica="http://friendi.ca/schema/api/1/" '.
'xmlns:georss="http://www.georss.org/georss">'."\n".
' <error>error_message</error>'."\n".
- ' <code>200 Friendica\Network\HTTP</code>'."\n".
+ ' <code>200 OK</code>'."\n".
' <request/>'."\n".
'</status>'."\n",
- api_error('atom', new HTTPException('error_message'))
+ api_error('atom', new HTTPException\OKException('error_message'))
);
}