| Current Path : /home/rtorresani/www/dev/tests/integration/testsuite/Magento/User/Block/Role/Tab/ |
| Current File : //home/rtorresani/www/dev/tests/integration/testsuite/Magento/User/Block/Role/Tab/EditTest.php |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\User\Block\Role\Tab;
/**
* @magentoAppArea adminhtml
*/
class EditTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Magento\User\Block\Role\Tab\Edit
*/
protected $_block;
protected function setUp(): void
{
$roleAdmin = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(\Magento\Authorization\Model\Role::class);
$roleAdmin->load(\Magento\TestFramework\Bootstrap::ADMIN_ROLE_NAME, 'role_name');
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Framework\App\RequestInterface::class
)->setParam(
'rid',
$roleAdmin->getId()
);
$this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\User\Block\Role\Tab\Edit::class
);
}
public function testConstructor()
{
$this->assertNotEmpty($this->_block->getSelectedResources());
$this->assertContains('Magento_Backend::all', $this->_block->getSelectedResources());
}
public function testGetTree()
{
$encodedTree = $this->_block->getTree();
$this->assertNotEmpty($encodedTree);
}
}