<commit_before><?php
use Waynestate\Promotions\ParsePromos;

/**
 * Class ParsePromosTest
 */
class ParsePromosTest extends PHPUnit_Framework_TestCase {

    /**
     * @test
     */
    public function changeToGroupName()
    {
        // Create the parser
        $parser = new ParsePromos;

        // Stub Data
        $promos = array('promotions' => array(
            '1' => array (
                'promo_item_id' => '1',
                'promo_group_id' => '1',
                'data' => 'foo',
            ),
        ));
        $group_names = array(
            '1' => 'first',
        );

        // To the parse
        $parsed = $parser->parse($promos, $group_names);

        // Verify the array has been reorganized
        $this->assertArrayHasKey('first', $parsed);
    }

}<commit_msg>Limit to the first test.<commit_after><?php
use Waynestate\Promotions\ParsePromos;

/**
 * Class ParsePromosTest
 */
class ParsePromosTest extends PHPUnit_Framework_TestCase {

    /**
     * @var
     */
    protected $promos;

    /**
     * @var
     */
    protected $parser;

    /**
     * @var
     */
    protected $groups;

    /**
     *
     */
    protected function setUp()
    {
        // Create the parser
        $this->parser = new ParsePromos;

        // Stub group names
        $this->groups = array(
            '1' => 'one',
        );

        // Stub promotions
        $this->promos = array(
            'promotions' => array(
                '1' => array (
                    'promo_item_id' => '1',
                    'promo_group_id' => '1',
                    'data' => 'foo',
                ),
                '2' => array (
                    'promo_item_id' => '2',
                    'promo_group_id' => '1',
                    'data' => 'foo',
                ),
                '3' => array (
                    'promo_item_id' => '3',
                    'promo_group_id' => '1',
                    'data' => 'foo',
                ),
            )
        );
    }

    /**
     * @test
     */
    public function changeKeysToGroupName()
    {
        // Basic parse with no config
        $parsed = $this->parser->parse($this->promos, $this->groups);

        // Verify the array has been reorganized
        $this->assertArrayHasKey('one', $parsed);
    }

    /**
     * @test
     */
    public function shouldLimitOne()
    {
        // Group 'one' should only return the first item
        $config = array(
            'one' => 'first',
        );

        // Basic parse with no config
        $parsed = $this->parser->parse($this->promos, $this->groups, $config);
        
        // Verify there is only one element in the 'one' group
        $this->assertCount(1, $parsed['one']);
    }
}
{'fraction_non_alphanumeric': 0.14254545454545456, 'fraction_numerical': 0.005454545454545455, 'mean_word_length': 1.355308219178082, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '6783374', 'n_tokens_mistral': 827, 'n_tokens_neox': 795, 'n_words': 175}