/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/TestModuleOverrideConfig/MagentoDataFixture/RemoveFixtureTest.php
85 строк
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\MagentoDataFixture; use Magento\TestModuleOverrideConfig\AbstractOverridesTest; use Magento\TestModuleOverrideConfig\Model\FixtureCallStorage; use PHPUnit\Framework\Attributes\DataProvider; /** * Checks that magentoDataFixture can be removed using override config * * @magentoAppIsolation enabled */ class RemoveFixtureTest extends AbstractOverridesTest { /** @var FixtureCallStorage */ private $fixtureCallStorage; /** * @inheritdoc */ protected function setUp(): void { parent::setUp(); // phpstan:ignore "Class Magento\TestModuleOverrideConfig\Model\FixtureCallStorage not found." $this->fixtureCallStorage = $this->objectManager->get(FixtureCallStorage::class); } /** * Checks that fixture can be removed in test class node * * @magentoDataFixture Magento/TestModuleOverrideConfig/_files/fixture1_first_module.php * * @return void */ public function testRemoveFixtureForClass(): void { $this->assertEmpty($this->fixtureCallStorage->getFixturesCount('fixture1_first_module.php')); } /** * Checks that fixture can be removed in method and data set nodes * * @magentoDataFixture Magento/TestModuleOverrideConfig/_files/fixture2_first_module.php * @magentoDataFixture Magento/TestModuleOverrideConfig/_files/fixture3_first_module.php * * @param string $fixtureName * @return void */ #[DataProvider('datasetDataProvider')] public function testRemoveFixtureForMethod(string $fixtureName): void { $this->assertEmpty($this->fixtureCallStorage->getFixturesCount($fixtureName)); } /** * @return array */ public static function datasetDataProvider(): array { return [ 'first_data_set' => ['fixture2_first_module.php'], 'second_data_set' => ['fixture3_first_module.php'], ]; } /** * Checks that same fixtures can be removed few times * * @magentoDataFixture Magento/TestModuleOverrideConfig/_files/fixture2_first_module.php * @magentoDataFixture Magento/TestModuleOverrideConfig/_files/fixture2_first_module.php * * @return void */ public function testRemoveSameFixtures(): void { $this->assertEmpty($this->fixtureCallStorage->getFixturesCount('fixture3_first_module.php')); } }