示例#1
0
文件: SortTest.php 项目: alpas29/cms
 public function test_it_sets_default_order_by()
 {
     $Manager = m::mock('Devise\\Support\\Sortable\\Manager');
     $Framework = new \Devise\Support\Framework();
     $Sort = new Sort($Manager, $Framework);
     $Sort->setDefaultOrderBy('fieldname');
 }
示例#2
0
 public function test_it_uses_sorting_and_filtering()
 {
     $BuilderMock = m::mock('Illuminate\\Database\\Query\\Builder');
     $EloquentBuilder = m::mock('Devise\\Support\\Sortable\\EloquentBuilder[callParentPagination]', [$BuilderMock])->shouldAllowMockingProtectedMethods();
     $EloquentBuilder->shouldReceive('callParentPagination')->once()->andReturn('asdf');
     \Sort::shouldReceive('handleSorting')->times(1);
     \Sort::shouldReceive('handleFiltering')->times(1);
     $EloquentBuilder->paginate(10);
 }