Example #1
0
 /**
  * @covers \Magento\Email\Block\Adminhtml\Template\Edit\Form::getVariables
  */
 public function testGetVariables()
 {
     $this->variablesMock->expects($this->once())->method('toOptionArray')->willReturn(['var1', 'var2', 'var3']);
     $this->variableFactoryMock->expects($this->once())->method('create')->willReturn($this->variableMock);
     $this->variableMock->expects($this->once())->method('getVariablesOptionArray')->willReturn(['custom var 1', 'custom var 2']);
     $this->registryMock->expects($this->once())->method('registry')->willReturn($this->templateMock);
     $this->templateMock->expects($this->once())->method('getId')->willReturn(1);
     $this->templateMock->expects($this->once())->method('getVariablesOptionArray')->willReturn(['template var 1', 'template var 2']);
     $this->assertEquals([['var1', 'var2', 'var3'], ['custom var 1', 'custom var 2'], ['template var 1', 'template var 2']], $this->form->getVariables());
 }