Exemplo n.º 1
0
 /**
  * @covers \Magento\Cms\Block\Adminhtml\Block\Edit::getHeaderText
  * @param integer|null $modelBlockId
  *
  * @dataProvider getHeaderTextDataProvider
  */
 public function testGetHeaderText($modelBlockId)
 {
     $title = 'some title';
     $escapedTitle = 'escaped title';
     $this->registryMock->expects($this->atLeastOnce())->method('registry')->with('cms_block')->willReturn($this->modelBlockMock);
     $this->modelBlockMock->expects($this->atLeastOnce())->method('getId')->willReturn($modelBlockId);
     $this->modelBlockMock->expects($this->any())->method('getTitle')->willReturn($title);
     $this->escaperMock->expects($this->any())->method('escapeHtml')->with($title)->willReturn($escapedTitle);
     $this->assertInternalType('string', $this->this->getHeaderText());
 }
Exemplo n.º 2
0
 /**
  * @covers \Magento\Cms\Block\Adminhtml\Block\Edit::getHeaderText
  * @param integer|null $modelBlockId
  *
  * @dataProvider getHeaderTextDataProvider
  */
 public function testGetHeaderText($modelBlockId)
 {
     $title = 'some title';
     $escapedTitle = 'escaped title';
     $this->registryMock->expects($this->atLeastOnce())->method('registry')->with('cms_block')->willReturn($this->modelBlockMock);
     $this->modelBlockMock->expects($this->atLeastOnce())->method('getId')->willReturn($modelBlockId);
     $this->modelBlockMock->expects($this->any())->method('getTitle')->willReturn($title);
     $this->escaperMock->expects($this->any())->method('escapeHtml')->with($title)->willReturn($escapedTitle);
     $this->assertInstanceOf('Magento\\Framework\\Phrase', $this->this->getHeaderText());
 }
Exemplo n.º 3
0
 protected function _construct()
 {
     parent::_construct();
     $this->buttonList->add('Duplicate', ['label' => __('Duplicate'), 'onclick' => 'test']);
 }