]> git.mxchange.org Git - friendica.git/commitdiff
Removing debugging echo
authorPhilipp Holzer <admin@philipp.info>
Sat, 6 Oct 2018 17:11:00 +0000 (19:11 +0200)
committerPhilipp Holzer <admin@philipp.info>
Sat, 6 Oct 2018 17:11:00 +0000 (19:11 +0200)
Updating Tests

phpunit.xml
src/App/Mode.php
tests/ApiTest.php
tests/DatabaseTest.php
tests/bootstrap.php

index 0494b4dcb4d92285584401dc585d9716566a54ae..9ed293b6314c4e2da2f1b30f0d3330477aca5a68 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
 <phpunit
+       bootstrap="tests/bootstrap.php"
        verbose="true">
     <testsuites>
         <testsuite>
index 10f1092a8952effd2d749d308cc05cf87682b8b6..d9f5cdbd4c5b09f79cfa1f12c0dbd9f975e81e5e 100644 (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;
        }
 
index 941ed96bf8b6078ea00443c4138e83ed9f7984d1..cbc6f7e0b4412a0e196e78259bd2c2d56cb5d8a8 100644 (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 = [
index 9844699b069e86b885a0f3eab393042956648adc..52ca3f68d37f098df050af42e878e6be6f563881 100644 (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.
index 4bc3e932f0118529faae6ca0d3560985603d2ccf..ada2b1a0ec6852af6cc387841ef464ce51077e1d 100644 (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);