/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Cache/Test/Unit/ConfigTest.php
64 строки
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\Cache\Test\Unit; use Magento\Framework\Cache\Config; use Magento\Framework\Cache\Config\Data; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class ConfigTest extends TestCase { /** * @var Data|MockObject */ protected $_storage; /** * @var MockObject|Config */ protected $_model; protected function setUp(): void { $this->_storage = $this->createPartialMock(Data::class, ['get']); $this->_model = new Config($this->_storage); } public function testGetTypes() { $this->_storage->expects( $this->once() )->method( 'get' )->with( 'types', [] )->willReturn( ['val1', 'val2'] ); $result = $this->_model->getTypes(); $this->assertCount(2, $result); } public function testGetType() { $this->_storage->expects( $this->once() )->method( 'get' )->with( 'types/someType', [] )->willReturn( ['someTypeValue'] ); $result = $this->_model->getType('someType'); $this->assertCount(1, $result); } }