![]() 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/module-config/Test/Unit/Model/Config/Structure/Element/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Config\Test\Unit\Model\Config\Structure\Element; use Magento\Config\Model\Config\Structure\Element\Iterator\Field; use Magento\Config\Model\Config\Structure\Element\Tab; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class TabTest extends TestCase { /** * @var Tab */ protected $_model; /** * @var MockObject */ protected $_iteratorMock; protected function setUp(): void { $this->_iteratorMock = $this->createMock(Field::class); $this->_model = (new ObjectManager($this))->getObject( Tab::class, ['childrenIterator' => $this->_iteratorMock] ); } protected function tearDown(): void { unset($this->_model); unset($this->_iteratorMock); } public function testIsVisibleOnlyChecksPresenceOfChildren() { $this->_model->setData(['showInStore' => 0, 'showInWebsite' => 0, 'showInDefault' => 0], 'store'); $this->_iteratorMock->expects($this->once())->method('current')->willReturn(true); $this->_iteratorMock->expects($this->once())->method('valid')->willReturn(true); $this->assertTrue($this->_model->isVisible()); } }