Removing debugging echo

Updating Tests
This commit is contained in:
Philipp Holzer 2018-10-06 19:11:00 +02:00
parent 31148e25cf
commit a2fb49a2b4
No known key found for this signature in database
GPG Key ID: 517BE60E2CE5C8A5
5 changed files with 13 additions and 18 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<phpunit <phpunit
bootstrap="tests/bootstrap.php"
verbose="true"> verbose="true">
<testsuites> <testsuites>
<testsuite> <testsuite>

View File

@ -87,10 +87,6 @@ class Mode
*/ */
public function has($mode) public function has($mode)
{ {
echo "mode: " . $this->mode . " with " . $mode;
echo "value: " . ($this->mode & $mode);
return ($this->mode & $mode) > 0; return ($this->mode & $mode) > 0;
} }

View File

@ -24,12 +24,11 @@ class ApiTest extends DatabaseTest
/** /**
* Create variables used by tests. * Create variables used by tests.
*/ */
protected function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();
// Reusable App object require_once __DIR__.'/../include/api.php';
$this->app = BaseObject::getApp();
// User data that the test database is populated with // User data that the test database is populated with
$this->selfUser = [ $this->selfUser = [

View File

@ -5,6 +5,8 @@
namespace Friendica\Test; namespace Friendica\Test;
use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use PHPUnit\DbUnit\DataSet\YamlDataSet; use PHPUnit\DbUnit\DataSet\YamlDataSet;
use PHPUnit\DbUnit\TestCaseTrait; use PHPUnit\DbUnit\TestCaseTrait;
@ -16,8 +18,15 @@ use PHPUnit_Extensions_Database_DB_IDatabaseConnection;
*/ */
abstract class DatabaseTest extends TestCase 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. * Get database connection.

View File

@ -3,20 +3,10 @@
* This file is loaded by PHPUnit before any test. * This file is loaded by PHPUnit before any test.
*/ */
use Friendica\App;
use PHPUnit\DbUnit\DataSet\YamlDataSet; use PHPUnit\DbUnit\DataSet\YamlDataSet;
use PHPUnit\DbUnit\TestCaseTrait; use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\Framework\TestCase; 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 // Backward compatibility
if (!class_exists(TestCase::class)) { if (!class_exists(TestCase::class)) {
class_alias(PHPUnit_Framework_TestCase::class, TestCase::class); class_alias(PHPUnit_Framework_TestCase::class, TestCase::class);