UserTest.php 503 Bytes
Newer Older
JULIO JARAMILLO's avatar
JULIO JARAMILLO committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<?php

class UserTest extends CDbTestCase
{
	public $fixtures=array(
		'users'=>'User',
	);

	public function testValidatePassword()
	{
		$this->assertTrue($this->users(0)->validatePassword('demo'));
		$this->assertFalse($this->users(0)->validatePassword('wrong'));

	}

	public function testChangePassword()
	{
		$user=$this->users(0);
		$user->password=$user->hashPassword('newpwd');
		$this->assertFalse($user->validatePassword('demo'));
		$this->assertTrue($user->validatePassword('newpwd'));

	}
}