/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EventConfigFilesTest.php
49 строк
1 KB
Raj Mohan R
AC-16236::Upgrade Core Test Framework to PHPUnit 12 and Migrate from PHPUnit 10
11 фев 2026, 13:51
11 фев 2026, 13:51
152ed41
Код
Авторство
О чём код?
<?php /** * Copyright 2013 Adobe * All Rights Reserved. */ namespace Magento\Test\Integrity\Modular; use PHPUnit\Framework\Attributes\DataProvider; class EventConfigFilesTest extends \PHPUnit\Framework\TestCase { /** * @var string */ protected $_schemaFile; protected function setUp(): void { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_schemaFile = $objectManager->get(\Magento\Framework\Event\Config\SchemaLocator::class)->getSchema(); } /** * @param string $file */ #[DataProvider('eventConfigFilesDataProvider')] public function testEventConfigFiles($file) { $errors = []; $validationStateMock = $this->createMock(\Magento\Framework\Config\ValidationStateInterface::class); $validationStateMock->method('isValidationRequired') ->willReturn(true); $dom = new \Magento\Framework\Config\Dom(file_get_contents($file), $validationStateMock); $result = $dom->validate($this->_schemaFile, $errors); $message = "Invalid XML-file: {$file}\n"; foreach ($errors as $error) { $message .= "{$error->message} Line: {$error->line}\n"; } $this->assertTrue($result, $message); } /** * @return array */ public static function eventConfigFilesDataProvider() { return \Magento\Framework\App\Utility\Files::init()->getConfigFiles('{*/events.xml,events.xml}'); } }