public function test_it_gets_is_multi() { $Framework = new \Devise\Support\Framework(); $Framework->Session = m::mock('Mock\\Session'); $Framework->Session->shouldReceive('get')->times(1); $Manager = new Manager($Framework); $Manager->getIsMulti(); }
/** * Ads orderBy to the current query in builder * * @param QueryBuilder $query * @param Model $model * @return void */ public function handleSorting(&$query, $model) { if ($this->Input->has('clearSort')) { $this->Manager->clearStack(); } if ($this->Input->has('multisort')) { $this->Manager->setIsMulti(true); } $sortStack = $this->Manager->getStack(); if ($this->Input->has('orderBy') || count($sortStack) > 0) { if (!$this->Input->has('multisort') && !$this->Manager->getIsMulti() && $this->Input->has('orderBy')) { $this->Manager->clearStack(); } $this->Manager->addToStack($this->Input->all()); $sortStack = $this->Manager->getStack(); foreach ($sortStack as $sort) { $query = $this->appendSort($query, $model, $sort); } } else { if (count($this->defaultOrderBy) > 0) { $query = $this->sortByDefault($query, $model); } } }