1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Ui\Test\Unit\Component\Control;
use Magento\Ui\Component\Control\Action;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
/**
* Class ActionTest
*/
class ActionTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Action
*/
protected $action;
/**
* @var ObjectManager
*/
protected $objectManager;
/**
* Set up
*/
protected function setUp()
{
$context = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\ContextInterface::class)
->getMockForAbstractClass();
$processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class)
->disableOriginalConstructor()
->getMock();
$context->expects($this->never())->method('getProcessor')->willReturn($processor);
$this->objectManager = new ObjectManager($this);
$this->action = $this->objectManager->getObject(
\Magento\Ui\Component\Control\Action::class,
['context' => $context]
);
}
/**
* Run test getComponentName method
*
* @return void
*/
public function testGetComponentName()
{
$this->assertTrue($this->action->getComponentName() === Action::NAME);
}
}