Exemple #1
0
     exit;
 }
 $gk = new GateKeeperController($apiconfig['token']);
 $gk->requireToken()->requireUser();
 if (DiscoUtils::route('get', '^/apps$', $parameters, $body)) {
     $services = FeideService::getAll();
     usort($services, 'ss');
     $col = new Collection($services);
     $response = $col->getView(array('realm' => 'uninett.no'));
 } else {
     if (DiscoUtils::route('get', '^/apps/([^/]+)/([^/]+)$', $parameters, $qs)) {
         $realm = $parameters[1];
         $type = $parameters[2];
         $services = FeideService::getAll();
         usort($services, 'ss');
         $col = new ServiceCollection($services);
         if ($type === 'available') {
             $col->filterByRealm($realm, true);
         } else {
             if ($type === 'all') {
             } else {
                 if ($type === 'favs') {
                     $userid = $gk->getUserID();
                     $fav = Favourites::getByID($userid);
                     $col->filterByList($fav->get('favs'));
                 } else {
                     if ($type === 'potential') {
                         $col->filterByRealm($realm, false);
                         $col->filterByTarget('other', true);
                     }
                 }
 /**
  * @expectedException \Magento\Framework\Exception
  * @expectedExceptionMessage When passing in a field array there must be a matching condition array.
  */
 public function testAddToFilterException()
 {
     $this->collection->addFieldToFilter(array(), 'not_array');
 }
 /**
  * @expectedException \Magento\Framework\Exception\LocalizedException
  * @expectedExceptionMessage When passing in a field array there must be a matching condition array.
  */
 public function testAddToFilterExceptionArrayNotSymmetric()
 {
     $this->collection->addFieldToFilter(['field2', 'field2'], ['condition1']);
 }