2018-04-09 15:23:41 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This file is loaded by PHPUnit before any test.
|
|
|
|
*/
|
|
|
|
|
2018-07-06 21:24:17 -04:00
|
|
|
use Friendica\App;
|
2018-04-09 15:23:41 -04:00
|
|
|
use PHPUnit\DbUnit\DataSet\YamlDataSet;
|
|
|
|
use PHPUnit\DbUnit\TestCaseTrait;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
require_once __DIR__.'/../boot.php';
|
|
|
|
require_once __DIR__.'/../include/api.php';
|
|
|
|
|
2018-07-06 21:20:29 -04:00
|
|
|
new App(dirname(__DIR__));
|
|
|
|
|
2018-07-07 18:03:59 -04:00
|
|
|
\Friendica\Core\Config::set('system', 'url', 'http://localhost');
|
2018-07-08 01:46:22 -04:00
|
|
|
\Friendica\Core\Config::set('system', 'hostname', 'localhost');
|
2018-07-07 17:46:51 -04:00
|
|
|
\Friendica\Core\Config::set('system', 'worker_dont_fork', true);
|
2018-07-06 21:39:24 -04:00
|
|
|
|
2018-04-09 15:23:41 -04:00
|
|
|
// Backward compatibility
|
|
|
|
if (!class_exists(TestCase::class)) {
|
|
|
|
class_alias(PHPUnit_Framework_TestCase::class, TestCase::class);
|
|
|
|
}
|
|
|
|
if (!trait_exists(TestCaseTrait::class)) {
|
|
|
|
class_alias(PHPUnit_Extensions_Database_TestCase_Trait::class, TestCaseTrait::class);
|
|
|
|
}
|
|
|
|
if (!class_exists(YamlDataSet::class)) {
|
|
|
|
class_alias(PHPUnit_Extensions_Database_DataSet_YamlDataSet::class, YamlDataSet::class);
|
|
|
|
}
|