/**
  * @dataProvider invalidDataProvider
  */
 public function testInvalid($scenario, $attributes, $errors)
 {
     $form = new models\PasswordForm($scenario);
     $form->setIdentity(User::findOne(['username' => 'neo']));
     $form->setAttributes($attributes);
     $this->assertFalse($form->validate());
     $this->assertEquals($errors, $form->getErrors());
 }
Beispiel #2
0
 public function testVerifyEmail()
 {
     $fake = new User();
     $fake->setAttributes(['id' => 999, 'username' => 'fake2', 'password' => 'Test1233', 'email' => '*****@*****.**'], false);
     $this->assertTrue($fake->verifyEmail());
     $identity = User::find(['username' => 'neo']);
     $this->assertTrue($identity->verifyEmail());
 }