本文整理汇总了PHP中Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer::setColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractRenderer::setColumn方法的具体用法?PHP AbstractRenderer::setColumn怎么用?PHP AbstractRenderer::setColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
的用法示例。
在下文中一共展示了AbstractRenderer::setColumn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRender
/**
* @param bool $editable
* @param bool $onlyEdit
* @param string $expectedResult
* @return void
* @dataProvider renderDataProvider
*/
public function testRender($editable, $onlyEdit, $expectedResult)
{
$value = 'some value';
$keyValue = 'key';
$this->columnMock->expects($this->once())->method('getEditable')->willReturn($editable);
$this->columnMock->expects($this->any())->method('getEditOnly')->willReturn($onlyEdit);
$this->columnMock->expects($this->any())->method('getIndex')->willReturn($keyValue);
$this->columnMock->expects($this->any())->method('getId')->willReturn('test');
$this->dataObjectMock->expects($this->any())->method('getData')->with($keyValue)->willReturn($value);
$this->renderer->setColumn($this->columnMock);
$this->assertEquals($expectedResult, $this->renderer->render($this->dataObjectMock));
}