]> git.mxchange.org Git - friendica.git/blob - tests/src/BaseObjectTest.php
Merge pull request #6589 from rabuzarus/20190204_-_show_forum_account_in_vcard
[friendica.git] / tests / src / BaseObjectTest.php
1 <?php
2 /**
3  * BaseObjectTest class.
4  */
5
6 namespace Friendica\Test;
7
8 use Friendica\App;
9 use Friendica\BaseObject;
10 use Friendica\Test\Util\AppMockTrait;
11 use Friendica\Test\Util\VFSTrait;
12 use PHPUnit\Framework\TestCase;
13
14 /**
15  * Tests for the BaseObject class.
16  * @runTestsInSeparateProcesses
17  * @preserveGlobalState disabled
18  */
19 class BaseObjectTest extends TestCase
20 {
21         use VFSTrait;
22         use AppMockTrait;
23
24         /**
25          * @var BaseObject
26          */
27         private $baseObject;
28
29         /**
30          * Create variables used in tests.
31          */
32         protected function setUp()
33         {
34                 $this->setUpVfsDir();
35                 $this->mockApp($this->root);
36
37                 $this->baseObject = new BaseObject();
38         }
39
40         /**
41          * Test the getApp() function.
42          * @return void
43          */
44         public function testGetApp()
45         {
46                 $this->assertInstanceOf(App::class, $this->baseObject->getApp());
47         }
48
49         /**
50          * Test the setApp() function.
51          * @return void
52          */
53         public function testSetApp()
54         {
55                 $this->assertNull($this->baseObject->setApp($this->app));
56                 $this->assertEquals($this->app, $this->baseObject->getApp());
57         }
58 }