<commit_before><?php

use Danzabar\Config\Collections\CollectionResults;

/**
 * Test Case for the Collection Results class
 *
 * @package Config
 * @subpackage Test
 * @author <NAME>
 */
class CollectionResultTest extends \PHPUnit_Framework_TestCase
{
	/**
	 * Testing array access methods
	 *
	 * @return void
	 * @author <NAME>
	 */
	public function test_arrayAccess()
	{
		$res = new CollectionResults(['foo' => 'bar' ]);
		$res['test'] = 'value';
		$res[] = 'zim';

		$this->assertTrue(isset($res['foo']));
		$this->assertEquals('bar', $res['foo']);
		$this->assertEquals('value', $res['test']);
		$this->assertEquals('zim', $res[0]);

		unset($res['foo']);

		$this->assertFalse(isset($res['foo']));
	}

	/**
	 * Test iteration methods
	 *
	 * @return void
	 * @author <NAME>
	 */
	public function test_iterator()
	{
		$res = new CollectionResults([1 => 1, 2 => 2, 3 => 3]);

		$this->assertEquals(3, $res->count());
		$this->assertEquals(1, $res->current());
		$this->assertEquals(1, $res->key());
		$this->assertEquals(2, $res->next());
<commit_msg>Last missing tests<commit_after><?php

use Danzabar\Config\Collections\CollectionResults;

/**
 * Test Case for the Collection Results class
 *
 * @package Config
 * @subpackage Test
 * @author <NAME>
 */
class CollectionResultTest extends \PHPUnit_Framework_TestCase
{
	/**
	 * Testing array access methods
	 *
	 * @return void
	 * @author <NAME>
	 */
	public function test_arrayAccess()
	{
		$res = new CollectionResults(['foo' => 'bar' ]);
		$res['test'] = 'value';
		$res[] = 'zim';

		$this->assertTrue(isset($res['foo']));
		$this->assertEquals('bar', $res['foo']);
		$this->assertEquals('value', $res['test']);
		$this->assertEquals('zim', $res[0]);

		unset($res['foo']);

		$this->assertFalse(isset($res['foo']));
		$this->assertTrue($res->valid('test'));
	}

	/**
	 * Test iteration methods
	 *
	 * @return void
	 * @author <NAME>
	 */
	public function test_iterator()
	{
		$res = new CollectionResults([1 => 1, 2 => 2, 3 => 3]);

		$this->assertEquals(3, $res->count());
		$this->assertEquals(1, $res->current());
		$this->assertEquals(1, $res->key());
		$this->assertEquals(2, $res->next());

{'fraction_non_alphanumeric': 0.2142526608051828, 'fraction_numerical': 0.01018047200370199, 'mean_word_length': 4.378109452736318, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 45, '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': '1358047', 'n_tokens_mistral': 777, 'n_tokens_neox': 708, 'n_words': 151}