當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。