function it_should_indicate_a_column_with_some_field_should_exist(ColumnInterface $first, ColumnInterface $second) { $first->getField()->willReturn('some_field'); $second->getField()->willReturn('another_field'); $first->setParent($this)->willReturn(); $second->setParent($this)->willReturn(); $this->addColumn($first); $this->addColumn($second); $this->hasColumnWithField('another_field')->shouldReturn(true); $this->hasColumnWithField('nonexistant_field')->shouldReturn(false); }
/** * @param ColumnInterface $column * @param string $direction */ public function setDefaultSort(ColumnInterface $column, $direction = self::SORT_ASC) { $this->defaultSortColumn = $column; $this->defaultSortDirection = $direction; $column->setParent($this); }