public function testFilterBySearchTermNoSelectedItems()
 {
     $query = m::mock('Illuminate\\Database\\Eloquent\\Builder');
     $query->shouldReceive('where')->once()->shouldReceive('take')->once();
     $field = m::mock('Frozennode\\Administrator\\Fields\\Field');
     $field->shouldReceive('getOption')->once()->andReturn(0);
     $this->factory->filterBySearchTerm('foo', $query, $field, array(), '');
 }
Ejemplo n.º 2
0
	public function testFilterBySearchTermNoSelectedItems()
	{
		$query = m::mock('Illuminate\Database\Query\Builder');
		$query->shouldReceive('where')->twice()
				->shouldReceive('take')->once();
		$field = m::mock('Frozennode\Administrator\Fields\Field');
		$field->shouldReceive('getOption')->twice()->andReturn(array('first', 'second'), 0);
		$this->db->shouldReceive('raw')->twice()->andReturn('');
		$this->factory->filterBySearchTerm('foo', $query, $field, array(), '');
	}