Introduce new DI container
- Adding Friendica\DI class for getting dynamic classes - Replacing BaseObject::getApp() with this class
This commit is contained in:
parent
a9220aa83b
commit
1de3f186d7
132 changed files with 377 additions and 270 deletions
|
@ -15,6 +15,7 @@ use Friendica\Core\Session;
|
|||
use Friendica\Core\Session\ISession;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Test\Util\Database\StaticDatabase;
|
||||
|
@ -87,7 +88,7 @@ class ApiTest extends DatabaseTest
|
|||
$this->loadFixture(__DIR__ . '/../datasets/api.fixture.php', $dba);
|
||||
|
||||
/** @var App app */
|
||||
$this->app = BaseObject::getApp();
|
||||
$this->app = DI::app();
|
||||
|
||||
$this->app->argc = 1;
|
||||
$this->app->argv = ['home'];
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* BaseObjectTest class.
|
||||
*/
|
||||
|
||||
namespace Friendica\Test\src;
|
||||
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Test\Util\AppMockTrait;
|
||||
use Friendica\Test\Util\VFSTrait;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Tests for the BaseObject class.
|
||||
*/
|
||||
class BaseObjectTest extends TestCase
|
||||
{
|
||||
use VFSTrait;
|
||||
use AppMockTrait;
|
||||
|
||||
/**
|
||||
* @var BaseObject
|
||||
*/
|
||||
private $baseObject;
|
||||
|
||||
/**
|
||||
* Test the getApp() function without App
|
||||
* @expectedException Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
public function testGetAppFailed()
|
||||
{
|
||||
BaseObject::getApp();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue