Esempio n. 1
0
 function test_setByID()
 {
     $this->assertEquals('John', Dataface_IO::getByID('Profiles?id=10#fname'));
     Dataface_IO::setByID('Profiles?id=10#fname', 'Jimmy');
     $this->assertEquals('Jimmy', Dataface_IO::getByID('Profiles?id=10#fname'));
     $this->assertEquals('Teacher', Dataface_IO::getById('Profiles/appointments?id=10&appointments::id=2#position'));
     Dataface_IO::setByID('Profiles/appointments?id=10&appointments::id=2#position', 'firefighter');
     $this->assertEquals('firefighter', Dataface_IO::getById('Profiles/appointments?id=10&appointments::id=2#position'));
     Dataface_IO::setByID('Profiles?id=10', array('fname' => 'Bobby', 'lname' => 'Brown'));
     $r =& Dataface_IO::getByID('Profiles?id=10');
     $this->assertEquals(array('fname' => 'Bobby', 'lname' => 'Brown'), $r->vals(array('fname', 'lname')));
 }