芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/joolsmen.com/vendor/lcobucci/jwt/test/unit/Parsing/EncoderTest.php
* @since 0.1.0 */ class EncoderTest extends \PHPUnit\Framework\TestCase { /** * @test * * @covers Lcobucci\JWT\Parsing\Encoder::jsonEncode */ public function jsonEncodeMustReturnAJSONString() { $encoder = new Encoder(); $this->assertEquals('{"test":"test"}', $encoder->jsonEncode(['test' => 'test'])); } /** * @test * * @covers Lcobucci\JWT\Parsing\Encoder::jsonEncode * * @expectedException \RuntimeException */ public function jsonEncodeMustRaiseExceptionWhenAnErrorHasOccured() { $encoder = new Encoder(); $encoder->jsonEncode("\xB1\x31"); } /** * @test * * @covers Lcobucci\JWT\Parsing\Encoder::base64UrlEncode */ public function base64UrlEncodeMustReturnAnUrlSafeBase64() { $data = base64_decode('0MB2wKB+L3yvIdzeggmJ+5WOSLaRLTUPXbpzqUe0yuo='); $encoder = new Encoder(); $this->assertEquals('0MB2wKB-L3yvIdzeggmJ-5WOSLaRLTUPXbpzqUe0yuo', $encoder->base64UrlEncode($data)); } }