Esempio n. 1
0
 /**
  * @param string $defaultValue
  * @param string $assert
  * @dataProvider renderProvider
  */
 public function testRender($defaultValue, $assert)
 {
     $context = $this->getMockBuilder('\\Magento\\Backend\\Block\\Context')->disableOriginalConstructor()->getMock();
     $model = new \Magento\Indexer\Block\Backend\Grid\Column\Renderer\Updated($context);
     $obj = new \Magento\Framework\Object();
     $obj->setGetter('getValue');
     $obj->setDefault($defaultValue);
     $obj->setValue('');
     $model->setColumn($obj);
     $result = $model->render($obj);
     $this->assertEquals($result, $assert);
 }
Esempio n. 2
0
 /**
  * @param bool $rowValue
  * @param string $class
  * @param string $text
  * @dataProvider typeProvider
  */
 public function testRender($rowValue, $class, $text)
 {
     $html = '<span class="' . $class . '"><span>' . $text . '</span></span>';
     $row = new \Magento\Framework\Object();
     $column = new \Magento\Framework\Object();
     $context = $this->getMockBuilder('\\Magento\\Backend\\Block\\Context')->disableOriginalConstructor()->getMock();
     $model = new \Magento\Indexer\Block\Backend\Grid\Column\Renderer\Scheduled($context);
     $column->setGetter('getValue');
     $row->setValue($rowValue);
     $model->setColumn($column);
     $result = $model->render($row);
     $this->assertEquals($result, $html);
 }
Esempio n. 3
0
 /**
  * @param array $indexValues
  * @param string $expectedResult
  * @dataProvider renderDataProvider
  */
 public function testRender($indexValues, $expectedResult)
 {
     $context = $this->getMockBuilder('\\Magento\\Backend\\Block\\Context')->disableOriginalConstructor()->getMock();
     $model = new \Magento\Indexer\Block\Backend\Grid\Column\Renderer\Status($context);
     $obj = new \Magento\Framework\Object();
     $obj->setGetter(null);
     $obj->setDefault('');
     $obj->setValue('');
     $obj->setIndex($indexValues[0]);
     $obj->setData($indexValues[0], $indexValues[0]);
     $model->setColumn($obj);
     $model->setIndex($indexValues[0]);
     $result = $model->render($obj);
     $this->assertEquals($result, '<span class="' . $expectedResult['class'] . '"><span>' . $expectedResult['text'] . '</span></span>');
 }