Beispiel #1
0
 public function testValidId()
 {
     $a = array();
     $a[] = self::$db->load(null);
     $a[] = self::$db->load('');
     $a[] = self::$db->load(0);
     $ex = array(null, null, null);
     $this->assertEquals($ex, $a);
 }
Beispiel #2
0
 /**
  * Load index
  */
 public function restore()
 {
     $index = $this->db->load('_' . $this->name . '_index');
     $this->map = @$index['map'];
     $this->inverse = @$index['inverse'];
     if (empty($this->map)) {
         $this->map = array();
     }
     if (empty($this->inverse)) {
         $this->inverse = array();
     }
     $this->sort();
     // json does not guarantee sorted storage
 }