Files
BudsieBuds 35fc07e201 refactor(tests): normalize test namespaces to PSR-4 and clean up composer dependencies (#4758)
- 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
2026-10-21 19:01:03 +04:00

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);
}
}