]> git.mxchange.org Git - friendica.git/blob - tests/src/Core/SystemTest.php
189e880107d00102e10b97565195c5ff2296f5b4
[friendica.git] / tests / src / Core / SystemTest.php
1 <?php
2
3 namespace Friendica\Test\src\Core;
4
5 use Friendica\Core\System;
6 use PHPUnit\Framework\TestCase;
7
8 class SystemTest extends TestCase
9 {
10         private function assertGuid($guid, $length)
11         {
12                 $this->assertRegExp("/^[a-z0-9]{" . $length . "}?$/", $guid);
13         }
14
15         function testGuidWithoutParameter()
16         {
17                 $guid = System::createGUID();
18                 $this->assertGuid($guid, 16);
19         }
20
21         function testGuidWithSize() {
22                 $guid = System::createGUID(20);
23                 $this->assertGuid($guid, 20);
24         }
25 }