Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SchemaValidationTest.php
Go to the documentation of this file.
1 <?php
7 
10 use AspectMock\Test as AspectMock;
11 
13 {
20  public function testInvalidTestSchema()
21  {
22  AspectMock::double(MftfApplicationConfig::class, ['debugEnabled' => true]);
23  $testFile = ['testFile.xml' => "<tests><test name='testName'><annotations>a</annotations></test></tests>"];
24  $expectedError = TESTS_MODULE_PATH .
25  DIRECTORY_SEPARATOR .
26  "TestModule" .
27  DIRECTORY_SEPARATOR .
28  "Test" .
29  DIRECTORY_SEPARATOR .
30  "testFile.xml";
31  $this->validateSchemaErrorWithTest($testFile, 'Test', $expectedError);
32  }
33 
38  protected function tearDown()
39  {
40  AspectMock::clean();
41  }
42 }
validateSchemaErrorWithTest($fileContents, $objectType, $expectedError)