Beispiel #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->assertInstanceOf('Magento\\Framework\\Phrase', $this->this->getHeaderText());
 }
Beispiel #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->assertInternalType('string', $this->this->getHeaderText());
 }