moved get_guid to System::createGUID
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user