Browse Source

Removing debugging echo

Updating Tests
pull/5844/head
Philipp Holzer 3 years ago
parent
commit
a2fb49a2b4
No known key found for this signature in database GPG Key ID: 517BE60E2CE5C8A5
5 changed files with 13 additions and 18 deletions
  1. +1
    -0
      phpunit.xml
  2. +0
    -4
      src/App/Mode.php
  3. +2
    -3
      tests/ApiTest.php
  4. +10
    -1
      tests/DatabaseTest.php
  5. +0
    -10
      tests/bootstrap.php

+ 1
- 0
phpunit.xml View File

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


+ 0
- 4
src/App/Mode.php View File

@ -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;
}


+ 2
- 3
tests/ApiTest.php View File

@ -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 = [


+ 10
- 1
tests/DatabaseTest.php View File

@ -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.


+ 0
- 10
tests/bootstrap.php View File

@ -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…
Cancel
Save