friendica/tests/src/BaseObjectTest.php
Philipp Holzer f5adbd268b
Fixing tests
2019-02-17 21:41:45 +01:00

51 lines
983 B
PHP

<?php
/**
* BaseObjectTest class.
*/
namespace Friendica\Test;
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 setApp() and getApp() function.
* @return void
*/
public function testGetSetApp()
{
$baseObject = new BaseObject();
$this->setUpVfsDir();
$this->mockApp($this->root);
$this->assertNull($baseObject->setApp($this->app));
$this->assertEquals($this->app, $baseObject->getApp());
}
/**
* Test the getApp() function without App
* @expectedException Friendica\Network\HTTPException\InternalServerErrorException
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function testGetAppFailed()
{
$baseObject = new BaseObject();
$baseObject->getApp();
}
}