本文整理汇总了PHP中UserFactory::createUserWithoutVerify方法的典型用法代码示例。如果您正苦于以下问题:PHP UserFactory::createUserWithoutVerify方法的具体用法?PHP UserFactory::createUserWithoutVerify怎么用?PHP UserFactory::createUserWithoutVerify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserFactory
的用法示例。
在下文中一共展示了UserFactory::createUserWithoutVerify方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLogin
public function testLogin()
{
// Turn off sending email on usere creation
UserController::$sendEmailOnVerify = false;
// Create a user
$contestant = UserFactory::createUserWithoutVerify();
// Open index
$this->open('/');
// Click in Iniciar Sesion
$this->clickAndWait('link=Inicia sesion');
// Type login data
$this->type('user', $contestant->getUsername());
$this->type('pass', $contestant->getPassword());
// Click inicia sesion
$this->clickAndWait("//input[@value='Inicia sesion']");
// Wait for message
$this->waitForElementPresent('//*[@id="content"]/div[2]/div');
$this->assertElementContainsText('//*[@id="content"]/div[2]/div', 'Your email is not verified yet. Please check your e-mail.');
// Go to verification page and wait for redirection to login page
$this->open('/api/user/verifyemail/id/' . $contestant->getVerificationId());
$this->waitForElementPresent('//*[@id="content"]/div[2]/div[1]/h1');
// Type login data
$this->type('user', $contestant->getUsername());
$this->type('pass', $contestant->getPassword());
// Click inicia sesion
$this->clickAndWait("//input[@value='Inicia sesion']");
// Sanity check that we are logged in
$this->waitForElementPresent('//*[@id="wrapper"]/div[1]/a');
$this->assertElementContainsText('//*[@id="wrapper"]/div[1]/a', $contestant->getUsername());
}