/** * @return void */ public function setUp() { parent::setUp(); $this->controller = $this->login->loadController('Register'); $this->controller->setProperties(array('activation' => false, 'preHooks' => '', 'postHooks' => '', 'submitVar' => 'unit-test-register-btn', 'submittedResourceId' => 1, 'usergroups' => '', 'validate' => 'nospam:blank')); $this->controller->loadDictionary(); }
/** * @return void */ public function setUp() { parent::setUp(); $this->controller = $this->login->loadController('Register'); $this->controller->setProperties(array('activation' => false, 'preHooks' => '', 'postHooks' => '', 'submitVar' => 'unit-test-register-btn', 'submittedResourceId' => 1, 'usernameField' => 'email', 'emailField' => 'email', 'validate' => 'nospam:blank')); $_POST = array('unit-test-register-btn' => 1, 'email' => '*****@*****.**', 'password' => '123456789', 'nospam' => ''); $this->controller->loadDictionary(); }
public function setUp() { parent::setUp(); $this->controller = $this->login->loadController('Register'); $this->user = $this->modx->newObject('modUser'); $this->user->fromArray(array('id' => 12345678, 'username' => 'unit.test.user', 'password' => md5('a test password'), 'cachepwd' => '', 'class_key' => 'modUser', 'active' => false, 'hash_class' => 'hashing.modMD5', 'salt' => '', 'primary_group' => 1)); $_POST = array('username' => 'unit.test.user', 'password' => 'a test password', 'password_confirm' => 'a test password', 'email' => LoginTestHarness::$properties['email'], 'nospam' => '', 'submitVar' => 'unit-test-register-btn'); $this->controller->setProperties(array('activation' => true, 'activationResourceId' => 1, 'activationEmailSubject' => 'Login Unit Test Activation Email', 'moderatedResourceId' => 1, 'preHooks' => '', 'postHooks' => '', 'submitVar' => 'unit-test-register-btn', 'submittedResourceId' => 1, 'usergroups' => '', 'validate' => 'nospam:blank')); $this->controller->loadDictionary(); }
/** * @return void */ public function setUp() { parent::setUp(); $this->controller = $this->login->loadController('Register'); $this->controller->setProperties(array('activation' => false, 'preHooks' => '', 'postHooks' => '', 'submitVar' => 'registerbtn', 'activationResourceId' => 1, 'activationEmailTpl' => $this->login->config['testsPath'] . 'Data/Register/5796-activation-email.chunk.tpl', 'activationEmailSubject' => 'Thanks for Registering!', 'submittedResourceId' => 1, 'validate' => 'nospam:blank, username:required:minLength=^6^, password:required:minLength=^6^, password_confirm:password_confirm=^password^, fullname:required, email:required:email', 'placeholderPrefix' => 'reg.')); $_POST = array('username' => 'unit-test-user-5796', 'registerbtn' => 1, 'email' => '', 'password' => '', 'nospam' => ''); $this->controller->loadDictionary(); }
/** * Assert email sending works * @return void */ public function testSendActivationEmail() { $this->controller->loadDictionary(); $sent = $this->processor->sendActivationEmail(); $this->assertTrue($sent); }