SchemaValidationTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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\Config\MftfApplicationConfig;
  8. use tests\util\MftfTestCase;
  9. use AspectMock\Test as AspectMock;
  10. class SchemaValidationTest extends MftfTestCase
  11. {
  12. /**
  13. * Test generation of a test referencing an action group with no arguments
  14. *
  15. * @throws \Exception
  16. * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
  17. */
  18. public function testInvalidTestSchema()
  19. {
  20. AspectMock::double(MftfApplicationConfig::class, ['debugEnabled' => true]);
  21. $testFile = ['testFile.xml' => "<tests><test name='testName'><annotations>a</annotations></test></tests>"];
  22. $expectedError = TESTS_MODULE_PATH .
  23. DIRECTORY_SEPARATOR .
  24. "TestModule" .
  25. DIRECTORY_SEPARATOR .
  26. "Test" .
  27. DIRECTORY_SEPARATOR .
  28. "testFile.xml";
  29. $this->validateSchemaErrorWithTest($testFile, 'Test', $expectedError);
  30. }
  31. /**
  32. * After method functionality
  33. * @return void
  34. */
  35. protected function tearDown()
  36. {
  37. AspectMock::clean();
  38. }
  39. }