public function testDatagridColumnCellRenderBlock() { $datagrid = $this->createDatagrid('grid'); $datagrid->setData([['title' => 'This is value 1']]); $view = $datagrid->createView(); $cellView = $view[0]['title']; $template = $this->prophesize('\\Twig_Template'); $template->getParent([])->willReturn(false); $template->hasBlock('datagrid_grid_column_name_title_cell')->willReturn(false)->shouldBeCalled(); $template->hasBlock('datagrid_grid_column_type_text_cell')->willReturn(false)->shouldBeCalled(); $template->hasBlock('datagrid_column_name_title_cell')->willReturn(false)->shouldBeCalled(); $template->hasBlock('datagrid_column_type_text_cell')->willReturn(false)->shouldBeCalled(); $template->hasBlock('datagrid_grid_column_cell')->willReturn(false)->shouldBeCalled(); $template->hasBlock('datagrid_column_cell')->willReturn(true)->shouldBeCalled(); $template->displayBlock('datagrid_column_cell', ['cell' => $cellView, 'row_index' => 0, 'datagrid_name' => 'grid', 'translation_domain' => null, 'vars' => ['row' => 0], 'global_var' => 'global_value'])->willReturn(true); $this->extension->setBaseTheme($template->reveal()); $this->extension->datagridColumnCell($cellView); }