<commit_before><?php

namespace KickAss\Commerce\Product\Map;

use PHPUnit\Framework\TestCase;

final class ProductTest extends TestCase
{
    public function testGetSku()
    {
        $product = new Product(
            'sample-sku'
        );
        $this->assertEquals('sample-sku', $product->getSku());
    }
}<commit_msg>Add test for the TypeError exception on Product map construct<commit_after><?php

namespace KickAss\Commerce\Product\Map;

use PHPUnit\Framework\TestCase;

final class ProductTest extends TestCase
{
    /**
     * @dataProvider providerTestGetSku
     */
    public function testGetSku($input, $expected)
    {
        $product = new Product(
            $input
        );
        $this->assertEquals($expected, $product->getSku());
    }

    public function providerTestGetSku()
    {
        return [
            ['sample-sku', 'sample-sku'],
            [123, '123'],
            [9.87, '9.87']
        ];
    }

    /**
     * @throws \PHPUnit\Framework\Exception
     * @dataProvider providerTestSkuType
     */
    public function testSkuType($sku)
    {
        $this->expectException(\TypeError::class);
        new Product(
            $sku
        );
    }

    public function providerTestSkuType()
    {
        return [
            [new \stdClass()],
            [['something']]
        ];
    }
}
{'fraction_non_alphanumeric': 0.12471994025392083, 'fraction_numerical': 0.008961911874533234, 'mean_word_length': 2.052391799544419, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '6181318', 'n_tokens_mistral': 402, 'n_tokens_neox': 391, 'n_words': 78}