1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-19 12:51:52 +02:00

Issue #5064 - Draft fix for user impersonation (getperms())

This commit is contained in:
camer0n
2023-09-08 14:18:06 -07:00
parent 1ef0cc3352
commit 44526b435c
5 changed files with 104 additions and 6 deletions

View File

@@ -11,8 +11,22 @@
class class2Test extends \Codeception\Test\Unit
{
public $usr;
/*protected function _before()
{
try
{
$this->usr = $this->make('e_user_model');
}
catch(Exception $e)
{
$this->fail( "Couldn't load e_user_model object");
}
e107::getUser()->load(1); // load user_id = 1.
}*/
function testLoadClass2()
{
@@ -23,6 +37,11 @@
function testGetPerms()
{
// $this->markTestSkipped("Skipped - CLI mode changes behavior.");
// See class2.php Line 1643
$result = getperms('N', '5');
$this->assertFalse($result);
$result = getperms('N', '0');
$this->assertTrue($result);
@@ -47,6 +66,12 @@
}
function testUserModel()
{
$result = e107::getUser();
var_dump($result);
}
function testCheckClass()

View File

@@ -17,7 +17,7 @@
catch(Exception $e)
{
$this->assertTrue(false, $e->getMessage());
$this->fail( $e->getMessage());
}
}