3 * BaseObjectTest class.
6 namespace Friendica\Test;
8 use Friendica\BaseObject;
9 use Friendica\Test\Util\AppMockTrait;
10 use Friendica\Test\Util\VFSTrait;
11 use PHPUnit\Framework\TestCase;
14 * Tests for the BaseObject class.
16 class BaseObjectTest extends TestCase
27 * Test the setApp() and getApp() function.
30 public function testGetSetApp()
32 $baseObject = new BaseObject();
34 $configMock = \Mockery::mock('Friendica\Core\Config\Configuration');
35 $this->mockApp($this->root, $configMock);
37 $this->assertNull($baseObject->setApp($this->app));
38 $this->assertEquals($this->app, $baseObject->getApp());
42 * Test the getApp() function without App
43 * @expectedException Friendica\Network\HTTPException\InternalServerErrorException
44 * @runInSeparateProcess
45 * @preserveGlobalState disabled
47 public function testGetAppFailed()
49 $baseObject = new BaseObject();
50 $baseObject->getApp();