protected function setUp() { parent::setUp(); $this->tdb = new tdb(); // Create the tmp directory if it doesn't exist if (!file_exists($this->tmpFolder)) { mkdir($this->tmpFolder); } $this->tmpNotWritableFolder = $this->tmpFolder . "/notWritable"; if (!file_exists($this->tmpNotWritableFolder)) { mkdir($this->tmpNotWritableFolder, 0444); } $this->dbName = uniqid(); $this->tdb->createDatabase($this->tmpFolder, $this->dbName); }
public function testRemoveNonExistingTable() { $this->setExpectedException('\\TextDb\\Exception\\InvalidTableException'); $this->tdb->createDatabase($this->tmpFolder, $this->dbName); $this->tdb->removeTable("invalid_table"); $this->tdb->removeDatabase(); }
protected function setUp() { parent::setUp(); $this->tdb = new tdb(); // Create the tmp directory if it doesn't exist if (!file_exists($this->tmpFolder)) { mkdir($this->tmpFolder); } $this->tmpNotWritableFolder = $this->tmpFolder . "/notWritable"; if (!file_exists($this->tmpNotWritableFolder)) { mkdir($this->tmpNotWritableFolder, 0444); } $this->dbName = uniqid(); $this->tdb->createDatabase($this->tmpFolder, $this->dbName); $this->tdb->createTable("test", [["id", "id"], ["name", "string", 50]]); $this->tdb->setFp("test", "test"); }
protected function setUp() { parent::setUp(); $this->tdb = new tdb(); // Create the tmp directory if it doesn't exist if (!file_exists($this->tmpFolder)) { mkdir($this->tmpFolder); } $this->tmpNotWritableFolder = $this->tmpFolder . "/notWritable"; if (!file_exists($this->tmpNotWritableFolder)) { mkdir($this->tmpNotWritableFolder, 0444); } $this->dbName = uniqid(); $this->tdb->createDatabase($this->tmpFolder, $this->dbName); $this->tdb->createTable("test", [["id", "id"], ["name", "string", 50], ["notes", "memo"], ["favorite_number", "number", 10]]); $this->tdb->setFp("test", "test"); $this->tdb->add("test", ["name" => "tim", "notes" => "some blob of data", "favorite_number" => 16]); $this->tdb->add("test", ["name" => "bob", "notes" => "i need milk", "favorite_number" => 8]); $this->tdb->add("test", ["name" => "sally", "notes" => "suits is a great tv series", "favorite_number" => 21]); }