Exemplo n.º 1
0
 public function testParseComputedColumns()
 {
     $column = m::mock('Frozennode\\Administrator\\DataTable\\Columns\\Column');
     $column->shouldReceive('renderOutput')->twice()->andReturn('rendered');
     $columns = array('column1' => $column, 'column2' => $column);
     $this->columnFactory->shouldReceive('getColumns')->once()->andReturn($columns);
     $this->columnFactory->shouldReceive('getComputedColumns')->once()->andReturn(array('column1' => 'foo', 'column2' => 'flerp'));
     $model = new \stdClass();
     $model->column1 = 'raw';
     $model->column2 = 'raw';
     $outputRow = array();
     $regColumnOutput = array('raw' => 'raw', 'rendered' => 'rendered');
     $testOutput = array('column1' => $regColumnOutput, 'column2' => $regColumnOutput);
     $this->dataTable->parseComputedColumns($model, $outputRow);
     $this->assertEquals($outputRow, $testOutput);
 }