StructureTest.php 960 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Migration\ResourceModel;
  7. class StructureTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Migration\ResourceModel\Structure
  11. */
  12. protected $structure;
  13. /**
  14. * @return void
  15. */
  16. protected function setUp()
  17. {
  18. $this->structure = new \Migration\ResourceModel\Structure(['id' => 'int', 'name' => 'varchar']);
  19. }
  20. /**
  21. * @return void
  22. */
  23. public function testGetFields()
  24. {
  25. $this->assertEquals(['id' => 'int', 'name' => 'varchar'], $this->structure->getFields());
  26. }
  27. /**
  28. * @return void
  29. */
  30. public function testHasField()
  31. {
  32. $this->assertTrue($this->structure->hasField('name'));
  33. }
  34. /**
  35. * @return void
  36. */
  37. public function testNotHasField()
  38. {
  39. $this->assertFalse($this->structure->hasField('new_name'));
  40. }
  41. }