예제 #1
0
 public function testSetInsertId()
 {
     $somePage = $this->createPage();
     $iId = time();
     $o = new Db_Object('Page');
     $o->setInsertId($iId);
     $userId = User::getInstance()->id;
     $this->assertEquals($iId, $o->getInssertId());
     $o->setValues(array('code' => $iId, 'is_fixed' => 1, 'html_title' => 'Index', 'menu_title' => 'Index', 'page_title' => 'Index', 'meta_keywords' => '', 'meta_description' => '', 'parent_id' => null, 'text' => '[Index page content]', 'func_code' => '', 'order_no' => 1, 'show_blocks' => true, 'published' => true, 'published_version' => 0, 'editor_id' => $userId, 'date_created' => date('Y-m-d H:i:s'), 'date_updated' => date('Y-m-d H:i:s'), 'author_id' => $userId, 'blocks' => '', 'theme' => 'default', 'date_published' => date('Y-m-d H:i:s'), 'in_site_map' => true, 'default_blocks' => true));
     $this->assertTrue((bool) $o->save());
     $this->assertTrue(Db_Object::objectExists('Page', $iId));
     $this->assertEquals($iId, $o->getId());
 }