mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 07:06:30 +02:00
e_signup_classTest and UserHandlerTest placeholders.
This commit is contained in:
155
tests/unit/UserHandlerTest.php
Normal file
155
tests/unit/UserHandlerTest.php
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* e107 website system
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008-2019 e107 Inc (e107.org)
|
||||||
|
* Released under the terms and conditions of the
|
||||||
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
class UserHandlerTest extends \Codeception\Test\Unit
|
||||||
|
{
|
||||||
|
|
||||||
|
/** @var UserHandler */
|
||||||
|
protected $usr;
|
||||||
|
|
||||||
|
protected function _before()
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$this->usr = $this->make('UserHandler');
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
$this->assertTrue(false, "Couldn't load UserHandler object");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public function testCheckPassword()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testDeleteExpired()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testIsPasswordRequired()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAddCommonClasses()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test__construct()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testResetPassword()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testMakeUserCookie()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testUserValidation()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testConvertPassword()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testHasReadonlyField()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testRehashPassword()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testNeedEmailPassword()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testHashPassword()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCanConvert()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCheckCHAP()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testUserClassUpdate()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetHashType()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGenerateUserLogin()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGenerateRandomString()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetDefaultHashType()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testPasswordAPIExists()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAddNonDefaulted()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetNiceNames()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testUserStatusUpdate()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
85
tests/unit/e_signup_classTest.php
Normal file
85
tests/unit/e_signup_classTest.php
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* e107 website system
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008-2019 e107 Inc (e107.org)
|
||||||
|
* Released under the terms and conditions of the
|
||||||
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
class e_signup_classTest extends \Codeception\Test\Unit
|
||||||
|
{
|
||||||
|
|
||||||
|
/** @var e_signup_class */
|
||||||
|
protected $sup;
|
||||||
|
|
||||||
|
protected function _before()
|
||||||
|
{
|
||||||
|
require_once(e_HANDLER."e_signup_class.php");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$this->sup = $this->make('e_signup_class');
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
$this->assertTrue(false, "Couldn't load e_signup_class object");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->sup->__construct();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testRenderEmailPreview()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test__construct()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testRender_after_signup()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testProcessActivationLink()
|
||||||
|
{
|
||||||
|
$sess = '1234567890';
|
||||||
|
$insert = array(
|
||||||
|
'user_id' => 0,
|
||||||
|
'user_name' => 'e_signup_class',
|
||||||
|
'user_loginname' => 'e_signup',
|
||||||
|
'user_email' => 'test@test.com',
|
||||||
|
'user_sess' => $sess,
|
||||||
|
'user_ban' => 1,
|
||||||
|
);
|
||||||
|
|
||||||
|
$num = e107::getDb()->insert('user', $insert);
|
||||||
|
|
||||||
|
$this->assertGreaterThan(0,$num);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$result = $this->sup->processActivationLink('activate.'.$num.'.'.$sess);
|
||||||
|
$this->assertEquals('success', $result);
|
||||||
|
|
||||||
|
$result = $this->sup->processActivationLink('activate.'.$num.'.'.$sess);
|
||||||
|
$this->assertEquals('exists', $result);
|
||||||
|
|
||||||
|
$result = $this->sup->processActivationLink('activate.999.'.$sess);
|
||||||
|
$this->assertEquals('invalid', $result);
|
||||||
|
|
||||||
|
$this->sup->processActivationLink('activate.999.'.$sess.".fr");
|
||||||
|
$this->assertEquals("Privacy Policy", LAN_SIGNUP_122, "Language file failed to load.");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user