mirror of
https://github.com/friendica/friendica
synced 2024-12-23 02:40:17 +00:00
Fixing tests
This commit is contained in:
parent
800dbc7f44
commit
104086215c
3 changed files with 30 additions and 13 deletions
|
@ -5,13 +5,14 @@
|
||||||
|
|
||||||
namespace Friendica\Test;
|
namespace Friendica\Test;
|
||||||
|
|
||||||
use Friendica\BaseObject;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Factory\LoggerFactory;
|
use Friendica\Factory;
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
|
use Friendica\Util\BasePath;
|
||||||
use Monolog\Handler\TestHandler;
|
use Monolog\Handler\TestHandler;
|
||||||
|
|
||||||
require_once __DIR__ . '/../../include/api.php';
|
require_once __DIR__ . '/../../include/api.php';
|
||||||
|
@ -34,10 +35,14 @@ class ApiTest extends DatabaseTest
|
||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
$basedir = BasePath::create(dirname(__DIR__) . '/../');
|
||||||
|
$configLoader = new Config\ConfigCacheLoader($basedir);
|
||||||
|
$config = Factory\ConfigFactory::createCache($configLoader);
|
||||||
|
$logger = Factory\LoggerFactory::create('test', $config);
|
||||||
|
$this->app = new App($config, $logger, false);
|
||||||
|
$this->logOutput = FActory\LoggerFactory::enableTest($this->app->getLogger());
|
||||||
|
|
||||||
$this->app = BaseObject::getApp();
|
parent::setUp();
|
||||||
$this->logOutput = LoggerFactory::enableTest($this->app->getLogger());
|
|
||||||
|
|
||||||
// User data that the test database is populated with
|
// User data that the test database is populated with
|
||||||
$this->selfUser = [
|
$this->selfUser = [
|
||||||
|
|
|
@ -1,19 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Friendica\Test\Database;
|
namespace Friendica\Test\Database;
|
||||||
|
|
||||||
use Friendica\BaseObject;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\Factory;
|
||||||
use Friendica\Test\DatabaseTest;
|
use Friendica\Test\DatabaseTest;
|
||||||
|
use Friendica\Util\BasePath;
|
||||||
|
|
||||||
class DBATest extends DatabaseTest
|
class DBATest extends DatabaseTest
|
||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
$basedir = BasePath::create(dirname(__DIR__) . '/../../');
|
||||||
|
$configLoader = new Config\ConfigCacheLoader($basedir);
|
||||||
|
$config = Factory\ConfigFactory::createCache($configLoader);
|
||||||
|
$logger = Factory\LoggerFactory::create('test', $config);
|
||||||
|
$this->app = new App($config, $logger, false);
|
||||||
|
$this->logOutput = FActory\LoggerFactory::enableTest($this->app->getLogger());
|
||||||
|
|
||||||
// Reusable App object
|
parent::setUp();
|
||||||
$this->app = BaseObject::getApp();
|
|
||||||
|
|
||||||
// Default config
|
// Default config
|
||||||
Config::set('config', 'hostname', 'localhost');
|
Config::set('config', 'hostname', 'localhost');
|
||||||
|
|
|
@ -2,19 +2,25 @@
|
||||||
|
|
||||||
namespace Friendica\Test\Database;
|
namespace Friendica\Test\Database;
|
||||||
|
|
||||||
use Friendica\BaseObject;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Database\DBStructure;
|
use Friendica\Database\DBStructure;
|
||||||
|
use Friendica\Factory;
|
||||||
use Friendica\Test\DatabaseTest;
|
use Friendica\Test\DatabaseTest;
|
||||||
|
use Friendica\Util\BasePath;
|
||||||
|
|
||||||
class DBStructureTest extends DatabaseTest
|
class DBStructureTest extends DatabaseTest
|
||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
$basedir = BasePath::create(dirname(__DIR__) . '/../../');
|
||||||
|
$configLoader = new Config\ConfigCacheLoader($basedir);
|
||||||
|
$config = Factory\ConfigFactory::createCache($configLoader);
|
||||||
|
$logger = Factory\LoggerFactory::create('test', $config);
|
||||||
|
$this->app = new App($config, $logger, false);
|
||||||
|
$this->logOutput = FActory\LoggerFactory::enableTest($this->app->getLogger());
|
||||||
|
|
||||||
// Reusable App object
|
parent::setUp();
|
||||||
$this->app = BaseObject::getApp();
|
|
||||||
|
|
||||||
// Default config
|
// Default config
|
||||||
Config::set('config', 'hostname', 'localhost');
|
Config::set('config', 'hostname', 'localhost');
|
||||||
|
|
Loading…
Reference in a new issue