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.

48 lines
841B

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