本文整理汇总了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);
}