Lcobucci\JWT\ParserTest::parseMustReturnANonSignedTokenWhenSignatureAlgorithmIsMissing PHP Метод

parseMustReturnANonSignedTokenWhenSignatureAlgorithmIsMissing() публичный Метод

    public function parseMustReturnANonSignedTokenWhenSignatureAlgorithmIsMissing()
    {
        $this->decoder->expects($this->at(0))->method('base64UrlDecode')->with('a')->willReturn('a_dec');
        $this->decoder->expects($this->at(1))->method('jsonDecode')->with('a_dec')->willReturn(['typ' => 'JWT']);
        $this->decoder->expects($this->at(2))->method('base64UrlDecode')->with('b')->willReturn('b_dec');
        $this->decoder->expects($this->at(3))->method('jsonDecode')->with('b_dec')->willReturn(['aud' => 'test']);
        $parser = $this->createParser();
        $token = $parser->parse('a.b.c');
        self::assertAttributeEquals(['typ' => 'JWT'], 'headers', $token);
        self::assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $token);
        self::assertAttributeEquals(null, 'signature', $token);
        self::assertAttributeEquals(['a', 'b'], 'payload', $token);
    }