示例#1
0
 public function testCorrectFindUser()
 {
     /*pd(array(
           $this->user('user1'),
           $this->userProfile('user1'),
           $this->userPrivilege('user1'),
           $this->authAssignment('user1')
       ));*/
     // @var $modelRegForm \common\models\RegForm
     $modelRegForm = new RegForm(['country_id' => 182, 'phone' => '79883332211', 'email' => '*****@*****.**', 'password' => 'some_password', 'password_repeat' => 'some_password']);
     $user = $modelRegForm->reg();
     $this->assertInstanceOf('common\\models\\User', $user, 'user should be valid');
     expect('username should be correct', $user->phone)->equals('79883332211');
     expect('email should be correct', $user->email)->equals('*****@*****.**');
     expect('password should be correct', $user->validatePassword('some_password'))->true();
 }