示例#1
0
 function testSaveModified()
 {
     $expected = new PHPUnit_Extensions_Database_DataSet_ArrayDataSet(array('whatilearned_knowledgebit' => array(array('id' => 1, 'title' => 'Random Knowledge bit', 'description' => null, 'category' => null, 'url' => 'http://myurl.com'), array('id' => 2, 'title' => 'Complete Knowledge bit', 'description' => 'Hello world!', 'category' => 'general', 'url' => 'http://mydomain.com', 'date_added' => 1347565773))));
     $this->record->setField('title', 'Random Knowledge bit');
     $this->record->setField('url', 'http://myurl.com');
     $this->record->save();
     $actual = $this->getConnection()->createQueryTable('whatilearned_knowledgebit', 'SELECT * FROM whatilearned_knowledgebit');
     $this->assertTablesEqual($expected->getTable('whatilearned_knowledgebit'), $actual);
 }
 /**
  * @depends testEmptyTable
  */
 public function testEmptyTable_getTableMetaData($tables)
 {
     $data_set = new PHPUnit_Extensions_Database_DataSet_ArrayDataSet(array(), $tables);
     $meta_data = $data_set->getTableMetaData('my_table');
     $this->assertInstanceOf('PHPUnit_Extensions_Database_DataSet_ITableMetaData', $meta_data);
     return $meta_data;
 }