]> git.mxchange.org Git - friendica.git/blob - tests/src/BaseObjectTest.php
Merge pull request #7000 from MrPetovan/task/6999-no-probe-magic-link
[friendica.git] / tests / src / BaseObjectTest.php
1 <?php
2 /**
3  * BaseObjectTest class.
4  */
5
6 namespace Friendica\Test\src;
7
8 use Friendica\BaseObject;
9 use Friendica\Test\Util\AppMockTrait;
10 use Friendica\Test\Util\VFSTrait;
11 use PHPUnit\Framework\TestCase;
12
13 /**
14  * Tests for the BaseObject class.
15  */
16 class BaseObjectTest extends TestCase
17 {
18         use VFSTrait;
19         use AppMockTrait;
20
21         /**
22          * @var BaseObject
23          */
24         private $baseObject;
25
26         /**
27          * Test the setApp() and getApp() function.
28          * @return void
29          */
30         public function testGetSetApp()
31         {
32                 $baseObject = new BaseObject();
33                 $this->setUpVfsDir();
34                 $this->mockApp($this->root);
35
36                 $baseObject->setApp($this->app);
37                 $this->assertEquals($this->app, $baseObject->getApp());
38         }
39
40         /**
41          * Test the getApp() function without App
42          * @expectedException Friendica\Network\HTTPException\InternalServerErrorException
43          * @runInSeparateProcess
44          * @preserveGlobalState disabled
45          */
46         public function testGetAppFailed()
47         {
48                 BaseObject::getApp();
49         }
50 }