Пример #1
0
 public function testGetFieldList()
 {
     $this->tdb->createTable("test", [["id", "id"], ["name", "string", 50]]);
     $this->tdb->setFp("test", "test");
     $idField = ["fName" => "id", "fType" => "id", "fLength" => 7];
     $nameField = ["fName" => "name", "fType" => "string", "fLength" => 50];
     $this->assertEquals(true, in_array($idField, $this->tdb->getFieldList("test")));
     $this->assertEquals(true, in_array($nameField, $this->tdb->getFieldList("test")));
 }
Пример #2
0
 public function testAddFieldStringWithRecords()
 {
     $this->tdb->add("test", ["name" => "tim"]);
     $this->tdb->addField("test", ["email", "string", 50]);
     $expectedField = ["fName" => "email", "fType" => "string", "fLength" => 50];
     $fieldList = $this->tdb->getFieldList("test");
     $this->assertEquals(true, in_array($expectedField, $fieldList));
     $record = $this->tdb->get("test", 1);
     $this->assertEquals("", $record[0]["email"]);
 }