Lcobucci\JWT\Signer\Ecdsa\EccAdapterTest::createHashShouldReturnASerializedSignature PHP Метод

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

    public function createHashShouldReturnASerializedSignature()
    {
        $key = $this->createMock(PrivateKeyInterface::class);
        $point = $this->createMock(GeneratorPoint::class);
        $signature = $this->createMock(SignatureInterface::class);
        $order = gmp_init(1, 10);
        $randomK = gmp_init(2, 10);
        $signingHash = gmp_init(3, 10);
        $key->method('getPoint')->willReturn($point);
        $point->method('getOrder')->willReturn($order);
        $this->numberGenerator->expects($this->once())->method('generate')->with($order)->willReturn($randomK);
        $this->signer->expects($this->once())->method('sign')->with($key, $signingHash, $randomK)->willReturn($signature);
        $this->serializer->expects($this->once())->method('serialize')->with($signature, 'sha256')->willReturn('serialized_signature');
        $adapter = $this->createAdapter();
        self::assertEquals('serialized_signature', $adapter->createHash($key, $signingHash, 'sha256'));
    }