1
0
Fork 0

moved get_guid to System::createGUID

This commit is contained in:
Philipp Holzer 2018-07-09 21:38:16 +02:00
commit c829e43725
No known key found for this signature in database
GPG key ID: 58160D7D6AF942B6
21 changed files with 105 additions and 88 deletions

View 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);
}
}