/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/TestModuleOverrideConfig/MagentoAdminConfigFixture/RemoveFixtureTest.php
88 строк
2 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 2020 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\TestModuleOverrideConfig\MagentoAdminConfigFixture; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\TestModuleOverrideConfig\AbstractOverridesTest; use PHPUnit\Framework\Attributes\DataProvider; /** * Class checks that magentoAdminConfigFixtures can be removed using override config * * @magentoAppIsolation enabled */ class RemoveFixtureTest extends AbstractOverridesTest { /** @var ScopeConfigInterface */ private $config; /** * @inheritdoc */ protected function setUp(): void { parent::setUp(); $this->config = $this->objectManager->get(ScopeConfigInterface::class); } /** * Checks that fixture can be removed in test class node * * @magentoAdminConfigFixture test_section/test_group/field_1 new_value * * @return void */ public function testRemoveFixtureForClass(): void { $value = $this->config->getValue('test_section/test_group/field_1', ScopeConfigInterface::SCOPE_TYPE_DEFAULT); $this->assertEquals('1st field default value', $value); } /** * Checks that fixtures can be removed in method and data set nodes * * @magentoAdminConfigFixture test_section/test_group/field_2 new_value * @magentoAdminConfigFixture test_section/test_group/field_3 new_value * * @param string $expectedFirstValue * @param string $expectedSecondValue * @return void */ #[DataProvider('datasetDataProvider')] public function testRemoveFixtureForMethod(string $expectedFirstValue, string $expectedSecondValue): void { $fistValue = $this->config->getValue( 'test_section/test_group/field_2', ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); $secondValue = $this->config->getValue( 'test_section/test_group/field_3', ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); $this->assertEquals($expectedFirstValue, $fistValue); $this->assertEquals($expectedSecondValue, $secondValue); } /** * @return array */ public static function datasetDataProvider(): array { return [ 'first_data_set' => [ '2nd field default value', 'new_value', ], 'second_data_set' => [ '2nd field default value', '3rd field default value', ], ]; } }