-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathSchemaValidationTest.php
48 lines (44 loc) · 1.57 KB
/
SchemaValidationTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace tests\verification\Tests;
use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
use ReflectionProperty;
use tests\util\MftfTestCase;
class SchemaValidationTest extends MftfTestCase
{
/**
* Test generation of a test referencing an action group with no arguments
*
* @throws \Exception
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
*/
public function testInvalidTestSchema()
{
$config = MftfApplicationConfig::getConfig();
$property = new ReflectionProperty(MftfApplicationConfig::class, 'debugLevel');
$property->setAccessible(true);
$property->setValue($config, MftfApplicationConfig::LEVEL_DEVELOPER);
$testFile = ['testFile.xml' => "<tests><test name='testName'><annotations>a</annotations></test></tests>"];
$expectedError = TESTS_MODULE_PATH .
DIRECTORY_SEPARATOR .
"TestModule" .
DIRECTORY_SEPARATOR .
"Test" .
DIRECTORY_SEPARATOR .
"testFile.xml";
$this->validateSchemaErrorWithTest($testFile, 'Test', $expectedError);
}
/**
* @inheritdoc
*/
protected function tearDown(): void
{
$config = MftfApplicationConfig::getConfig();
$property = new ReflectionProperty(MftfApplicationConfig::class, 'debugLevel');
$property->setAccessible(true);
$property->setValue($config, MftfApplicationConfig::LEVEL_DEFAULT);
}
}