]> git.mxchange.org Git - friendica.git/blob - tests/bootstrap.php
Correct content type
[friendica.git] / tests / bootstrap.php
1 <?php
2 /**
3  * This file is loaded by PHPUnit before any test.
4  */
5
6 use Friendica\App;
7 use PHPUnit\DbUnit\DataSet\YamlDataSet;
8 use PHPUnit\DbUnit\TestCaseTrait;
9 use PHPUnit\Framework\TestCase;
10
11 require_once __DIR__.'/../boot.php';
12 require_once __DIR__.'/../include/api.php';
13
14 new App(dirname(__DIR__));
15
16 \Friendica\Core\Config::set('system', 'url', 'http://localhost');
17 \Friendica\Core\Config::set('system', 'hostname', 'localhost');
18 \Friendica\Core\Config::set('system', 'worker_dont_fork', true);
19
20 // Backward compatibility
21 if (!class_exists(TestCase::class)) {
22         class_alias(PHPUnit_Framework_TestCase::class, TestCase::class);
23 }
24 if (!trait_exists(TestCaseTrait::class)) {
25         class_alias(PHPUnit_Extensions_Database_TestCase_Trait::class, TestCaseTrait::class);
26 }
27 if (!class_exists(YamlDataSet::class)) {
28         class_alias(PHPUnit_Extensions_Database_DataSet_YamlDataSet::class, YamlDataSet::class);
29 }