From 7fd90aba76deffa0b55c611d9d9fdf4751af1176 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 30 Jun 2014 11:01:44 -0400 Subject: [PATCH] Remove Table Builder classes --- common.php | 2 - core/abstract/abstract_driver.php | 1 - core/abstract/abstract_table.php | 99 ---- core/abstract/abstract_util.php | 1 - core/table_builder.php | 447 ------------------ core/table_column.php | 83 ---- core/table_foreign_key.php | 41 -- core/table_index.php | 42 -- tests/bootstrap.php | 1 - tests/core/table_builder.php | 32 -- .../databases/firebird/FirebirdTableTest.php | 37 -- tests/databases/mysql/MySQLTableTest.php | 48 -- tests/databases/pgsql/PgSQLTableTest.php | 48 -- tests/databases/sqlite/SQLiteTableTest.php | 30 -- tests/databases/sqlite/SqliteQBTest.php | 106 ----- tests/databases/sqlite/SqliteTest.php | 292 ------------ tests/db_files/FB_TEST_DB.FDB | Bin 905216 -> 905216 bytes tests/index.php | 32 +- tests/phpunit.xml | 4 - 19 files changed, 24 insertions(+), 1322 deletions(-) delete mode 100644 core/abstract/abstract_table.php delete mode 100644 core/table_builder.php delete mode 100644 core/table_column.php delete mode 100644 core/table_foreign_key.php delete mode 100644 core/table_index.php delete mode 100644 tests/core/table_builder.php delete mode 100644 tests/databases/firebird/FirebirdTableTest.php delete mode 100644 tests/databases/mysql/MySQLTableTest.php delete mode 100644 tests/databases/pgsql/PgSQLTableTest.php delete mode 100644 tests/databases/sqlite/SQLiteTableTest.php delete mode 100644 tests/databases/sqlite/SqliteQBTest.php delete mode 100644 tests/databases/sqlite/SqliteTest.php diff --git a/common.php b/common.php index 39f6829..efd930b 100644 --- a/common.php +++ b/common.php @@ -152,8 +152,6 @@ function Query($params = '') $p->$k = $v; } - //$params = new ArrayObject($params, ArrayObject::STD_PROP_LIST | ArrayObject::ARRAY_AS_PROPS); - // Otherwise, return a new connection return $cmanager->connect($p); } diff --git a/core/abstract/abstract_driver.php b/core/abstract/abstract_driver.php index d06380c..3f9c54e 100644 --- a/core/abstract/abstract_driver.php +++ b/core/abstract/abstract_driver.php @@ -113,7 +113,6 @@ abstract class Abstract_Driver extends \PDO implements Driver_Interface { $this->sql = new $sql_class(); $this->util = new $util_class($this); - $this->table = new Table_Builder('', array(), $this); } // -------------------------------------------------------------------------- diff --git a/core/abstract/abstract_table.php b/core/abstract/abstract_table.php deleted file mode 100644 index 9efdd92..0000000 --- a/core/abstract/abstract_table.php +++ /dev/null @@ -1,99 +0,0 @@ - $value) - { - if ( ! in_array($option, $this->valid_options)) - { - throw new \InvalidArgumentException("{$option} is not a valid {$type}"); - } - - $func = "set_{$option}"; - - (method_exists($this, "set_{$option}")) - ? $this->$func($value) - : $this->__set($option, $value); - } - - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Getters - * @param mixed $name - * @return mixed - */ - public function __get($name) - { - if ( ! isset($this->$name)) return NULL; - - return $this->$name; - } - - // -------------------------------------------------------------------------- - - /** - * Setters - * @param mixed $name - * @param mixed $val - * @return Abstract_Table - */ - public function __set($name, $val) - { - $this->$name = $val; - return $this; - } - -} -// End of abstract_table.php \ No newline at end of file diff --git a/core/abstract/abstract_util.php b/core/abstract/abstract_util.php index d478e56..ed2ff9d 100644 --- a/core/abstract/abstract_util.php +++ b/core/abstract/abstract_util.php @@ -60,7 +60,6 @@ abstract class Abstract_Util { /** * Convenience public function to generate sql for creating a db table * - * @deprecated Use the table builder class instead * @param string $name * @param array $fields * @param array $constraints diff --git a/core/table_builder.php b/core/table_builder.php deleted file mode 100644 index 0aeb613..0000000 --- a/core/table_builder.php +++ /dev/null @@ -1,447 +0,0 @@ -table_options = array_merge($this->table_options, $options); - - $this->set_driver($driver); - - if ($name !== '') - { - $this->name = (isset($this->driver)) ? $this->driver->prefix_table($name) : $name; - } - - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Alias to constructor - * - * @param string $name - * @param array $options - * @param Driver_Interface $driver - * @return Table_Builder - */ - public function __invoke($name = '', $options = array(), Driver_Interface $driver = NULL) - { - return $this->__construct($name, $options, $driver); - } - - // -------------------------------------------------------------------------- - - /** - * Set the reference to the current database driver - * - * @param Driver_Interface $driver - * @return Table_Builder - */ - public function set_driver(Driver_Interface $driver = NULL) - { - if ( ! is_null($driver)) - { - $this->driver = $driver; - } - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Get the current DB Driver - * - * @return Driver_Interface - */ - public function get_driver() - { - return $this->driver; - } - - // -------------------------------------------------------------------------- - // ! Column Methods - // -------------------------------------------------------------------------- - - /** - * Add a column to the current table - * - * @param string $column_name - * @param string $type - * @param array $options - * @return Table_Builder - */ - public function add_column($column_name, $type = NULL, $options = array()) - { - $col = new Table_Column($column_name, $type, $options); - $this->columns[] = $col; - - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Remove the specified column name from the current table - * - * @param string $column_name - * @return \Query\Table\Table_Builder - */ - public function remove_column($column_name) - { - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Rename the specified column on the current table - * - * @param string $old_name - * @param string $new_name - * @return \Query\Table\Table_Builder - */ - public function rename_column($old_name, $new_name) - { - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Change the specified column on the current table - * - * @param string $column_name - * @param string $new_column_type - * @param array $options - * @return \Query\Table\Table_Builder - */ - public function change_column($column_name, $new_column_type, $options = array()) - { - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Determine whether the column currently exists on the current table - * - * @param string $column_name - * @param array $options - * @return bool - */ - public function has_column($column_name, $options = array()) - { - // @TODO: implement - } - - // -------------------------------------------------------------------------- - // ! Index Methods - // -------------------------------------------------------------------------- - - /** - * Add an index to the current table - * - * @param array $columns - * @param array $options - * @return \Query\Table\Table_Builder - */ - public function add_index($columns, $options = array()) - { - $col = new Table_Index($columns, $options); - $this->indexes[] = $col; - - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Remove an index from the current table - * @param array $columns - * @param array $options - * @return \Query\Table\Table_Builder - */ - public function remove_index($columns, $options = array()) - { - // @TODO: implement - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Remove an index by its name from the current table - * - * @param string $name - * @return \Query\Table\Table_Builder - */ - public function remove_index_by_name($name) - { - // @TODO: implement - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Check if the current table has an index on the specified columns - * - * @param array $columns - * @param array $options - * @return bool - */ - public function has_index($columns, $options = array()) - { - // @TODO: implement - } - - // -------------------------------------------------------------------------- - // ! Foreign Key Methods - // -------------------------------------------------------------------------- - - /** - * Add a foreign key to the current table - * - * @param array $columns - * @param string $referenced_table - * @param array $referenced_columns - * @param array $options - * @return \Query\Table\Table_Builder - */ - public function add_foreign_key($columns, $referenced_table, $referenced_columns = array('id'), $options = array()) - { - $key = new Table_Foreign_Key($columns, $referenced_table, $referenced_columns, $options); - $this->foreign_keys[] = $key; - - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Drop the foreign key from the current table - * - * @param array $columns - * @param string $constraint - * @return \Query\Table\Table_Builder - */ - public function drop_foreign_key($columns, $constraint = NULL) - { - // @TODO: implement - return $this; - } - - // -------------------------------------------------------------------------- - - /** - * Determine whether the current table has the specified foreign key - * - * @param array $columns - * @param string $constraint - * @return bool - */ - public function has_foreign_key($columns, $constraint = NULL) - { - // @TODO: implement - $keys = $this->get_driver()->get_fks($this->name); - - - foreach($keys as $key) - { - - } - - return FALSE; - } - - // -------------------------------------------------------------------------- - // ! Table-wide methods - // -------------------------------------------------------------------------- - - /** - * Check whether the current table exists - * - * @return bool - */ - public function exists() - { - $tables = $this->driver->get_tables(); - return in_array($this->name, $tables); - } - - // -------------------------------------------------------------------------- - - /** - * Drop the current table - * - * @return void - */ - public function drop() - { - // @TODO: implement - } - - // -------------------------------------------------------------------------- - - /** - * Rename the current table - * - * @param string $new_table_name - * @return void - */ - public function rename($new_table_name) - { - // @TODO: implement - } - - // -------------------------------------------------------------------------- - - /** - * Get the list of columns for the current table - * - * @return array - */ - public function get_columns() - { - return $this->driver->get_columns($this->name); - } - - - // -------------------------------------------------------------------------- - // ! Action methods - // -------------------------------------------------------------------------- - - /** - * Create the table from the previously set options - * - * @return void - */ - public function create() - { - // @TODO: implement - $this->reset(); - } - - // -------------------------------------------------------------------------- - - /** - * Update the current table with the changes made - * - * @return void - */ - public function update() - { - // @TODO: implement - $this->reset(); - } - - // -------------------------------------------------------------------------- - - /** - * Save the changes made to the table - * - * @return void - */ - public function save() - { - ($this->exists()) - ? $this->update() - : $this->create(); - } - - // -------------------------------------------------------------------------- - - /** - * Reset the state of the table builder - * - * @return void - */ - public function reset() - { - $skip = array( - 'driver' => 'driver' - ); - - foreach($this as $key => $val) - { - if ( ! isset($skip[$key])) - { - $this->$key = NULL; - } - } - } - -} -// End of table_builder.php diff --git a/core/table_column.php b/core/table_column.php deleted file mode 100644 index a6e6248..0000000 --- a/core/table_column.php +++ /dev/null @@ -1,83 +0,0 @@ -name = $name; - $this->type = $type; - $this->options = ( ! empty($options)) - ? $this->validate_options($options) - : array(); - } - - // -------------------------------------------------------------------------- - - /** - * Return the string to create the column - * - * @return string - */ - public function __toString() - { - // @TODO: implement - $num_args = func_num_args(); - } - -} -// End of table_column.php diff --git a/core/table_foreign_key.php b/core/table_foreign_key.php deleted file mode 100644 index 3be4b1c..0000000 --- a/core/table_foreign_key.php +++ /dev/null @@ -1,41 +0,0 @@ -assertTrue($this->db->table('test')->exists()); - } - - public function testGetDriver() - { - $this->assertEqual($this->db, $this->db->table()->get_driver()); - } - -} -// End of table_builder.php \ No newline at end of file diff --git a/tests/databases/firebird/FirebirdTableTest.php b/tests/databases/firebird/FirebirdTableTest.php deleted file mode 100644 index 6f26093..0000000 --- a/tests/databases/firebird/FirebirdTableTest.php +++ /dev/null @@ -1,37 +0,0 @@ -markTestSkipped('Firebird extension does not exist'); - } - - // test the db driver directly - $this->db = new \Query\Driver\Firebird('localhost:'.$dbpath); - $this->db->table_prefix = 'create_'; - $this->tables = $this->db->get_tables(); - } - -} -// End of FirebirdTableTest.php \ No newline at end of file diff --git a/tests/databases/mysql/MySQLTableTest.php b/tests/databases/mysql/MySQLTableTest.php deleted file mode 100644 index 0138592..0000000 --- a/tests/databases/mysql/MySQLTableTest.php +++ /dev/null @@ -1,48 +0,0 @@ -markTestSkipped("MySQL extension for PDO not loaded"); - } - - // Attempt to connect, if there is a test config file - if (is_file(QTEST_DIR . "/settings.json")) - { - $params = json_decode(file_get_contents(QTEST_DIR . "/settings.json")); - $params = $params->mysql; - - $this->db = new \Query\Driver\MySQL("mysql:host={$params->host};dbname={$params->database}", $params->user, $params->pass, array( - PDO::ATTR_PERSISTENT => TRUE - )); - } - elseif (($var = getenv('CI'))) - { - $this->db = new \Query\Driver\MySQL('host=127.0.0.1;port=3306;dbname=test', 'root'); - } - - $this->db->table_prefix = 'create_'; - } - -} -// End of MySQLTableTest.php \ No newline at end of file diff --git a/tests/databases/pgsql/PgSQLTableTest.php b/tests/databases/pgsql/PgSQLTableTest.php deleted file mode 100644 index 51053bb..0000000 --- a/tests/databases/pgsql/PgSQLTableTest.php +++ /dev/null @@ -1,48 +0,0 @@ -markTestSkipped("Postgres extension for PDO not loaded"); - } - - // Attempt to connect, if there is a test config file - if (is_file(QTEST_DIR . "/settings.json")) - { - $params = json_decode(file_get_contents(QTEST_DIR . "/settings.json")); - $params = $params->pgsql; - - $this->db = new $class("pgsql:dbname={$params->database}", $params->user, $params->pass); - } - elseif (($var = getenv('CI'))) - { - $this->db = new $class('host=127.0.0.1;port=5432;dbname=test', 'postgres'); - } - - $this->db->table_prefix = 'create_'; - } - -} -// End of PgSQLTableTest.php \ No newline at end of file diff --git a/tests/databases/sqlite/SQLiteTableTest.php b/tests/databases/sqlite/SQLiteTableTest.php deleted file mode 100644 index f3d1233..0000000 --- a/tests/databases/sqlite/SQLiteTableTest.php +++ /dev/null @@ -1,30 +0,0 @@ -db = Query('test_sqlite'); - $this->db->table_prefix = 'create_'; - } - -} -// End of SQLiteTableTest.php \ No newline at end of file diff --git a/tests/databases/sqlite/SqliteQBTest.php b/tests/databases/sqlite/SqliteQBTest.php deleted file mode 100644 index 7da121d..0000000 --- a/tests/databases/sqlite/SqliteQBTest.php +++ /dev/null @@ -1,106 +0,0 @@ -db = Query('test_sqlite'); - } - - // -------------------------------------------------------------------------- - - public function testQueryFunctionAlias() - { - $db = Query('test_sqlite'); - - $this->assertTrue($this->db === $db); - } - - // -------------------------------------------------------------------------- - - public function testQueryExplain() - { - $query = $this->db->select('id, key as k, val') - ->explain() - ->where('id >', 1) - ->where('id <', 900) - ->get('create_test', 2, 1); - - $res = $query->fetchAll(PDO::FETCH_ASSOC); - - $expected_possibilities = array(); - - $expected_possibilities[] = array( - array( - 'order' => '0', - 'from' => '0', - 'detail' => 'TABLE create_test USING PRIMARY KEY', - ) - ); - - $expected_possibilities[] = array ( - array ( - 'selectid' => '0', - 'order' => '0', - 'from' => '0', - 'detail' => 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid '0', - 'order' => '0', - 'from' => '0', - 'detail' => 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid '0', - 'order' => '0', - 'from' => '0', - 'detail' => 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowidassertTrue(TRUE); - $passed = TRUE; - } - } - - // Well, apparently not an expected possibility - if ( ! $passed) - { - var_export($res); - $this->assertTrue(FALSE); - } - } -} \ No newline at end of file diff --git a/tests/databases/sqlite/SqliteTest.php b/tests/databases/sqlite/SqliteTest.php deleted file mode 100644 index c27db30..0000000 --- a/tests/databases/sqlite/SqliteTest.php +++ /dev/null @@ -1,292 +0,0 @@ -db = Query('test_sqlite'); - $this->db->table_prefix = 'create_'; - } - - // -------------------------------------------------------------------------- - // ! Util Method tests - // -------------------------------------------------------------------------- - - public function testCreateTable() - { - $this->db->exec(file_get_contents(QTEST_DIR.'/db_files/sqlite.sql')); - - //Check - $dbs = $this->db->get_tables(); - - $this->assertTrue(in_array('TEST1', $dbs)); - $this->assertTrue(in_array('TEST2', $dbs)); - $this->assertTrue(in_array('NUMBERS', $dbs)); - $this->assertTrue(in_array('NEWTABLE', $dbs)); - $this->assertTrue(in_array('create_test', $dbs)); - $this->assertTrue(in_array('create_join', $dbs)); - $this->assertTrue(in_array('create_delete', $dbs)); - } - - // -------------------------------------------------------------------------- - - /*public function testBackupData() - { - $sql = mb_trim($this->db->util->backup_data(array('create_join', 'create_test'))); - - $sql_array = explode("\n", $sql); - - $expected = <<assertEqual($expected_array, $sql_array); - }*/ - - // -------------------------------------------------------------------------- - - public function testBackupStructure() - { - $sql = mb_trim($this->db->util->backup_structure()); - $expected = << 100; -CREATE TABLE "testconstraints" ( - someid integer NOT NULL, - somename TEXT NOT NULL, - CONSTRAINT testconstraints_id_pk PRIMARY KEY (someid) -); -CREATE TABLE "testconstraints2" ( - ext_id integer NOT NULL, - modified text, - uniquefield text NOT NULL, - usraction integer NOT NULL, - CONSTRAINT testconstraints_id_fk FOREIGN KEY (ext_id) - REFERENCES testconstraints (someid) - ON UPDATE CASCADE - ON DELETE CASCADE, - CONSTRAINT unique_2_fields_idx UNIQUE (modified, usraction), - CONSTRAINT uniquefld_idx UNIQUE (uniquefield) -); -; -; -SQL; - - $expected_array = explode("\n", $expected); - $result_array = explode("\n", $sql); - - $this->assertEqual($expected_array, $result_array); - } - - // -------------------------------------------------------------------------- - - public function testDeleteTable() - { - $sql = $this->db->util->delete_table('create_delete'); - - $this->db->query($sql); - - //Check - $dbs = $this->db->get_tables(); - $this->assertFalse(in_array('create_delete', $dbs)); - } - - // -------------------------------------------------------------------------- - // ! General tests - // -------------------------------------------------------------------------- - - public function testConnection() - { - $db = new \Query\Driver\SQLite(QTEST_DIR.QDS.'db_files'.QDS.'test_sqlite.db'); - - $this->assertIsA($db, '\\Query\\Driver\\SQLite'); - $this->assertIsA($this->db->db, '\\Query\\Driver\\SQLite'); - - unset($db); - } - - // -------------------------------------------------------------------------- - - public function testTruncate() - { - $this->db->truncate('create_test'); - } - - // -------------------------------------------------------------------------- - - public function testPreparedStatements() - { - $sql = <<db->prepare_query($sql, array(1,"boogers", "Gross")); - - $statement->execute(); - - } - - // -------------------------------------------------------------------------- - - public function testPrepareExecute() - { - $sql = <<db->prepare_execute($sql, array( - 2, "works", 'also?' - )); - - } - - // -------------------------------------------------------------------------- - - public function testCommitTransaction() - { - $res = $this->db->beginTransaction(); - - $sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (10, 12, 14)'; - $this->db->query($sql); - - $res = $this->db->commit(); - $this->assertTrue($res); - } - - // -------------------------------------------------------------------------- - - public function testRollbackTransaction() - { - $res = $this->db->beginTransaction(); - - $sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (182, 96, 43)'; - $this->db->query($sql); - - $res = $this->db->rollback(); - $this->assertTrue($res); - } - - // -------------------------------------------------------------------------- - - public function testGetDBs() - { - $this->assertTrue(is_array($this->db->get_dbs())); - } - - // -------------------------------------------------------------------------- - - public function testGetSchemas() - { - $this->assertNull($this->db->get_schemas()); - } - - // -------------------------------------------------------------------------- - // ! SQL tests - // -------------------------------------------------------------------------- - - public function testNullMethods() - { - $sql = $this->db->sql->function_list(); - $this->assertEqual(NULL, $sql); - - $sql = $this->db->sql->procedure_list(); - $this->assertEqual(NULL, $sql); - - $sql = $this->db->sql->sequence_list(); - $this->assertEqual(NULL, $sql); - } - - // -------------------------------------------------------------------------- - - public function testGetSystemTables() - { - $sql = $this->db->get_system_tables(); - $this->assertTrue(is_array($sql)); - } - - // -------------------------------------------------------------------------- - - public function testGetSequences() - { - $this->assertNull($this->db->get_sequences()); - } - - // -------------------------------------------------------------------------- - - public function testGetFunctions() - { - $this->assertNull($this->db->get_functions()); - } - - // -------------------------------------------------------------------------- - - public function testGetProcedures() - { - $this->assertNull($this->db->get_procedures()); - } -} \ No newline at end of file diff --git a/tests/db_files/FB_TEST_DB.FDB b/tests/db_files/FB_TEST_DB.FDB index f2f04827e336702feb2aa7c8069e9f42a67b1e24..1c303f0a1d73d71b44d0d365872b3d17ecf8d61b 100755 GIT binary patch delta 5258 zcmcJTdu&tJ9mjvy*Z2C`$0iPWLLS(O6HIw5PK>X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gvn^aLU|-N z9ivThcFw&~3e#r}tNrQ;bDM<4DIAB%%azvzL8FZk8 in_array('interbase', $drivers), + 'SQLite' => in_array('sqlite', $drivers), + 'PgSQL' => in_array('pgsql', $drivers), +); + +// Determine which testcases to load +foreach($driver_test_map as $name => $do_load) +{ + $path = $test_path . strtolower($name) . '/'; + + if ($do_load && ($name != 'SQLite' && ! IS_QUERCUS)) + { + require_once("{$path}{$name}Test.php"); + require_once("{$path}{$name}QBTest.php"); + } +} // End of index.php \ No newline at end of file diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 34a30ce..9916d02 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -18,22 +18,18 @@ databases/firebird/FirebirdTest.php - databases/firebird/FirebirdTableTest.php databases/firebird/FirebirdQBTest.php databases/mysql/MySQLTest.php - databases/mysql/MySQLTableTest.php databases/mysql/MySQLQBTest.php databases/pgsql/PgSQLTest.php - databases/pgsql/PgSQLTableTest.php databases/pgsql/PgSQLQBTest.php databases/sqlite/SQLiteTest.php - databases/sqlite/SQLiteQBTest.php