本文整理匯總了PHP中Mockery::filterQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP Mockery::filterQuery方法的具體用法?PHP Mockery::filterQuery怎麽用?PHP Mockery::filterQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mockery
的用法示例。
在下文中一共展示了Mockery::filterQuery方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testFilterQueryWithoutValue
public function testFilterQueryWithoutValue()
{
$query = m::mock('Illuminate\\Database\\Query\\Builder');
$query->shouldReceive('where')->never();
$this->config->shouldReceive('getDataModel')->once()->andReturn(m::mock(array('getTable' => 'table')));
$this->field->shouldReceive('getOption')->twice()->andReturn(false);
$this->field->filterQuery($query);
}
示例2: testFilterQuery
public function testFilterQuery()
{
$relationship = m::mock(array('getPlainForeignKey' => '', 'getRelated' => m::mock(array('getTable' => 'table'))));
$model = m::mock(array('getTable' => 'table', 'getKeyName' => '', 'method' => $relationship));
$grammar = m::mock('Illuminate\\Database\\Query\\Grammars');
$grammar->shouldReceive('wrap')->once()->andReturn('');
$this->config->shouldReceive('getDataModel')->once()->andReturn($model);
$this->column->shouldReceive('getOption')->times(3)->andReturn('column_name', 'method', 'select')->shouldReceive('getRelationshipWheres')->once()->andReturn('');
$this->db->shouldReceive('raw')->once()->andReturn('foo')->shouldReceive('getQueryGrammar')->once()->andReturn($grammar);
$selects = array();
$this->column->filterQuery($selects);
$this->assertEquals($selects, array('foo'));
}
示例3: testFilterQueryNoValue
public function testFilterQueryNoValue()
{
$query = m::mock('Illuminate\\Database\\Query\\Builder');
$query->shouldReceive('where')->never();
$this->field->shouldReceive('getOption')->once()->andReturn('');
$this->field->filterQuery($query);
}
示例4: testFilterQueryNoMinOrMax
public function testFilterQueryNoMinOrMax()
{
$model = m::mock(array('getTable' => 'table'));
$query = m::mock('Illuminate\\Database\\Query\\Builder');
$this->config->shouldReceive('getDataModel')->once()->andReturn($model);
$this->field->shouldReceive('getOption')->once()->andReturn(false);
$this->field->filterQuery($query);
}
示例5: testFilterQueryDoesntAddSelect
public function testFilterQueryDoesntAddSelect()
{
$this->column->shouldReceive('getOption')->once();
$this->db->shouldReceive('raw')->never()->shouldReceive('getQueryGrammar')->never();
$selects = array();
$this->column->filterQuery($selects);
$this->assertEquals($selects, array());
}
示例6: testFilterQueryWithoutValue
public function testFilterQueryWithoutValue()
{
$query = m::mock('Illuminate\\Database\\Query\\Builder');
$query->shouldReceive('whereIn')->never()->shouldReceive('getConnection')->never();
$this->validator->shouldReceive('isJoined')->never();
$model = m::mock(array('getTable' => 'table', 'getKeyName' => 'id'));
$this->config->shouldReceive('getDataModel')->once()->andReturn($model);
$this->field->shouldReceive('getOption')->times(5)->andReturn(false);
$selects = array();
$this->field->filterQuery($query, $selects);
}