public function testTextInputSize()
 {
     //not logged in, no owner set
     $controller = new HelloThinkUpPluginConfigurationController(null, 'hellothinkup');
     $builder = FixtureBuilder::build('owners', array('email' => '*****@*****.**', 'user_activated' => 1));
     $this->simulateLogin('*****@*****.**');
     $owner_dao = DAOFactory::getDAO('OwnerDAO');
     $owner = $owner_dao->getByEmail(Session::getLoggedInUser());
     $controller = new HelloThinkUpPluginConfigurationController($owner, 'hellothinkup');
     $output = $controller->go();
     $this->assertEqual($controller->option_elements['testname']['size'], 40);
 }
 public function testOutput()
 {
     //not logged in, no owner set
     $controller = new HelloThinkUpPluginConfigurationController(null, 'hellothinkup');
     $output = $controller->go();
     $v_mgr = $controller->getViewManager();
     $config = Config::getInstance();
     $this->assertEqual('You must <a href="' . $config->getValue('site_root_path') . 'session/login.php">log in</a> to do this.', $v_mgr->getTemplateDataItem('errormsg'));
     // logged in
     // build a user
     $builder = FixtureBuilder::build('owners', array('email' => '*****@*****.**', 'user_activated' => 1));
     $this->simulateLogin('*****@*****.**');
     $owner_dao = DAOFactory::getDAO('OwnerDAO');
     $owner = $owner_dao->getByEmail(Session::getLoggedInUser());
     $controller = new HelloThinkUpPluginConfigurationController($owner, 'hellothinkup');
     $output = $controller->go();
     $v_mgr = $controller->getViewManager();
     $message = $v_mgr->getTemplateDataItem('message');
     $this->assertEqual($message, 'Hello, world! This is the example plugin configuration page for  me@example.com.', 'message set ' . $message);
 }
 public function renderConfiguration($owner)
 {
     $controller = new HelloThinkUpPluginConfigurationController($owner, 'hellothinkup');
     return $controller->go();
 }