<commit_before><?php

declare(strict_types = 1);

use PHPUnit\Framework\TestCase;
use Sop\JWX\JWT\Claim\AudienceClaim;
use Sop\JWX\JWT\Claim\Claim;
use Sop\JWX\JWT\Claim\RegisteredClaim;

/**
 * @group jwt
 * @group claim
 *
 * @internal
 */
class AudienceClaimTest extends TestCase
{
    const VALUE_SINGLE = 'audience';
    
    const VALUE_MANY = ['audience #1', 'audience #2'];

    public function testCreate()
    {
        $claim = new AudienceClaim(self::VALUE_SINGLE);
        $this->assertInstanceOf(AudienceClaim::class, $claim);
        return $claim;
    }

    /**
     * @depends testCreate
     *
     * @param Claim $claim
     */
    public function testClaimName(Claim $claim)
    {
        $this->assertEquals(RegisteredClaim::NAME_AUDIENCE, $claim->name());
    }

    /**
     * @dataProvider validateProvider
     *
     * @param mixed $value
     * @param mixed $constraint
     * @param mixed $result
     */
    public function testValidate($value, $constraint, $result)
    {
        $claim = AudienceClaim::fromJSONValue($value);
        $this->assertEquals($result, $claim->validate($constraint));
    }<commit_msg>Apply formatting<commit_after><?php

declare(strict_types = 1);

use PHPUnit\Framework\TestCase;
use Sop\JWX\JWT\Claim\AudienceClaim;
use Sop\JWX\JWT\Claim\Claim;
use Sop\JWX\JWT\Claim\RegisteredClaim;

/**
 * @group jwt
 * @group claim
 *
 * @internal
 */
class AudienceClaimTest extends TestCase
{
    const VALUE_SINGLE = 'audience';

    const VALUE_MANY = ['audience #1', 'audience #2'];

    public function testCreate()
    {
        $claim = new AudienceClaim(self::VALUE_SINGLE);
        $this->assertInstanceOf(AudienceClaim::class, $claim);
        return $claim;
    }

    /**
     * @depends testCreate
     *
     * @param Claim $claim
     */
    public function testClaimName(Claim $claim)
    {
        $this->assertEquals(RegisteredClaim::NAME_AUDIENCE, $claim->name());
    }

    /**
     * @dataProvider validateProvider
     *
     * @param mixed $value
     * @param mixed $constraint
     * @param mixed $result
     */
    public function testValidate($value, $constraint, $result)
    {
        $claim = AudienceClaim::fromJSONValue($value);
        $this->assertEquals($result, $claim->validate($constraint));
    }
{'fraction_non_alphanumeric': 0.1364232619151727, 'fraction_numerical': 0.0026235242675994755, 'mean_word_length': 2.958477508650519, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7577419', 'n_tokens_mistral': 734, 'n_tokens_neox': 726, 'n_words': 141}