Removing debugging echo
Updating Tests
This commit is contained in:
parent
31148e25cf
commit
a2fb49a2b4
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<phpunit
|
||||
bootstrap="tests/bootstrap.php"
|
||||
verbose="true">
|
||||
<testsuites>
|
||||
<testsuite>
|
||||
|
|
|
@ -87,10 +87,6 @@ class Mode
|
|||
*/
|
||||
public function has($mode)
|
||||
{
|
||||
echo "mode: " . $this->mode . " with " . $mode;
|
||||
|
||||
echo "value: " . ($this->mode & $mode);
|
||||
|
||||
return ($this->mode & $mode) > 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,12 +24,11 @@ class ApiTest extends DatabaseTest
|
|||
/**
|
||||
* 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 = [
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
namespace Friendica\Test;
|
||||
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Database\DBA;
|
||||
use PHPUnit\DbUnit\DataSet\YamlDataSet;
|
||||
use PHPUnit\DbUnit\TestCaseTrait;
|
||||
|
@ -16,8 +18,15 @@ use PHPUnit_Extensions_Database_DB_IDatabaseConnection;
|
|||
*/
|
||||
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.
|
||||
|
|
|
@ -3,20 +3,10 @@
|
|||
* 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);
|
||||
|
|
Loading…
Reference in a new issue