mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-28 19:18:58 -04:00
- Rename tests/helpers/ to tests/Helpers/ and add Tests\Helpers namespace - Move CI3SecretConverterTest into tests/Libraries/ to eliminate duplicate case-conflict directory - Map Config\ in composer.json PSR-4 autoloading - Remove obsolete PHP 7 polyfill (random_compat) and redundant laminas-escaper - Clean up unused dev dependencies (fakerphp, vfsstream, predis) and update tooling - Safeguard table prefix restoration in migration_helper and reset config mock in LocaleHelperTest
28 lines
707 B
PHP
28 lines
707 B
PHP
<?php
|
|
|
|
namespace Tests\Helpers;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class UrlHelperTest extends TestCase
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
// Include the url_helper.php file
|
|
require_once __DIR__ . '/../../app/Helpers/url_helper.php';
|
|
}
|
|
|
|
public function testBase64urlEncode(): void
|
|
{
|
|
$data = 'Test data';
|
|
$encoded = base64url_encode($data);
|
|
|
|
// Assert that the encoded string is URL-safe
|
|
$this->assertMatchesRegularExpression('/^[A-Za-z0-9\-_]+$/', $encoded);
|
|
|
|
// Assert that decoding the encoded string returns the original data
|
|
$decoded = base64url_decode($encoded);
|
|
$this->assertEquals($data, $decoded);
|
|
}
|
|
}
|