<commit_before><?php

namespace SevenShores\Hubspot\Tests\Unit\Utils;

use SevenShores\Hubspot\Utils;

/**
 * @internal
 * @coversNothing
 */
class SignatureTest extends \PHPUnit\Framework\TestCase
{
    protected $secret = 'clientSecret';
    protected $requestBody = 'SomeBody';

    /** @test */
    public function validationHubspotSignatureValidData()
    {
        $result = Utils\Signature::isHubspotSignatureValid([
            'signature' => hash('sha256', $this->secret.$this->requestBody),
            'secret' => $this->secret,
            'requestBody' => $this->requestBody
        ]);

        $this->assertEquals(
            true,
            $result
        );
    }

    /** @test */
    public function validationHubspotSignatureInvalidData()
    {
        $result = Utils\Signature::isHubspotSignatureValid([
            'signature' => hash('sha256', $this->secret.$this->requestBody.'1'),
            'secret' => $this->secret,
            'requestBody' => $this->requestBody
        ]);

        $this->assertEquals(
            false,
            $result
        );
    }
}<commit_msg>fix tests<commit_after><?php

namespace SevenShores\Hubspot\Tests\Unit\Utils;

use SevenShores\Hubspot\Utils;

/**
 * @internal
 * @coversNothing
 */
class SignatureTest extends \PHPUnit\Framework\TestCase
{
    protected $secret = 'clientSecret';
    protected $requestBody = 'SomeBody';

    /** @test */
    public function validationHubspotSignatureValidData()
    {
        $result = Utils\Signature::isValid([
            'signature' => hash('sha256', $this->secret.$this->requestBody),
            'secret' => $this->secret,
            'requestBody' => $this->requestBody
        ]);

        $this->assertEquals(
            true,
            $result
        );
    }

    /** @test */
    public function validationHubspotSignatureInvalidData()
    {
        $result = Utils\Signature::isValid([
            'signature' => hash('sha256', $this->secret.$this->requestBody.'1'),
            'secret' => $this->secret,
            'requestBody' => $this->requestBody
        ]);

        $this->assertEquals(
            false,
            $result
        );
    }
}
{'fraction_non_alphanumeric': 0.1466544454628781, 'fraction_numerical': 0.006416131989000917, 'mean_word_length': 2.2008797653958942, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '5812531', 'n_tokens_mistral': 610, 'n_tokens_neox': 602, 'n_words': 99}