<commit_before><?php
declare(strict_types = 1);
/**
 * /tests/Integration/Rest/UuidHelperTest.php
 *
 * @author TLe, <NAME> <<EMAIL>>
 */

namespace App\Tests\Integration\Rest;

use App\Rest\UuidHelper;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

/**
 * Class UuidHelperTest
 *
 * @package App\Tests\Integration\Rest
 * @author  TLe, <NAME> <<EMAIL>>
 */
class UuidHelperTest extends KernelTestCase
{
    public function testThatGetFactoryReturnsSameInstance(): void
    {
        $factory = UuidHelper::getFactory();

        self::assertSame($factory, UuidHelper::getFactory());
    }
}<commit_msg>tests: Added missing pure unit tests.<commit_after><?php
declare(strict_types = 1);
/**
 * /tests/Integration/Rest/UuidHelperTest.php
 *
 * @author TLe, <NAME> <<EMAIL>>
 */

namespace App\Tests\Integration\Rest;

use App\Rest\UuidHelper;
use Generator;
use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType;
use Ramsey\Uuid\Exception\InvalidUuidStringException;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Throwable;

/**
 * Class UuidHelperTest
 *
 * @package App\Tests\Integration\Rest
 * @author  TLe, <NAME> <<EMAIL>>
 */
class UuidHelperTest extends KernelTestCase
{
    public function testThatGetFactoryReturnsSameInstance(): void
    {
        $factory = UuidHelper::getFactory();

        self::assertSame($factory, UuidHelper::getFactory());
    }

    /**
     * @dataProvider dataProviderTestThatGetTypeReturnsExpected
     *
     * @param string|null $expected
     * @param string      $value
     *
     * @testdox test that `getType` method returns `$expected` with `$value` value.
     */
    public function testThatGetTypeReturnsExpected(?string $expected, string $value): void
    {
        static::assertSame($expected, UuidHelper::getType($value));
    }

    public function testThatGetBytesThrowsAnExceptionWithNonUuidValue(): void
    {
        $this->expectException(InvalidUuidStringException::class);

        UuidHelper::getBytes('foobar');
    }

    /**
     * @throws Throwable
     */
    public function testThatGetBytesReturnsExpected(): void
    {
        $factory = UuidHelper::getFactory();
        $uuid = $factory->uuid1();

        static::assertSame($uuid->getBytes(), UuidHelper::getBytes($uuid->toString()));
    }

    /**
     * @return Generator
     *
     * @throws Throwable
     */
    public function dataProviderTestThatGetTypeReturnsExpected(): Generator
    {
        yield [null, 'foo'];

        yield [UuidBinaryOrderedTimeType::NAME, UuidHelper::getFactory()->uuid1()->toString()];
    }
}
{'fraction_non_alphanumeric': 0.13281553398058252, 'fraction_numerical': 0.0015533980582524273, 'mean_word_length': 3.717948717948718, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, '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': '2127765', 'n_tokens_mistral': 779, 'n_tokens_neox': 763, 'n_words': 140}