mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore.git
synced 2026-01-15 05:05:04 +08:00
33 lines
772 B
PHP
33 lines
772 B
PHP
<?php
|
|
/**
|
|
* Base64WrapperTest.php@HDK-Core
|
|
*
|
|
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
|
* Powered by PhpStorm
|
|
* Created on 2022/12/20
|
|
*/
|
|
|
|
namespace Singularity\HDK\Test\Core\Unit;
|
|
|
|
use Singularity\HDK\Core\Service\Base64Wrapper;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
it('assertions base64 wrapper ENCODE', function(string $source, string $expected) {
|
|
$encoded = (new Base64Wrapper())->encode($source);
|
|
|
|
expect($expected)->toBe($encoded);
|
|
})->with([
|
|
['abc==', 'abc'],
|
|
['=ccc=', 'ccc'],
|
|
['YWJ/+j', 'YWJ_-j']
|
|
]);
|
|
|
|
it('assertions base64 wrapper DECODE', function(string $source, string $expected) {
|
|
$decoded = (new Base64Wrapper())->decode($source);
|
|
|
|
expect($expected)->toBe($decoded);
|
|
})->with([
|
|
['abc', 'abc'],
|
|
['YWJ_-j', 'YWJ/+j']
|
|
]);
|