moved get_guid to System::createGUID
This commit is contained in:
parent
3a179860e5
commit
c829e43725
21 changed files with 105 additions and 88 deletions
25
tests/src/Core/SystemTest.php
Normal file
25
tests/src/Core/SystemTest.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Test\src\Core;
|
||||
|
||||
use Friendica\Core\System;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SystemTest extends TestCase
|
||||
{
|
||||
private function assertGuid($guid, $length)
|
||||
{
|
||||
$this->assertRegExp("/^[a-z0-9]{" . $length . "}?$/", $guid);
|
||||
}
|
||||
|
||||
function testGuidWithoutParameter()
|
||||
{
|
||||
$guid = System::createGUID();
|
||||
$this->assertGuid($guid, 16);
|
||||
}
|
||||
|
||||
function testGuidWithSize() {
|
||||
$guid = System::createGUID(20);
|
||||
$this->assertGuid($guid, 20);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue