]> git.mxchange.org Git - friendica.git/blob - tests/src/BaseObjectTest.php
Bugfixing AutomaticInstallation test
[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                 $configMock = \Mockery::mock('Friendica\Core\Config\ConfigCache');
36                 $this->mockApp($this->root, $configMock);
37
38                 $this->baseObject = new BaseObject();
39         }
40
41         /**
42          * Test the getApp() function.
43          * @return void
44          */
45         public function testGetApp()
46         {
47                 $this->assertInstanceOf(App::class, $this->baseObject->getApp());
48         }
49
50         /**
51          * Test the setApp() function.
52          * @return void
53          */
54         public function testSetApp()
55         {
56                 $this->assertNull($this->baseObject->setApp($this->app));
57                 $this->assertEquals($this->app, $this->baseObject->getApp());
58         }
59 }