]> git.mxchange.org Git - friendica.git/blob - tests/src/Core/SystemTest.php
acb9d32d3e89c08682b362612171dfdd2d332b00
[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                 print $guid;
13                 $this->assertRegExp("/^[a-z0-9]{" . $length . "}?$/", $guid);
14         }
15
16         function testGuidWithoutParameter()
17         {
18                 $guid = System::createGUID();
19                 $this->assertGuid($guid, 16);
20         }
21
22         function testGuidWithSize32() {
23                 $guid = System::createGUID(32);
24                 $this->assertGuid($guid, 32);
25         }
26
27         function testGuidWithSize64() {
28                 $guid = System::createGUID(64);
29                 $this->assertGuid($guid, 64);
30         }
31 }