/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Catalog/DbSchemaTest.php
52 строки
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 2023 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Catalog; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Adapter\AdapterInterface; use Monolog\Test\TestCase; use PHPUnit\Framework\Attributes\DataProvider; class DbSchemaTest extends TestCase { /** * @param string $tableName * @param string $indexName * @param array $columns * @param string $indexType * @return void */ #[DataProvider('indexDataProvider')] public function testIndex( string $tableName, string $indexName, array $columns, string $indexType = AdapterInterface::INDEX_TYPE_INDEX, ): void { $connection = ObjectManager::getInstance()->get(ResourceConnection::class)->getConnection(); $indexes = $connection->getIndexList($tableName); $this->assertArrayHasKey($indexName, $indexes); $this->assertSame($columns, $indexes[$indexName]['COLUMNS_LIST']); $this->assertSame($indexType, $indexes[$indexName]['INDEX_TYPE']); } /** * @return array[] */ public static function indexDataProvider(): array { return [ [ 'catalog_product_index_price_tmp', 'CAT_PRD_IDX_PRICE_TMP_ENTT_ID_CSTR_GROUP_ID_WS_ID', ['entity_id', 'customer_group_id', 'website_id'] ] ]; } }