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'); }
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); }