src/Context/ApiContext.php
public function addJwtToken($name, $secret, PyStringNode $payload) {
        $jwtMatcher = $this->arrayContainsComparator->getMatcherFunction('jwt');

        if (!($jwtMatcher instanceof JwtMatcher)) {
            throw new RuntimeException(sprintf(
                'Matcher registered for the @jwt() matcher function must be an instance of %s',
                JwtMatcher::class
            ));
        }

        $jwtMatcher->addToken($name, $this->jsonDecode((string) $payload), $secret);

        return $this;
    }
public function addJwtToken($name, $secret, PyStringNode $payload) {
        $jwtMatcher = $this->arrayContainsComparator->getMatcherFunction('jwt');

        if (!($jwtMatcher instanceof JwtMatcher)) {
            throw new RuntimeException(sprintf(
                'Matcher registered for the @jwt() matcher function must be an instance of %s',
                JwtMatcher::class
            ));
        }

        $jwtMatcher->addToken($name, $this->jsonDecode((string) $payload), $secret);

        return $this;
    }
public function addJwtToken ( $ name , $ secret , PyStringNode $ payload ) { $ jwtMatcher = $ this -> arrayContainsComparator -> getMatcherFunction ( 'jwt' ) ; if ( ! ( $ jwtMatcher instanceof JwtMatcher ) ) { throw new RuntimeException ( sprintf ( 'Matcher registered for the @jwt() matcher function must be an instance of %s' , JwtMatcher :: class ) ) ; } $ jwtMatcher -> addToken ( $ name , $ this -> jsonDecode ( ( string ) $ payload ) , $ secret ) ; return $ this ; }
Add a JWT token to the matcher

@param string $name String identifying the token
@param string $secret The secret used to sign the token
@param PyStringNode $payload The payload for the JWT
@throws RuntimeException
@return self

@Given the response body contains a JWT identified by :name, signed with :secret:
Add a JWT token to the matcher