8 class QtyTest extends \PHPUnit\Framework\TestCase
27 $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
29 $this->rowMock = $this->createPartialMock(\
Magento\Framework\DataObject::class, [
'getTypeId',
'getIndex']);
30 $this->typeConfigMock = $this->createMock(\
Magento\Catalog\Model\
ProductTypes\ConfigInterface::class);
31 $this->renderer =
$helper->getObject(
32 \
Magento\Sales\Block\Adminhtml\Order\
Create\Search\Grid\Renderer\Qty::class,
33 [
'typeConfig' => $this->typeConfigMock]
39 $expected =
'<input type="text" name="id_name" value="" disabled="disabled" ' .
40 'class="input-text admin__control-text inline_css input-inactive" />';
41 $this->typeConfigMock->expects(
48 $this->returnValue(
true)
50 $this->rowMock->expects($this->once())->method(
'getTypeId')->will($this->returnValue(
'id'));
51 $columnMock = $this->createPartialMock(
52 \
Magento\Backend\Block\Widget\Grid\Column::class,
53 [
'getInlineCss',
'getId']
55 $this->renderer->setColumn($columnMock);
57 $columnMock->expects($this->once())->method(
'getId')->will($this->returnValue(
'id_name'));
58 $columnMock->expects($this->once())->method(
'getInlineCss')->will($this->returnValue(
'inline_css'));
60 $this->assertEquals($expected, $this->renderer->render($this->rowMock));