Example #1
0
 public function testInsert()
 {
     $page = new Page(array("name" => "Insert test", "description" => "Insert record", "text" => "Insert record into database"));
     $page->allowed = true;
     $this->assertEquals(Ormion\Record::STATE_NEW, $page->getState());
     $this->object->insert($page);
     $this->assertEquals(Ormion\Record::STATE_EXISTING, $page->getState());
     $this->assertType("int", $page->id);
     $res = $this->db->select("*")->from("pages")->where("id = %i", $page->id)->fetch();
     $this->assertEquals("Insert test", $res->name);
     $this->assertEquals("Insert record", $res->description);
     $this->assertEquals(array(), $page->getModified());
 }