Example #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' => '*****@*****.**']);
     $id = $data['data']['id'];
     $_SESSION['user']['id'] = $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);
     }
     DM\Users::delete($id);
     $_SESSION['user']['id'] = 1;
 }
Example #2
0
 public function testDelete()
 {
     $id = DM\Users::toId($this->testName);
     $this->assertTrue(DM\Users::delete($id), 'Cant delete');
 }
Example #3
0
 protected function tearDown()
 {
     //remove users and objects
     DM\Users::delete($this->userIds);
     \CB\Config::setFlag('disableSolrIndexing', $this->oldValues['solrIndexing']);
     if (empty($this->oldValues['userVerified'])) {
         unset($_SESSION['verified']);
     }
 }