![]() 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/dev/tests/integration/testsuite/Magento/Setup/Model/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Setup\Model; use Magento\Framework\ObjectManagerInterface; use Magento\Setup\Mvc\Bootstrap\InitParamListener; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Console\Application; use Laminas\ServiceManager\ServiceLocatorInterface; /** * Tests ObjectManagerProvider */ class ObjectManagerProviderTest extends TestCase { /** * @var ObjectManagerProvider */ private $object; /** * @var ServiceLocatorInterface|PHPUnit\Framework\MockObject\MockObject */ private $locator; /** * @inheritDoc */ protected function setUp(): void { $this->locator = $this->getMockForAbstractClass(ServiceLocatorInterface::class); $this->object = new ObjectManagerProvider($this->locator, new Bootstrap()); $this->locator->expects($this->any()) ->method('get') ->willReturnMap( [ [InitParamListener::BOOTSTRAP_PARAM, []], [Application::class, $this->getMockForAbstractClass(Application::class)], ] ); } /** * Tests the same instance of ObjectManagerInterface should be provided by the ObjectManagerProvider */ public function testGet() { $objectManager = $this->object->get(); $this->assertInstanceOf(ObjectManagerInterface::class, $objectManager); $this->assertSame($objectManager, $this->object->get()); } }