Example #1
0
 public function testDeleteIndex()
 {
     $g = self::guid();
     $id = self::$db->create(array('guid' => $g));
     self::$db->delete($id);
     $a = self::$guidIndex->find($g);
     $this->assertTrue(empty($a));
 }
Example #2
0
 public function testIndexSlice()
 {
     $g = self::guid();
     $tempIndex = new Index(self::$db, $g, 'name');
     $id1 = self::$db->create(array('name' => 'foo'));
     $id2 = self::$db->create(array('name' => 'bar'));
     $id3 = self::$db->create(array('name' => 'baz'));
     $a = $tempIndex->loadSlice(1, 2);
     $ex = array($id3 => array('name' => 'baz'), $id1 => array('name' => 'foo'));
     $this->assertEquals($ex, $a);
 }