<commit_before><?php

use App\Libraries\Calculator;

class CalculatorTest extends PHPUnit_Framework_TestCase 
{
	public function testAdd() {
		$c = new Calculator;

		$values = [
			# integer numbers
			[0, 0, 0],
			[1, 0, 1],
			[2, 1, 1],
			[0, 1, -1],
			[-1, 0, -1],
			[-2, -1, -1],
			[60000, 30000, 30000],
			[-60000, -30000, -30000],

			# non integer numbers
			[2.8, 1.5, 1.3]
		];

		foreach ($values as $v) {
			$this->assertEquals($v[0], $c->add($v[1], $v[2]));
		}
	}

	public function testSubtract()
	{
		$c = new Calculator;

		$values = [
			# integer number
			[0, 0, 0],
			[-1, 0, 1],
			[0, 1, 1],
			[2, 1, -1],
			[1, 0, -1],
			[0, -1, -1],
			[0, 30000, 30000],
			[0, -30000, -30000],
			[60000, 30000, -30000],

			# non integer numbers
			[0.2, 1.5, 1.3]
		];

		foreach ($values as $v) {
			$this->assertEquals($v[0], $c->subtract($v[1], $v[2]));
		}
	}

	/**
	 * @expectedException InvalidArgumentException
	 */
	public function testThrowsExceptionIfNonNumberIsPassed()
	{
		$c = new Calculator;
		$c->add('a', array());
	}
}<commit_msg>Adding phpunit dataProvider<commit_after><?php

use App\Libraries\Calculator;

class CalculatorTest extends PHPUnit_Framework_TestCase 
{
	public function inputForTestAdd()
	{
		return [
			# integer numbers
			[0, 0, 0],
			[1, 0, 1],
			[2, 1, 1],
			[0, 1, -1],
			[-1, 0, -1],
			[-2, -1, -1],
			[60000, 30000, 30000],
			[-60000, -30000, -30000],

			# non integer numbers
			[2.8, 1.5, 1.3]
		];
	}

	/**
	 * @dataProvider inputForTestAdd
	 */
	public function testAdd($result, $a, $b) 
	{
		$c = new Calculator;
		$this->assertEquals($result, $c->add($a, $b));
	}




	public function inputFortestSubtract()
	{
	    return [
	        # integer number
	        [0, 0, 0],
	        [-1, 0, 1],
	        [0, 1, 1],
	        [2, 1, -1],
	        [1, 0, -1],
	        [0, -1, -1],
	        [0, 30000, 30000],
	        [0, -30000, -30000],
	        [60000, 30000, -30000],

	        # non integer numbers
	        [0.2, 1.5, 1.3]
	    ];
	}

	/**
	 * @dataProvider inputFortestSubtract
	 */
	public function testSubtract($result, $a, $b)
	{
		$c = new Calculator;
		$this->assertEquals($result, $c->subtract($a, $b));
	}
}
{'fraction_non_alphanumeric': 0.20464904284412033, 'fraction_numerical': 0.10756608933454877, 'mean_word_length': 2.3257575757575757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '777848', 'n_tokens_mistral': 1177, 'n_tokens_neox': 908, 'n_words': 222}