* BaseObjectTest class.
*/
-namespace Friendica\Test;
+namespace Friendica\Test\src;
-use Friendica\App;
use Friendica\BaseObject;
use Friendica\Test\Util\AppMockTrait;
use Friendica\Test\Util\VFSTrait;
/**
* Tests for the BaseObject class.
- * @runTestsInSeparateProcesses
- * @preserveGlobalState disabled
*/
class BaseObjectTest extends TestCase
{
private $baseObject;
/**
- * Create variables used in tests.
+ * Test the getApp() function without App
+ * @expectedException Friendica\Network\HTTPException\InternalServerErrorException
+ * @runInSeparateProcess
+ * @preserveGlobalState disabled
*/
- protected function setUp()
+ public function testGetAppFailed()
{
- $this->setUpVfsDir();
- $configMock = \Mockery::mock('Friendica\Core\Config\ConfigCache');
- $this->mockApp($this->root, $configMock);
-
- $this->baseObject = new BaseObject();
- }
-
- /**
- * Test the getApp() function.
- * @return void
- */
- public function testGetApp()
- {
- $this->assertInstanceOf(App::class, $this->baseObject->getApp());
- }
-
- /**
- * Test the setApp() function.
- * @return void
- */
- public function testSetApp()
- {
- $this->assertNull($this->baseObject->setApp($this->app));
- $this->assertEquals($this->app, $this->baseObject->getApp());
+ BaseObject::getApp();
}
}