mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
fix tests
This commit is contained in:
parent
662651236e
commit
650789ba16
|
|
@ -193,7 +193,9 @@ final class EncryptionHelper
|
|||
continue;
|
||||
}
|
||||
|
||||
$ciphertext = \mb_substr($buffer, \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit');
|
||||
// $ciphertext = \mb_substr($buffer, \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit'); Not required due to previous nonce fread
|
||||
|
||||
$ciphertext = $buffer;
|
||||
$plaintext = \sodium_crypto_secretbox_open($ciphertext, $nonce, $secretKey);
|
||||
|
||||
if ($plaintext === false) {
|
||||
|
|
|
|||
|
|
@ -92,8 +92,18 @@ final class PhpCode
|
|||
*/
|
||||
public static function hasUnicode(string $source) : bool
|
||||
{
|
||||
return ((bool) \preg_match("/[\x01-\x7f]/", $source))
|
||||
|| ((bool) \preg_match("/(0|\\\)x([a-fA-F0-9]){2}/", $source));
|
||||
$length = \mb_strlen($source, 'UTF-8');
|
||||
|
||||
for ($i = 0; $i < $length; ++$i) {
|
||||
$char = \mb_substr($source, $i, 1, 'UTF-8');
|
||||
$codePoint = \ord($char);
|
||||
|
||||
if ($codePoint > 127) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -104,8 +104,6 @@ class SpreadsheetDatabaseMapper implements IODatabaseMapper
|
|||
$cells[] = $workSheet->getCell(StringUtils::intToAlphabet($j) . $line)->getCalculatedValue();
|
||||
}
|
||||
|
||||
\var_dump($cells);
|
||||
|
||||
++$line;
|
||||
|
||||
$query->values(...$cells);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ declare(strict_types=1);
|
|||
namespace phpOMS\tests\Router;
|
||||
|
||||
use phpOMS\Account\Account;
|
||||
use phpOMS\Account\NullAccount;
|
||||
use phpOMS\Account\PermissionAbstract;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Router\RouteVerb;
|
||||
|
|
@ -134,7 +135,7 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase
|
|||
PermissionType::READ
|
||||
) extends PermissionAbstract {};
|
||||
|
||||
$account = new Account();
|
||||
$account = new NullAccount(1);
|
||||
$account->addPermission($perm);
|
||||
|
||||
self::assertEquals(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user