Ejemplo n.º 1
0
 public static function setUpBeforeClass()
 {
     global $mlphp;
     parent::setUpBeforeClass();
     // Create a manage client for tests
     self::$manageClient = $mlphp->getManageClient();
     // Need ML8 or greater for database operations
     if (substr($mlphp->config['mlversion'], 0, 3) >= 8) {
         $db = new MLPHP\Database(self::$manageClient, $mlphp->config['db']);
         $db->clear();
     }
 }
Ejemplo n.º 2
0
 public static function setIndexesJSON($manageClient)
 {
     parent::$logger->debug('setIndexes');
     $db = new MLPHP\Database($manageClient, 'mlphp-test-db');
     // @todo define a path expression that works
     // $party = array(
     //     'scalar-type' => 'string',
     //     // The following errors due to hyphen '-'
     //     'path-expression' => '//old_roles/2009-2010[0]/party'
     // );
     // $db->addRangePathIndex($party);
     $id = array('scalar-type' => 'string', 'localname' => 'id');
     $db->addRangeElementIndex($id);
     $address = array('scalar-type' => 'string', 'localname' => 'address');
     $db->addRangeElementIndex($address);
 }