FieldsetTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Ui\Test\Unit\Component\Form;
  8. use Magento\Ui\Component\Form\Fieldset;
  9. use Magento\Framework\View\Element\UiComponent\ContextInterface;
  10. /**
  11. * Class FieldTest
  12. *
  13. * Test for class \Magento\Ui\Component\Form\Fieldset
  14. */
  15. class FieldsetTest extends \PHPUnit\Framework\TestCase
  16. {
  17. const NAME = 'fieldset';
  18. /**
  19. * @var Fieldset
  20. */
  21. protected $fieldset;
  22. /**
  23. * @var ContextInterface|\PHPUnit_Framework_MockObject_MockObject
  24. */
  25. private $context;
  26. /**
  27. * Set up
  28. *
  29. * @return void
  30. */
  31. protected function setUp()
  32. {
  33. $this->context = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\ContextInterface::class)
  34. ->getMockForAbstractClass();
  35. $this->fieldset = new Fieldset(
  36. $this->context,
  37. [],
  38. []
  39. );
  40. }
  41. /**
  42. * Run test for getComponentName() method
  43. *
  44. * @return void
  45. *
  46. */
  47. public function testGetComponentName()
  48. {
  49. $this->assertEquals(self::NAME, $this->fieldset->getComponentName());
  50. }
  51. }