Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
RWebUserTest Class Reference

Public Member Functions

 testLogin ()
 testLoginWithoutUsername ()

Public Attributes

 $fixtures

Detailed Description

Gentics Portal.Node PHP Author & Copyright (c) by Gentics Software GmbH sales.nosp@m.@gen.nosp@m.tics..nosp@m.com http://www.gentics.com Licenses can be found in the LICENSE.txt file in the root-folder of this installation You must not use this software without a valid license agreement.

Definition at line 11 of file RWebUserTest.php.

Member Function Documentation

RWebUserTest::testLogin ( )

Login with authField => 'username' in configuration

Definition at line 20 of file RWebUserTest.php.

{
return;
Yii::app()->getModule('user')->authField = 'username';
$user = $this->users['sample1'];
$userIdentity = new UserIdentity($user['username'], $user['password_not_hashed']);
$this->assertTrue($userIdentity->authenticate());
Yii::app()->user->login($userIdentity);
$this->assertEquals($user['username'], Yii::app()->user->name);
$this->assertEquals($user['email'], Yii::app()->user->email);
}
RWebUserTest::testLoginWithoutUsername ( )

Login with authField => 'email' in configuration

Definition at line 37 of file RWebUserTest.php.

{
return;
Yii::app()->getModule('user')->authField = 'email';
$user = $this->users['sample4'];
$userIdentity = new UserIdentity($user['email'], $user['password_not_hashed']);
$this->assertTrue($userIdentity->authenticate());
Yii::app()->user->login($userIdentity);
$this->assertEquals($user['email'], Yii::app()->user->name);
$this->assertEquals($user['email'], Yii::app()->user->email);
}

Member Data Documentation

RWebUserTest::$fixtures
Initial value:
array(
'users' => 'User',
)

Definition at line 13 of file RWebUserTest.php.


The documentation for this class was generated from the following file: