SynonymGroupTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Search\Test\Unit\Model;
  7. class SynonymGroupTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Search\Model\SynonymGroup
  11. */
  12. private $model;
  13. public function setUp()
  14. {
  15. $this->model = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))
  16. ->getObject(\Magento\Search\Model\SynonymGroup::class);
  17. }
  18. public function testSetGetStoreId()
  19. {
  20. $this->assertEquals(0, $this->model->getStoreId());
  21. $this->assertEquals($this->model, $this->model->setStoreId(1));
  22. $this->assertEquals(1, $this->model->getStoreId());
  23. }
  24. public function testSetGetWebsiteId()
  25. {
  26. $this->assertEquals(0, $this->model->getWebsiteId());
  27. $this->assertEquals($this->model, $this->model->setWebsiteId(1));
  28. $this->assertEquals(1, $this->model->getWebsiteId());
  29. }
  30. public function testSetGetSynonymGroup()
  31. {
  32. $this->assertEquals($this->model, $this->model->setSynonymGroup('a,b,c'));
  33. $this->assertEquals('a,b,c', $this->model->getSynonymGroup());
  34. }
  35. public function testSetGetGroupId()
  36. {
  37. $this->assertEquals($this->model, $this->model->setGroupId(1));
  38. $this->assertEquals(1, $this->model->getGroupId());
  39. }
  40. }