<?xml version="1.0"?>
<phpunit
+ bootstrap="tests/bootstrap.php"
verbose="true">
<testsuites>
<testsuite>
*/
public function has($mode)
{
- echo "mode: " . $this->mode . " with " . $mode;
-
- echo "value: " . ($this->mode & $mode);
-
return ($this->mode & $mode) > 0;
}
/**
* Create variables used by tests.
*/
- protected function setUp()
+ public function setUp()
{
parent::setUp();
- // Reusable App object
- $this->app = BaseObject::getApp();
+ require_once __DIR__.'/../include/api.php';
// User data that the test database is populated with
$this->selfUser = [
namespace Friendica\Test;
+use Friendica\BaseObject;
+use Friendica\Core\Config;
use Friendica\Database\DBA;
use PHPUnit\DbUnit\DataSet\YamlDataSet;
use PHPUnit\DbUnit\TestCaseTrait;
*/
abstract class DatabaseTest extends TestCase
{
+ public function setUp()
+ {
+ // Reusable App object
+ $this->app = BaseObject::getApp();
- use TestCaseTrait;
+ Config::set('system', 'url', 'http://localhost');
+ Config::set('system', 'hostname', 'localhost');
+ Config::set('system', 'worker_dont_fork', true);
+ }
/**
* Get database connection.
* This file is loaded by PHPUnit before any test.
*/
-use Friendica\App;
use PHPUnit\DbUnit\DataSet\YamlDataSet;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\Framework\TestCase;
-require_once __DIR__.'/../boot.php';
-require_once __DIR__.'/../include/api.php';
-
-new App(dirname(__DIR__));
-
-\Friendica\Core\Config::set('system', 'url', 'http://localhost');
-\Friendica\Core\Config::set('system', 'hostname', 'localhost');
-\Friendica\Core\Config::set('system', 'worker_dont_fork', true);
-
// Backward compatibility
if (!class_exists(TestCase::class)) {
class_alias(PHPUnit_Framework_TestCase::class, TestCase::class);