Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
757B

  1. <?php
  2. /**
  3. * BaseObjectTest class.
  4. */
  5. namespace Friendica\Test;
  6. use Friendica\App;
  7. use Friendica\BaseObject;
  8. use PHPUnit\Framework\TestCase;
  9. /**
  10. * Tests for the BaseObject class.
  11. */
  12. class BaseObjectTest extends TestCase
  13. {
  14. /**
  15. * Create variables used in tests.
  16. */
  17. protected function setUp()
  18. {
  19. $this->baseObject = new BaseObject();
  20. }
  21. /**
  22. * Test the getApp() function.
  23. * @return void
  24. */
  25. public function testGetApp()
  26. {
  27. $this->assertInstanceOf(App::class, $this->baseObject->getApp());
  28. }
  29. /**
  30. * Test the setApp() function.
  31. * @return void
  32. */
  33. public function testSetApp()
  34. {
  35. $app = new App(__DIR__.'/../');
  36. $this->assertNull($this->baseObject->setApp($app));
  37. $this->assertEquals($app, $this->baseObject->getApp());
  38. }
  39. }