Exemplo n.º 1
0
 public function testSearchUser()
 {
     //add a user for search testing
     $class = new \CB\UsersGroups();
     $data = $class->addUser(['name' => 'searchtest', 'first_name' => 'Search', 'last_name' => 'Test', 'email' => '*****@*****.**']);
     $_SESSION['user']['id'] = $data['data']['id'];
     $datas = Data\Providers::searchQueriesData();
     $search = new \CB\Api\Search();
     foreach ($datas as $data) {
         $result = $search->query($data[0]['query']);
         $this->assertArraySubset($data[0]['result'], $result);
     }
     $_SESSION['user']['id'] = 1;
 }
 public function setUp()
 {
     $this->oldValues = array('user_id' => $_SESSION['user']['id'], 'userVerified' => empty($_SESSION['verified']), 'solrIndexing' => \CB\Config::getFlag('disableSolrIndexing'));
     $_SESSION['verified'] = true;
     \CB\Config::setFlag('disableSolrIndexing', true);
     /* create users */
     $usersData = Data\Providers::createUsersData();
     $this->userIds = array();
     foreach ($usersData[0] as $data) {
         $this->userIds[] = $this->createUser($data);
     }
     /* create objects for test notifications on them */
     $objectsData = Data\Providers::createTasksData();
     $userIds = $this->userIds;
     $id = array_shift($userIds);
     array_push($userIds, $id);
     foreach ($objectsData[0] as $data) {
         $data['data']['assigned'] = array_shift($userIds);
         $this->objectIds[] = $this->createObject($data);
     }
 }
Exemplo n.º 3
0
 /**
  *
  * @return array of templates
  */
 public function fieldsTeplateProvider()
 {
     $data = Data\Providers::fieldsProvider();
     return $data;
 }