コード例 #1
0
 public function testSave1()
 {
     $e = new \ArrayObject(array('2K' => new \ArrayObject(array('2P' => '2V', '2Q' => '2W')), '3K' => new \ArrayObject(array('3P' => '3V', '3Q' => '3W'))));
     $this->object = new \Nethgui\Adapter\TableAdapter(MockFactory::getMockDatabase($this, $this->getDB()->set(DB::deleteKey("1K"), $e)), 'T', FALSE);
     $this->assertFalse($this->object->isModified());
     unset($this->object['1K']);
     $this->assertTrue($this->object->isModified());
     $c = $this->object->save();
     $this->assertEquals(1, $c);
     $this->assertFalse($this->object->isModified());
     $this->assertFalse(isset($this->object['1K']));
 }
コード例 #2
0
 /**
  * @param TableAdapter $_adapter
  * @return unknown_type
  */
 public function accept(TableAdapter $_adapter)
 {
     return $_adapter->assign($this->connection, $this->table, $this->primary, $this->index);
 }
コード例 #3
0
 /**
  * @covers Nethgui\Adapter\TableAdapter::save
  * @todo   Implement testSave().
  * @expectedException \LogicException
  */
 public function testSave2()
 {
     $this->object->offsetSet('4K', array('4P' => '4V', '4Q' => '4W'));
     $this->object->save();
 }