* 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'] ]);