![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/framework/Event/Test/Unit/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Framework\Event\Test\Unit; use Magento\Framework\Event\Config; use Magento\Framework\Event\Config\Data; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class ConfigTest extends TestCase { /** * @var Data|MockObject */ protected $dataContainerMock; /** * @var Config */ protected $config; protected function setUp(): void { $this->dataContainerMock = $this->createPartialMock(Data::class, ['get']); $this->config = new Config($this->dataContainerMock); } public function testGetObservers() { $eventName = 'some_event'; $observers = ['observer1', 'observer3']; $this->dataContainerMock->expects($this->once()) ->method('get') ->with($eventName, []) ->willReturn($observers); $result = $this->config->getObservers($eventName); $this->assertEquals($observers, $result); } }