MergedGenerationTest.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace tests\verification\Tests;
  7. use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
  8. use tests\util\MftfTestCase;
  9. class MergedGenerationTest extends MftfTestCase
  10. {
  11. /**
  12. * Tests generation of a test merge file with no external references.
  13. *
  14. * @throws \Exception
  15. * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
  16. */
  17. public function testMergeGeneration()
  18. {
  19. $this->generateAndCompareTest('BasicMergeTest');
  20. }
  21. /**
  22. * Tests generation of a test merge file with only external references.
  23. *
  24. * @throws \Exception
  25. * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
  26. */
  27. public function testMergedReferences()
  28. {
  29. $this->generateAndCompareTest('MergedReferencesTest');
  30. }
  31. /**
  32. * Tests the merging of requiredEntity elements in Data, MQE-838
  33. */
  34. public function testParsedArray()
  35. {
  36. $entity = DataObjectHandler::getInstance()->getObject('testEntity');
  37. $this->assertCount(3, $entity->getLinkedEntities());
  38. }
  39. /**
  40. * Tests generation of a test merge file via insertBefore
  41. *
  42. * @throws \Exception
  43. * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
  44. */
  45. public function testMergeMassViaInsertBefore()
  46. {
  47. $this->generateAndCompareTest('MergeMassViaInsertBefore');
  48. }
  49. /**
  50. * Tests generation of a test merge file via insertBefore
  51. *
  52. * @throws \Exception
  53. * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
  54. */
  55. public function testMergeMassViaInsertAfter()
  56. {
  57. $this->generateAndCompareTest('MergeMassViaInsertAfter');
  58. }
  59. /**
  60. * Tests generation of a test skipped in merge.
  61. *
  62. * @throws \Exception
  63. * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
  64. */
  65. public function testMergeSkipGeneration()
  66. {
  67. $this->generateAndCompareTest('MergeSkip');
  68. }
  69. }