Permalink
Browse files

MySQL, not Mysql

  • Loading branch information...
1 parent ba3eae7 commit 2908b3e436fdef61630dc78491c7c02a346bc1c3 @ginatrapani ginatrapani committed Nov 8, 2011
@@ -233,7 +233,7 @@ public function testSaveConfigViewData() {
$sql = "select * from " . $this->table_prefix . 'options where namespace = \'' . OptionDAO::APP_OPTIONS
. '\' order by option_id';
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = array();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
array_push($data, $row);
@@ -281,7 +281,7 @@ public function testSaveConfigViewData() {
$this->assertEqual($json_obj->deleted, 0);
$sql = "select * from " . $this->table_prefix . 'options where namespace = \'' . OptionDAO::APP_OPTIONS
. '\' order by option_id';
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = array();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
array_push($data, $row);
@@ -323,7 +323,7 @@ public function testSaveConfigViewData() {
$this->assertEqual($json_obj->deleted, 5);
$sql = "select * from " . $this->table_prefix . 'options where namespace = \'' . OptionDAO::APP_OPTIONS
. '\' order by option_id';
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = array();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
array_push($data, $row);
@@ -270,7 +270,7 @@ public function import($zipfile) {
// does nothing
}
public function export($backup_file = null) {
- throw new MySQLGrantException("Mysql does not have GRANT FILE ON permissions to write to: /bla");
+ throw new MySQLGrantException("MySQL does not have GRANT FILE ON permissions to write to: /bla");
}
}
@@ -282,6 +282,6 @@ public function import($zipfile) {
// does nothing
}
public function export($backup_file = null) {
- throw new OpenFileException("Mysql does not have permissions to write to: /bla");
+ throw new OpenFileException("MySQL does not have permissions to write to: /bla");
}
}
@@ -104,7 +104,7 @@ public function testGetTestDAO() {
// valid mysql test dao
Config::getInstance()->setValue('db_type', 'mysql');
$test_dao = DAOFactory::getDAO('TestDAO');
- $this->assertIsA($test_dao, 'TestMysqlDAO', 'we are a mysql dao');
+ $this->assertIsA($test_dao, 'TestMySQLDAO', 'we are a mysql dao');
$data_obj = $test_dao->selectRecord(1);
$this->assertNotNull($data_obj);
$this->assertEqual($data_obj->test_name, 'name1');
@@ -189,6 +189,6 @@ public function dropExportedPostsTable($backup_file = null) {
*/
class TestExportDAOGrantFail {
public function dropExportedPostsTable($backup_file = null) {
- throw new Exception("Mysql does not have GRANT FILE ON permissions to write to: /bla");
+ throw new Exception("MySQL does not have GRANT FILE ON permissions to write to: /bla");
}
}
@@ -52,7 +52,7 @@ public function testCreateOption() {
$optiondao->insertOption('test_namespace', 'test_name', 'test_value');
$sql = "select * from " . $this->table_prefix . 'options where namespace = ' .
'\'test_namespace\' order by option_id';
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = array();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
array_push($data, $row);
@@ -72,7 +72,7 @@ public function testCreateOption() {
$sql = "select * from " . $this->table_prefix . 'options where namespace = ' .
'\'test_namespace2\' order by option_id';
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = array();
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
array_push($data, $row);
@@ -143,7 +143,7 @@ public function testUpdateOptionById() {
$this->assertEqual(1, $optiondao->updateOption($builder1->columns['last_insert_id'], 'test_value123'));
$sql = "select * from " . $this->table_prefix . 'options where option_id = ' . $builder1->columns['last_insert_id'];
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch(PDO::FETCH_ASSOC);
$this->assertEqual($data['option_name'], 'testname');
$this->assertEqual($data['namespace'], 'test');
@@ -169,7 +169,7 @@ public function testUpdateOptionByIdWithnameUpdate() {
$this->assertEqual(1, $optiondao->updateOption($builder1->columns['last_insert_id'], 'test_value123', 'newname'));
$sql = "select * from " . $this->table_prefix . 'options where option_id = ' . $builder1->columns['last_insert_id'];
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch(PDO::FETCH_ASSOC);
$this->assertEqual($data['option_name'], 'newname');
$this->assertEqual($data['namespace'], 'test');
@@ -195,7 +195,7 @@ public function testUpdateOptionByName() {
$this->assertEqual(1, $optiondao->updateOptionByName('test', 'testname', 'test_value123'));
$sql = "select * from " . $this->table_prefix . 'options where option_id = ' . $builder1->columns['last_insert_id'];
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch(PDO::FETCH_ASSOC);
$this->assertEqual($data['option_name'], 'testname');
$this->assertEqual($data['namespace'], 'test');
@@ -339,7 +339,7 @@ public function testSession() {
public function testIsOptionsTable() {
$optiondao = new OptionMySQLDAO();
$this->assertTrue($optiondao->isOptionsTable(), 'we have an option table');
- PluginOptionMysqlDAO::$PDO->query("drop table " . $this->table_prefix . 'options');
+ PluginOptionMySQLDAO::$PDO->query("drop table " . $this->table_prefix . 'options');
$this->assertFalse($optiondao->isOptionsTable(), 'we do not have an option table');
}
}
@@ -242,7 +242,7 @@ public function testResetAPIKey() {
$this->assertFalse($new_api_key);
$sql = "select id, api_key from " . $this->table_prefix . "owners where id = " .
$this->builders[0]->columns['last_insert_id'];
- $stmt = OwnerMysqlDAO::$PDO->query($sql);
+ $stmt = OwnerMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch(PDO::FETCH_ASSOC);
$this->assertEqual($this->builders[0]->columns['api_key'], $data['api_key']); // should be the same api_key
@@ -251,7 +251,7 @@ public function testResetAPIKey() {
$this->assertEqual(strlen($data['api_key']), 32); //md5 32 char api key
$sql = "select id, api_key from " . $this->table_prefix . "owners where id = " .
$this->builders[0]->columns['last_insert_id'];
- $stmt = OwnerMysqlDAO::$PDO->query($sql);
+ $stmt = OwnerMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch(PDO::FETCH_ASSOC);
$this->assertEqual($this->builders[0]->columns['last_insert_id'], $data['id']);
$this->assertNotEqual($this->builders[0]->columns['api_key'], $data['api_key']); // should be a new api_key
View
@@ -103,8 +103,8 @@ public function testConvertBetweenBoolAndDB() {
public function testTwoObjectsOneConnection() {
DAOFactory::getDAO('TestDAO');
- $this->assertNotNull(TestMysqlDAO::$PDO);
- TestMysqlDAO::$PDO->tu_testing = "testing";
+ $this->assertNotNull(TestMySQLDAO::$PDO);
+ TestMySQLDAO::$PDO->tu_testing = "testing";
$testdao2 = DAOFactory::getDAO('TestDAO');
$this->assertEqual(TestMySQLDAO::$PDO->tu_testing, "testing");
}
@@ -61,13 +61,13 @@ public function testDeleteOption() {
$this->assertTrue( $dao->deleteOption( $insert_id ), "delete an option" );
$sql = "select * from " . $this->table_prefix . 'options where option_id = ' . $insert_id
. " and namespace != 'application_options'";
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch();
$this->assertFalse($data, 'should be no plugin option data');
$sql = "select count(*) as option_count from " . $this->table_prefix . 'options'
. " where namespace != 'application_options'";
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch();
$this->assertEqual($data['option_count'], 2, 'we should have two options left');
@@ -83,15 +83,15 @@ public function testOfInsertOption() {
$sql = "select * from " . $this->table_prefix . 'options where namespace = \''
. OptionDAO::PLUGIN_OPTIONS . '-101\'';
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch();
$this->assertEqual($data['option_id'], 2);
$this->assertEqual($data['namespace'], OptionDAO::PLUGIN_OPTIONS . '-101');
$this->assertEqual($data['option_name'], 'an option name', 'an option name');
$this->assertEqual($data['option_value'], 'an option value', 'an option value');
$sql = "select count(*) as option_count from " . $this->table_prefix . 'options';
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch();
$this->assertEqual($data['option_count'], 2, 'we should have two options');
}
@@ -113,7 +113,7 @@ public function testOfUpdateOption() {
"updated an option" );
// validate updated data
$sql = "select * from " . $this->table_prefix . 'options where option_id = '. $insert_id1;
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch();
$this->assertEqual($data['option_id'], $insert_id1);
$this->assertEqual($data['namespace'], $builder1->columns[ 'namespace' ]);
@@ -122,7 +122,7 @@ public function testOfUpdateOption() {
// make sure we only update data for our id
$sql = "select * from " . $this->table_prefix . 'options where option_id = '. $insert_id2;
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetch();
$this->assertEqual($data['option_id'], $insert_id2);
$this->assertEqual($data['namespace'], $builder2->columns[ 'namespace' ]);
@@ -58,7 +58,7 @@ public function testNullStmt() {
public function testStmtNoResults() {
$post_dao = DAOFactory::getDAO('PostDAO');
$sql = "select * from " . $this->table_prefix . self::TEST_TABLE;
- $stmt = PostMysqlDAO::$PDO->query($sql);
+ $stmt = PostMySQLDAO::$PDO->query($sql);
$post_it = new PostIterator($stmt);
$cnt = 0;
foreach($post_it as $key => $value) {
@@ -1847,7 +1847,7 @@ public function testDeletePost() {
// post deleted
$this->assertEqual(1, $pdao->deletePost(1));
$sql = "select * from " . $this->table_prefix . 'posts where id = 1';
- $stmt = PostMysqlDAO::$PDO->query($sql);
+ $stmt = PostMySQLDAO::$PDO->query($sql);
$this->assertFalse($stmt->fetch(PDO::FETCH_ASSOC));
}
@@ -42,7 +42,7 @@ public function setUp(){
$config = Config::getInstance();
$dao = DAOFactory::getDAO('OptionDAO');
- $this->pdo = OptionMysqlDAO::$PDO;
+ $this->pdo = OptionMySQLDAO::$PDO;
$this->init_db_version = $config->getValue('THINKUP_VERSION');
$config->setValue('THINKUP_VERSION', $config->getValue('THINKUP_VERSION') + 10); //set a high version num
@@ -101,7 +101,7 @@ public function testPostPageWithPostHTMLEntities() {
'is_active'=>1));
$config = Config::getInstance();
$db_prefix = $config->getValue('table_prefix');
- $pdo = PostMysqlDAO::$PDO;
+ $pdo = PostMySQLDAO::$PDO;
$pdo->query("update " . $db_prefix . "posts set post_text = concat(post_text, ' &lt; &gt; &amp; < > &')");
$this->get($this->url.'/post/index.php?t=10&n=twitter');
$this->assertPattern("/This is post 10 &#60; &#62; &#38; &#60; &#62; &#38;/"); // we are all filtered entities
@@ -42,7 +42,7 @@ public function setUp() {
parent::setUp();
$optiondao = new OptionMySQLDAO();
- $this->pdo = OptionMysqlDAO::$PDO;
+ $this->pdo = OptionMySQLDAO::$PDO;
$this->install_dir = THINKUP_ROOT_PATH.'webapp/test_installer';
$this->installs_dir = THINKUP_ROOT_PATH.'build';
@@ -155,7 +155,7 @@ public function testConfigOptionsNotAdmin() {
//app not configured
$namespace = OptionDAO::PLUGIN_OPTIONS . '-2';
$prefix = Config::getInstance()->getValue('table_prefix');
- OwnerMysqlDAO::$PDO->query("delete from " . $prefix . "options where namespace = '$namespace'");
+ OwnerMySQLDAO::$PDO->query("delete from " . $prefix . "options where namespace = '$namespace'");
$controller = new FacebookPluginConfigurationController($owner, 'facebook');
$output = $controller->go();
$this->assertPattern('/var required_values_set = false/', $output); // is not configured
@@ -183,7 +183,7 @@ public function testConfigOptionsIsAdmin() {
//app not configured
$namespace = OptionDAO::PLUGIN_OPTIONS . '-2';
$prefix = Config::getInstance()->getValue('table_prefix');
- OwnerMysqlDAO::$PDO->query("delete from " . $prefix . "options where namespace = '$namespace'");
+ OwnerMySQLDAO::$PDO->query("delete from " . $prefix . "options where namespace = '$namespace'");
$controller = new FacebookPluginConfigurationController($owner, 'facebook');
$output = $controller->go();
$this->assertPattern('/var required_values_set = false/', $output); // is not configured
@@ -201,7 +201,7 @@ public function testConfigOptionsNotAdmin() {
// not configured
$prefix = Config::getInstance()->getValue('table_prefix');
$namespace = $build_data[3]->columns['namespace'];
- OwnerMysqlDAO::$PDO->query("delete from " . $prefix . "options where namespace = '$namespace'");
+ OwnerMySQLDAO::$PDO->query("delete from " . $prefix . "options where namespace = '$namespace'");
$controller = new GeoEncoderPluginConfigurationController($owner, 'geoencoder');
$output = $controller->go();
@@ -227,7 +227,7 @@ public function testConfigOptionsIsAdmin() {
//app not configured
$prefix = Config::getInstance()->getValue('table_prefix');
$namespace = $build_data[3]->columns['namespace'];
- OwnerMysqlDAO::$PDO->query("delete from " . $prefix . "options where namespace = '$namespace'");
+ OwnerMySQLDAO::$PDO->query("delete from " . $prefix . "options where namespace = '$namespace'");
$controller = new GeoEncoderPluginConfigurationController($owner, 'geoencoder');
$output = $controller->go();
$this->assertPattern('/var required_values_set = false/', $output); // is not configured
@@ -90,7 +90,7 @@ public function testEnqueueStatusMockRedis() {
// stream proc data set
$sql = "select process_id, email, instance_id, unix_timestamp(last_report) as last_report from " .
$this->table_prefix . "stream_procs";
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetchAll();
$process_id = getmypid();
$this->assertIdentical($data[0]['process_id'], $process_id . '');
@@ -127,7 +127,7 @@ public function testEnqueueStatusRedis() {
// stream proc data set
$sql = "select process_id, email, instance_id, unix_timestamp(last_report) as last_report from " .
$this->table_prefix . "stream_procs";
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetchAll();
$process_id = getmypid();
$this->assertIdentical($data[0]['process_id'], $process_id . '');
@@ -146,7 +146,7 @@ public function testEnqueueStatusMySQL() {
$consumer_user_stream->enqueueStatus("string1");
$consumer_user_stream->enqueueStatus("string2");
$sql = "select * from " . $this->table_prefix . "stream_data";
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetchAll();
$this->assertIdentical($data[0][0],'1');
$this->assertIdentical($data[0][1],'string1');
@@ -157,7 +157,7 @@ public function testEnqueueStatusMySQL() {
$sql = "select process_id, email, instance_id, unix_timestamp(last_report) as last_report from " .
$this->table_prefix . "stream_procs";
- $stmt = PluginOptionMysqlDAO::$PDO->query($sql);
+ $stmt = PluginOptionMySQLDAO::$PDO->query($sql);
$data = $stmt->fetchAll();
$process_id = getmypid();
$this->assertIdentical($data[0]['process_id'], $process_id . '');

0 comments on commit 2908b3e

Please sign in to comment.