Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SaveAndContinueButtonTest.php
Go to the documentation of this file.
1 <?php
7 
9 
10 class SaveAndContinueButtonTest extends \PHPUnit\Framework\TestCase
11 {
15  protected $model;
16 
20  protected $urlBuilderMock;
21 
25  protected $registryMock;
26 
27  protected function setUp()
28  {
29  $this->urlBuilderMock = $this->createMock(\Magento\Framework\UrlInterface::class);
30  $this->registryMock = $this->createMock(\Magento\Framework\Registry::class);
31  $contextMock = $this->createMock(\Magento\Backend\Block\Widget\Context::class);
32 
33  $contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($this->urlBuilderMock);
34 
35  $this->model = (new ObjectManager($this))->getObject(
36  \Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\SaveAndContinueButton::class,
37  [
38  'context' => $contextMock,
39  'registry' => $this->registryMock
40  ]
41  );
42  }
43 
44  public function testGetButtonData()
45  {
46  $data = [
47  'label' => __('Save and Continue Edit'),
48  'class' => 'save',
49  'on_click' => '',
50  'sort_order' => 90,
51  ];
52 
53  $this->assertEquals($data, $this->model->getButtonData());
54  }
55 }
__()
Definition: __.php:13