3 * BaseObjectTest class.
6 namespace Friendica\Test;
9 use Friendica\BaseObject;
10 use Friendica\Test\Util\AppMockTrait;
11 use Friendica\Test\Util\VFSTrait;
12 use PHPUnit\Framework\TestCase;
15 * Tests for the BaseObject class.
16 * @runTestsInSeparateProcesses
17 * @preserveGlobalState disabled
19 class BaseObjectTest extends TestCase
30 * Create variables used in tests.
32 protected function setUp()
34 $this->baseObject = new BaseObject();
38 * Test the getApp() function.
41 public function testGetApp()
44 $configMock = \Mockery::mock('Friendica\Core\Config\ConfigCache');
45 $this->mockApp($this->root, $configMock);
47 $this->assertInstanceOf(App::class, $this->baseObject->getApp());
51 * Test the setApp() function.
54 public function testSetApp()
57 $configMock = \Mockery::mock('Friendica\Core\Config\ConfigCache');
58 $this->mockApp($this->root, $configMock);
60 $this->assertNull($this->baseObject->setApp($this->app));
61 $this->assertEquals($this->app, $this->baseObject->getApp());
65 * Test the getApp() function without App
66 * @expectedException Friendica\Network\HTTPException\InternalServerErrorException
68 public function testGetAppFailed()