TermsTest.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. declare(strict_types=1);
  3. namespace Meramo\Chatbotui\Tests\Unit\Domain\Model;
  4. use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
  5. /**
  6. * Test case
  7. *
  8. * @author Meramo Developer <develop@meramo.de>
  9. */
  10. class TermsTest extends UnitTestCase
  11. {
  12. /**
  13. * @var \Meramo\Chatbotui\Domain\Model\Terms
  14. */
  15. protected $subject;
  16. protected function setUp()
  17. {
  18. parent::setUp();
  19. $this->subject = new \Meramo\Chatbotui\Domain\Model\Terms();
  20. }
  21. protected function tearDown()
  22. {
  23. parent::tearDown();
  24. }
  25. /**
  26. * @test
  27. */
  28. public function getTypeReturnsInitialValueForType()
  29. {
  30. self::assertEquals(
  31. null,
  32. $this->subject->getType()
  33. );
  34. }
  35. /**
  36. * @test
  37. */
  38. public function setTypeForTypeSetsType()
  39. {
  40. $typeFixture = new \Meramo\Chatbotui\Domain\Model\Type();
  41. $this->subject->setType($typeFixture);
  42. self::assertAttributeEquals(
  43. $typeFixture,
  44. 'type',
  45. $this->subject
  46. );
  47. }
  48. /**
  49. * @test
  50. */
  51. public function getCategoryReturnsInitialValueForCategory()
  52. {
  53. self::assertEquals(
  54. null,
  55. $this->subject->getCategory()
  56. );
  57. }
  58. /**
  59. * @test
  60. */
  61. public function setCategoryForCategorySetsCategory()
  62. {
  63. $categoryFixture = new \Meramo\Chatbotui\Domain\Model\Category();
  64. $this->subject->setCategory($categoryFixture);
  65. self::assertAttributeEquals(
  66. $categoryFixture,
  67. 'category',
  68. $this->subject
  69. );
  70. }
  71. /**
  72. * @test
  73. */
  74. public function getUrlReturnsInitialValueForUrl()
  75. {
  76. self::assertEquals(
  77. null,
  78. $this->subject->getUrl()
  79. );
  80. }
  81. /**
  82. * @test
  83. */
  84. public function setUrlForUrlSetsUrl()
  85. {
  86. $urlFixture = new \Meramo\Chatbotui\Domain\Model\Url();
  87. $this->subject->setUrl($urlFixture);
  88. self::assertAttributeEquals(
  89. $urlFixture,
  90. 'url',
  91. $this->subject
  92. );
  93. }
  94. }