]> git.mxchange.org Git - friendica.git/blob - tests/BaseObjectTest.php
phpunit compat 5.6 vs 7.x
[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 use \PHPUnit_Framework_TestCase;
15 /**
16  * Tests for the BaseObject class.
17  */
18 class BaseObjectTest extends \PHPUnit\Framework\TestCase
19 {
20
21         /**
22          * Create variables used in tests.
23          */
24         protected function setUp()
25         {
26                 $this->baseObject = new BaseObject();
27         }
28
29         /**
30          * Test the getApp() function.
31          * @return void
32          */
33         public function testGetApp()
34         {
35                 $this->assertInstanceOf(App::class, $this->baseObject->getApp());
36         }
37
38         /**
39          * Test the setApp() function.
40          * @return void
41          */
42         public function testSetApp()
43         {
44                 $app = new App(__DIR__.'/../');
45                 $this->assertNull($this->baseObject->setApp($app));
46                 $this->assertEquals($app, $this->baseObject->getApp());
47         }
48 }