Files
Phraseanet/lib/unitTest/Session/Authentication/Session_Authentication_NativeTest.php
Romain Neutron 4c5b7eb658 V 3.5 RC 1
2011-12-05 00:23:28 +01:00

59 lines
1.3 KiB
PHP

<?php
require_once dirname(__FILE__) . '/../../PhraseanetPHPUnitAbstract.class.inc';
/**
* Test class for Session_Authentication_Native.
* Generated by PHPUnit on 2011-08-02 at 15:48:08.
*/
class Session_Authentication_NativeTest extends PhraseanetPHPUnitAbstract
{
/**
* @var Session_Authentication_Native
*/
protected $object;
protected $local_user;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
public function setUp()
{
$login = 'testlogin';
$password = 'testpassword';
$usr_id = User_Adapter::get_usr_id_from_login($login);
if ($usr_id)
{
$this->local_user = User_Adapter::getInstance($usr_id, appbox::get_instance());
}
else
{
$this->local_user = User_Adapter::create(appbox::get_instance(), $login, $password, null, false);
}
$this->object = new Session_Authentication_Native(appbox::get_instance(), $login, $password);
}
public function tearDown()
{
$this->local_user->delete();
}
public function testSet_captcha_challenge()
{
$this->object->set_captcha_challenge(false);
}
public function testSignOn()
{
$user = $this->object->signOn();
$this->assertInstanceOf('User_Adapter', $user);
}
}
?>