public function testGetInstalledPlugins() {
        # build our data
        $builders_array = $this->buildData();
        # init our dao
        $dao = new PluginMySQLDAO();

        $plugins = $dao->getInstalledPlugins($this->config->getValue("source_root_path"));
        $this->assertEqual(count($plugins), 6);

        usort($plugins, 'TestOfPluginMySQLDAO::pluginSort');
        $this->assertEqual($plugins[0]->name,"Embed Thread", "Embed Thread 'name' Test");
        $this->assertEqual($plugins[0]->folder_name,"embedthread", "Embed Thread 'folder_name' test");

        $this->assertEqual($plugins[1]->name,"Expand URLs", "Ex-url 'name' Test");
        $this->assertEqual($plugins[1]->folder_name,"expandurls", "Ex-url 'folder_name' test");

        $this->assertEqual($plugins[2]->name,"Facebook", "Facebook 'name' Test");
        $this->assertEqual($plugins[2]->folder_name,"facebook", "Facebook 'folder_name' test");

        $this->assertEqual($plugins[3]->name, "GeoEncoder", "GeoEncoder 'name' Test");
        $this->assertEqual($plugins[3]->folder_name, "geoencoder", "GeoEncoder 'folder_name' test");

        $this->assertEqual($plugins[4]->name,"Hello ThinkUp", "Hello 'name' Test");
        $this->assertEqual($plugins[4]->folder_name,"hellothinkup", "Hello 'folder_name' test");

        $this->assertEqual($plugins[5]->name,"Twitter", "Twitter 'name' Test");
        $this->assertEqual($plugins[5]->folder_name,"twitter", "Twitter 'folder_name' test");
    }
 public function testGetInstalledPlugins()
 {
     // build our data
     $builders_array = $this->buildData();
     // init our dao
     $dao = new PluginMySQLDAO();
     $plugins = $dao->getInstalledPlugins();
     $this->assertEqual(count($plugins), 8);
     usort($plugins, 'TestOfPluginMySQLDAO::pluginSort');
     $this->assertEqual($plugins[0]->name, "Expand URLs");
     $this->assertEqual($plugins[0]->folder_name, "expandurls");
     $this->assertEqual($plugins[1]->name, "Facebook");
     $this->assertEqual($plugins[1]->folder_name, "facebook");
     $this->assertEqual($plugins[2]->name, "Foursquare");
     $this->assertEqual($plugins[2]->folder_name, "foursquare");
     $this->assertEqual($plugins[3]->name, "GeoEncoder");
     $this->assertEqual($plugins[3]->folder_name, "geoencoder");
     $this->assertEqual($plugins[4]->name, "Google+");
     $this->assertEqual($plugins[4]->folder_name, "googleplus");
     $this->assertEqual($plugins[5]->name, "Hello ThinkUp");
     $this->assertEqual($plugins[5]->folder_name, "hellothinkup");
     $this->assertEqual($plugins[6]->name, "Twitter");
     $this->assertEqual($plugins[6]->folder_name, "twitter");
     $this->assertEqual($plugins[7]->name, "Twitter Realtime");
     $this->assertEqual($plugins[7]->folder_name, "twitterrealtime");
 }
Esempio n. 3
0
 public function testGetInstalledPlugins()
 {
     // build our data
     $builders_array = $this->buildData();
     // init our dao
     $dao = new PluginMySQLDAO();
     $plugins = $dao->getInstalledPlugins();
     $this->assertTrue(count($plugins) >= 9);
     $plugin_names = array();
     $plugin_folder_names = array();
     foreach ($plugins as $plugin) {
         $plugin_names[] = $plugin->name;
         $plugin_folder_names[] = $plugin->folder_name;
     }
     $this->assertTrue(in_array('Expand URLs', $plugin_names));
     $this->assertTrue(in_array('expandurls', $plugin_folder_names));
     $this->assertTrue(in_array('Facebook', $plugin_names));
     $this->assertTrue(in_array('facebook', $plugin_folder_names));
     $this->assertTrue(in_array('Foursquare', $plugin_names));
     $this->assertTrue(in_array('foursquare', $plugin_folder_names));
     $this->assertTrue(in_array('GeoEncoder', $plugin_names));
     $this->assertTrue(in_array('geoencoder', $plugin_folder_names));
     $this->assertTrue(in_array('Google+', $plugin_names));
     $this->assertTrue(in_array('googleplus', $plugin_folder_names));
     $this->assertTrue(in_array('Hello ThinkUp', $plugin_names));
     $this->assertTrue(in_array('hellothinkup', $plugin_folder_names));
     $this->assertTrue(in_array('Insights Generator', $plugin_names));
     $this->assertTrue(in_array('insightsgenerator', $plugin_folder_names));
     $this->assertTrue(in_array('Twitter', $plugin_names));
     $this->assertTrue(in_array('twitter', $plugin_folder_names));
     $this->assertTrue(in_array('Twitter Realtime', $plugin_names));
     $this->assertTrue(in_array('twitterrealtime', $plugin_folder_names));
 }