1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Tweak preg_replace, added randomKey() method test.

This commit is contained in:
Cameron
2019-03-19 12:17:30 -07:00
parent 863cb3858d
commit 81687565d6
2 changed files with 16 additions and 11 deletions

View File

@@ -23,7 +23,7 @@
foreach($tests as $var) foreach($tests as $var)
{ {
$result = preg_replace('/[^\w-:.]/', '', $var['text']); // this pattern used in parts of the admin-ui. $result = preg_replace('/[^\w\-:.]/', '', $var['text']); // this pattern used in parts of the admin-ui.
$this->assertEquals($var['expected'], $result); $this->assertEquals($var['expected'], $result);
//var_dump($result); //var_dump($result);
} }

View File

@@ -31,7 +31,7 @@
} }
public function testSave() /* public function testSave()
{ {
} }
@@ -39,7 +39,7 @@
public function testGetAdminEmail() public function testGetAdminEmail()
{ {
} }*/
public function testGetClassList() public function testGetClassList()
{ {
@@ -53,7 +53,7 @@
} }
public function testIsNewUser() /* public function testIsNewUser()
{ {
} }
@@ -151,14 +151,14 @@
public function testIsWritable() public function testIsWritable()
{ {
} }*/
public function testGetName() public function testGetName()
{ {
$result = $this->usr->getName(); $result = $this->usr->getName();
$this->assertEquals('e107', $result); $this->assertEquals('e107', $result);
} }
/*
public function testGetAdminPerms() public function testGetAdminPerms()
{ {
@@ -247,13 +247,18 @@
public function testGetExtendedModel() public function testGetExtendedModel()
{ {
} }*/
public function testRandomKey() public function testRandomKey()
{ {
$obj = $this->usr;
$result = $obj::randomKey();
$this->assertEquals(32,strlen($result));
} }
/*
public function testGetSignatureValue() public function testGetSignatureValue()
{ {
@@ -347,14 +352,14 @@
public function testGetLoginName() public function testGetLoginName()
{ {
} }*/
public function testIsBot() public function testIsBot()
{ {
$result = $this->usr->isBot(); $result = $this->usr->isBot();
$this->assertFalse($result); $this->assertFalse($result);
} }
/*
public function testSetExtended() public function testSetExtended()
{ {
@@ -369,7 +374,7 @@
{ {
} }
*/