![]() 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/cartforge.co/vendor/magento/module-media-gallery-ui/Test/Unit/Model/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\MediaGalleryUi\Test\Unit\Model; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\MediaGalleryUi\Model\Config; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; /** * Config data test. */ class ConfigTest extends TestCase { private const XML_PATH_ENABLED = 'system/media_gallery/enabled'; /** * @var ObjectManager */ private $objectManager; /** * @var Config */ private $config; /** * @var ScopeConfigInterface|MockObject */ private $scopeConfigMock; /** * Prepare test objects. */ protected function setUp(): void { $this->objectManager = new ObjectManager($this); $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); $this->config = $this->objectManager->getObject( Config::class, [ 'scopeConfig' => $this->scopeConfigMock ] ); } /** * Get Magento media gallery enabled test. */ public function testIsEnabled(): void { $this->scopeConfigMock->expects($this->once()) ->method('isSetFlag') ->with(self::XML_PATH_ENABLED) ->willReturn(true); $this->assertEquals(true, $this->config->isEnabled()); } }