public function testInviteInvalidCode()
 {
     // make sure registration is closed
     $bvalues = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_registration_open', 'option_value' => 'false');
     $bdata = FixtureBuilder::build('options', $bvalues);
     $bvalues1 = array('invite_code' => '0123456789', 'created_time' => '-8d');
     $bdata1 = FixtureBuilder::build('invites', $bvalues);
     $_SERVER['HTTP_HOST'] = "mythinkup/";
     $_GET['code'] = '9876543210';
     $_POST['Submit'] = 'Register';
     $_POST['full_name'] = "Angelina Jolie";
     $_POST['email'] = '*****@*****.**';
     $_POST['user_code'] = '123456';
     $_POST['pass1'] = 'mypass';
     $_POST['pass2'] = 'mypass';
     $controller = new RegisterController(true);
     $results = $controller->go();
     $v_mgr = $controller->getViewManager();
     $this->assertEqual($v_mgr->getTemplateDataItem('controller_title'), 'Register');
     $this->assertEqual($v_mgr->getTemplateDataItem('error_msg'), '<p>Sorry, registration is closed on this ThinkUp installation.</p>' . '<p><a href="http://thinkupapp.com">Install ThinkUp on your own ' . 'server.</a></p>');
 }
Ejemplo n.º 2
0
<?php

chdir('..');
require_once 'init.php';
$controller = new RegisterController();
echo $controller->go();
Ejemplo n.º 3
0
 public function testOfThinkUpLLCRedirect()
 {
     $config = Config::getInstance();
     $config->setValue('thinkupllc_endpoint', 'http://example.com/user/');
     $controller = new RegisterController(true);
     $result = $controller->go();
     $this->assertEqual($controller->redirect_destination, 'http://example.com/user/');
 }
Ejemplo n.º 4
0
 public function testSuccessfulRegistration()
 {
     $_SERVER['HTTP_HOST'] = "http://mytestthinkup/";
     $_POST['Submit'] = 'Register';
     $_POST['full_name'] = "Angelina Jolie";
     $_POST['email'] = '*****@*****.**';
     $_POST['user_code'] = '123456';
     $_POST['pass1'] = 'mypass';
     $_POST['pass2'] = 'mypass';
     $controller = new RegisterController(true);
     $results = $controller->go();
     $v_mgr = $controller->getViewManager();
     $this->assertEqual($v_mgr->getTemplateDataItem('controller_title'), 'Register');
     $this->assertEqual($v_mgr->getTemplateDataItem('successmsg'), 'Success! Check your email for an activation link.');
 }
Ejemplo n.º 5
0
    public function testSuccessfulRegistration() {
        // make sure registration is on...
        $bvalues = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_registration_open',
        'option_value' => 'true');
        $bdata = FixtureBuilder::build('options', $bvalues);

        $_SERVER['HTTP_HOST'] = "http://mytestthinkup/";
        $_POST['Submit'] = 'Register';
        $_POST['full_name'] = "Angelina Jolie";
        $_POST['email'] = '*****@*****.**';
        $_POST['user_code'] = '123456';
        $_POST['pass1'] = 'mypass';
        $_POST['pass2'] = 'mypass';
        $controller = new RegisterController(true);
        $results = $controller->go();

        $v_mgr = $controller->getViewManager();
        $this->assertEqual($v_mgr->getTemplateDataItem('controller_title'), 'Register');
        $this->assertEqual($v_mgr->getTemplateDataItem('successmsg'),
        'Success! Check your email for an activation link.');
    }
    public function testSpaceInHostName() {
        // make sure registration is on...
        $bvalues = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_registration_open',
        'option_value' => 'true');
        $bdata = FixtureBuilder::build('options', $bvalues);

        $_SERVER['HTTP_HOST'] = "mytestthinkup/";
        $_POST['Submit'] = 'Register';
        $_POST['full_name'] = "Angelina Jolie";
        $_POST['email'] = '*****@*****.**';
        $_POST['user_code'] = '123456';
        $_POST['pass1'] = 'mypass';
        $_POST['pass2'] = 'mypass';
        $config = Config::getInstance();
        $config->setValue('site_root_path', 'test url with spaces/');
        $controller = new RegisterController(true);
        $results = $controller->go();

        $email = Mailer::getLastMail();
        $this->debug("Email contents: " . $email);
        $this->assertPattern('/test%20url%20with%20spaces/', $email, 'Spaces found in activation URL.');
    }