moved get_guid to System::createGUID
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace Friendica\Test\src\Core\Cache;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Test\DatabaseTest;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
@@ -18,20 +16,8 @@ abstract class CacheTest extends DatabaseTest
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
global $a;
|
||||
parent::setUp();
|
||||
$this->instance = $this->getInstance();
|
||||
|
||||
// Reusable App object
|
||||
$this->app = new App(__DIR__.'/../');
|
||||
$a = $this->app;
|
||||
|
||||
// Default config
|
||||
Config::set('config', 'hostname', 'localhost');
|
||||
Config::set('system', 'throttle_limit_day', 100);
|
||||
Config::set('system', 'throttle_limit_week', 100);
|
||||
Config::set('system', 'throttle_limit_month', 100);
|
||||
Config::set('system', 'theme', 'system_theme');
|
||||
}
|
||||
|
||||
function testSimple() {
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
|
||||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Test\DatabaseTest;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class LockTest extends DatabaseTest
|
||||
{
|
||||
@@ -18,20 +15,8 @@ abstract class LockTest extends DatabaseTest
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
global $a;
|
||||
parent::setUp();
|
||||
$this->instance = $this->getInstance();
|
||||
|
||||
// Reusable App object
|
||||
$this->app = new App(__DIR__.'/../');
|
||||
$a = $this->app;
|
||||
|
||||
// Default config
|
||||
Config::set('config', 'hostname', 'localhost');
|
||||
Config::set('system', 'throttle_limit_day', 100);
|
||||
Config::set('system', 'throttle_limit_week', 100);
|
||||
Config::set('system', 'throttle_limit_month', 100);
|
||||
Config::set('system', 'theme', 'system_theme');
|
||||
}
|
||||
|
||||
public function testLock() {
|
||||
|
||||
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