<commit_before><commit_msg>added test for pokedex model<commit_after><?php
namespace Atog\PHPokemon\Models;

use Illuminate\Support\Collection;

/**
 * Class PokedexTest
 * @package Atog\PHPokemon\Models
 */
class PokedexTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Atog\PHPokemon\Models\Pokemon
     */
    protected $model;

    /**
     * Setup
     */
    public function setUp()
    {
        $this->model = new Pokedex();
    }

    /**
     * @dataProvider pkmn
     * @param $pkmn
     */
    public function testSetPokemonAttributeIsCollection($pkmn)
    {
        $this->model->setPokemonAttribute($pkmn);
        $this->assertInstanceOf(Collection::class, $this->model->pokemon);
    }

    /**
     * @dataProvider pkmn
     * @depends testSetPokemonAttributeIsCollection
     * @param $pkmn
     * @param $items
     */
    public function testSetPokemonCollectionItemsCount($pkmn, $items)
    {
        $this->model->setPokemonAttribute($pkmn);
        $this->assertCount($items, $this->model->pokemon);
    }

    public function pkmn()
    {
        return [
            'non-empty' => [[['name' => 'A'], ['name' => 'B']], 2],
            'empty' => [[], 0],
        ];
    }
}
{'fraction_non_alphanumeric': 0.15181518151815182, 'fraction_numerical': 0.0016501650165016502, 'mean_word_length': 2.4362606232294617, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 18, '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': '334160', 'n_tokens_mistral': 406, 'n_tokens_neox': 402, 'n_words': 65}