quickCleanup($tablesToTruncate); } /** * Test CRM_Contact_BAO_Query::searchQuery() * @dataProvider dataProvider * @param $fv * @param $count * @param $ids * @param $full */ public function testSearch($fv, $count, $ids, $full) { $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute($this->_dbconn, $this->createFlatXMLDataSet( dirname(__FILE__) . '/queryDataset.xml' ) ); $params = CRM_Contact_BAO_Query::convertFormValues($fv); $obj = new CRM_Contact_BAO_Query($params); // let's set useGroupBy=true, to prevent duplicate records $obj->_useGroupBy = TRUE; $dao = $obj->searchQuery(); $contacts = array(); while ($dao->fetch()) { $contacts[] = $dao->contact_id; } sort($contacts, SORT_NUMERIC); $this->assertEquals($ids, $contacts, 'In line ' . __LINE__); } }