/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/EntityManager/Test/Unit/OperationPoolTest.php
50 строк
1 KB
Manish Ranjan
AC-16248: PHPUnit 12 Upgrade | Fix Framework unit tests
09 янв 2026, 19:35
09 янв 2026, 19:35
de6cafc
Код
Авторство
О чём код?
<?php /** * Copyright 2017 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\EntityManager\Test\Unit; use Magento\Framework\EntityManager\Operation\Read; use Magento\Framework\EntityManager\OperationPool; use Magento\Framework\ObjectManagerInterface; use PHPUnit\Framework\TestCase; class OperationPoolTest extends TestCase { public function testGetOperationUsesDefaultValueForEntityThatDoesNotProvideCustomMapping() { $objectManagerMock = $this->createMock(ObjectManagerInterface::class); $operationPool = new OperationPool( $objectManagerMock, [] ); $objectManagerMock->expects($this->once()) ->method('get') ->with(Read::class); $operationPool->getOperation('entity_type', 'read'); } public function testGetOperationUsesOverriddenDefaultValueForEntityThatDoesNotProvideCustomMapping() { $customReadOperation = 'CustomReadOperation'; $objectManagerMock = $this->createMock(ObjectManagerInterface::class); $operationPool = new OperationPool( $objectManagerMock, [ 'default' => [ 'read' => $customReadOperation, 'new' => 'CustomNewOperation', ], ] ); $objectManagerMock->expects($this->once()) ->method('get') ->with($customReadOperation); $operationPool->getOperation('entity_type', 'read'); } }