当前位置: 首页>>代码示例>>PHP>>正文


PHP Mockery::filterQuery方法代码示例

本文整理汇总了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);
 }
开发者ID:dmitriyuch,项目名称:Laravel-Administrator,代码行数:8,代码来源:TextTest.php

示例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'));
 }
开发者ID:EmersonStone,项目名称:Laravel-Administrator,代码行数:13,代码来源:HasOneOrManyTest.php

示例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);
 }
开发者ID:EmersonStone,项目名称:Laravel-Administrator,代码行数:7,代码来源:BoolTest.php

示例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);
 }
开发者ID:gavwang,项目名称:Laravel-Administrator,代码行数:8,代码来源:FieldTest.php

示例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());
 }
开发者ID:dmitriyuch,项目名称:Laravel-Administrator,代码行数:8,代码来源:ColumnTest.php

示例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);
 }
开发者ID:dmitriyuch,项目名称:Laravel-Administrator,代码行数:11,代码来源:BelongsToManyTest.php


注:本文中的Mockery::filterQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。