Skip to content

Commit

Permalink
Add InsightBaselineDAO to DAOFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed May 8, 2012
1 parent 44e4a4a commit be58b7b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 7 additions & 1 deletion tests/TestOfDAOFactory.php
Expand Up @@ -375,6 +375,12 @@ public function testGetShortLinkDAO() {
$this->assertNotNull($dao);
$this->assertIsA($dao, 'ShortLinkMySQLDAO');
}

public function testInsightBaselineDAO() {
$dao = DAOFactory::getDAO('InsightBaselineDAO');
$this->assertNotNull($dao);
$this->assertIsA($dao, 'InsightBaselineMySQLDAO');
}
/**
* Test get InstallerDAO without a config file, override with array of config values
*/
Expand All @@ -387,7 +393,7 @@ public function testGetInstallerDAONoConfigFile(){
$this->assertTrue(isset($dao));
$this->assertIsA($dao, 'InstallerMySQLDAO');
$result = $dao->getTables();
$this->assertEqual(sizeof($result), 29);
$this->assertEqual(sizeof($result), 31);
$this->assertEqual($result[0], $cfg_values["table_prefix"].'encoded_locations');
$this->restoreConfigFile();
}
Expand Down
17 changes: 16 additions & 1 deletion tests/TestOfInstaller.php
Expand Up @@ -139,6 +139,8 @@ public function testInstallerShowTables() {
$config->getValue('table_prefix')."instances, ".
$config->getValue('table_prefix')."instances_twitter, ".
$config->getValue('table_prefix')."invites," .
$config->getValue('table_prefix')."insight_baselines," .
$config->getValue('table_prefix')."insights," .
//$config->getValue('table_prefix')."links," .
$config->getValue('table_prefix')."links_short," .
$config->getValue('table_prefix')."mentions," .
Expand Down Expand Up @@ -215,6 +217,8 @@ public function testInstallerCheckTable() {
$config->getValue('table_prefix')."instances, ".
$config->getValue('table_prefix')."instances_twitter, ".
$config->getValue('table_prefix')."invites," .
$config->getValue('table_prefix')."insight_baselines," .
$config->getValue('table_prefix')."insights," .
$config->getValue('table_prefix')."links_short," .
$config->getValue('table_prefix')."mentions," .
$config->getValue('table_prefix')."mentions_posts, " .
Expand Down Expand Up @@ -282,6 +286,8 @@ public function testDoThinkUpTablesExist() {
$config->getValue('table_prefix')."instances, ".
$config->getValue('table_prefix')."instances_twitter, ".
$config->getValue('table_prefix')."invites," .
$config->getValue('table_prefix')."insight_baselines," .
$config->getValue('table_prefix')."insights," .
$config->getValue('table_prefix')."mentions," .
$config->getValue('table_prefix')."mentions_posts, " .
$config->getValue('table_prefix')."owner_instances, ".
Expand Down Expand Up @@ -325,6 +331,8 @@ public function testInstallerIsThinkUpInstalled() {
$config->getValue('table_prefix')."instances, ".
$config->getValue('table_prefix')."instances_twitter, ".
$config->getValue('table_prefix')."invites," .
$config->getValue('table_prefix')."insight_baselines," .
$config->getValue('table_prefix')."insights," .
$config->getValue('table_prefix')."mentions," .
$config->getValue('table_prefix')."mentions_posts, " .
$config->getValue('table_prefix')."owner_instances, ".
Expand Down Expand Up @@ -405,6 +413,8 @@ public function testInstallerPopulateTables() {
$config->getValue('table_prefix')."instances, ".
$config->getValue('table_prefix')."instances_twitter, ".
$config->getValue('table_prefix')."invites," .
$config->getValue('table_prefix')."insight_baselines," .
$config->getValue('table_prefix')."insights," .
$config->getValue('table_prefix')."links," .
$config->getValue('table_prefix')."links_short," .
$config->getValue('table_prefix')."mentions," .
Expand Down Expand Up @@ -447,6 +457,8 @@ public function testInstallerPopulateTables() {
$config->getValue('table_prefix')."instances, ".
$config->getValue('table_prefix')."instances_twitter, ".
$config->getValue('table_prefix')."invites," .
$config->getValue('table_prefix')."insight_baselines," .
$config->getValue('table_prefix')."insights," .
$config->getValue('table_prefix')."mentions," .
$config->getValue('table_prefix')."mentions_posts, " .
$config->getValue('table_prefix')."owner_instances, ".
Expand Down Expand Up @@ -488,6 +500,8 @@ public function testInstallerPopulateTables() {
$config->getValue('table_prefix')."instances, ".
$config->getValue('table_prefix')."instances_twitter, ".
$config->getValue('table_prefix')."invites," .
$config->getValue('table_prefix')."insight_baselines," .
$config->getValue('table_prefix')."insights," .
$config->getValue('table_prefix')."links," .
$config->getValue('table_prefix')."links_short," .
$config->getValue('table_prefix')."mentions," .
Expand Down Expand Up @@ -555,7 +569,8 @@ public function testGetTablesToInstall(){

$expected_tables = array('encoded_locations', 'favorites', 'follower_count', 'follows', 'group_member_count',
'group_members', 'groups', 'hashtags', 'hashtags_posts',
'instances', 'instances_twitter', 'invites', 'links', 'links_short', 'mentions', 'mentions_posts', 'options',
'insight_baselines', 'insights', 'instances', 'instances_twitter', 'invites',
'links', 'links_short', 'mentions', 'mentions_posts', 'options',
'owner_instances', 'owners', 'places','places_posts',
'plugins', 'post_errors', 'posts', 'stream_data', 'stream_procs', 'user_errors', 'users');
$this->assertIdentical($tables, $expected_tables);
Expand Down
5 changes: 4 additions & 1 deletion webapp/_lib/model/class.DAOFactory.php
Expand Up @@ -179,7 +179,10 @@ class DAOFactory {
//ShortLink MySQL DAO
'ShortLinkDAO' => array (
//MySQL Version
'mysql' => 'ShortLinkMySQLDAO')
'mysql' => 'ShortLinkMySQLDAO'),
'InsightBaselineDAO' => array (
//MySQL Version
'mysql' => 'InsightBaselineMySQLDAO')
);

/*
Expand Down

0 comments on commit be58b7b

Please sign in to comment.