]> git.mxchange.org Git - friendica.git/blob - tests/BaseObjectTest.php
Merge pull request #4917 from annando/show-private-forums
[friendica.git] / tests / BaseObjectTest.php
1 <?php
2 /**
3  * BaseObjectTest class.
4  */
5
6 namespace Friendica\Test;
7
8 use Friendica\App;
9 use Friendica\BaseObject;
10 // backward compatibility
11 if (!class_exists('\PHPUnit\Framework\TestCase')) {
12     class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
13 }
14 /**
15  * Tests for the BaseObject class.
16  */
17 class BaseObjectTest extends \PHPUnit\Framework\TestCase
18 {
19
20         /**
21          * Create variables used in tests.
22          */
23         protected function setUp()
24         {
25                 $this->baseObject = new BaseObject();
26         }
27
28         /**
29          * Test the getApp() function.
30          * @return void
31          */
32         public function testGetApp()
33         {
34                 $this->assertInstanceOf(App::class, $this->baseObject->getApp());
35         }
36
37         /**
38          * Test the setApp() function.
39          * @return void
40          */
41         public function testSetApp()
42         {
43                 $app = new App(__DIR__.'/../');
44                 $this->assertNull($this->baseObject->setApp($app));
45                 $this->assertEquals($app, $this->baseObject->getApp());
46         }
47 }