<commit_before><?php
namespace Objection\Setup;


use Objection\LiteSetup;
use Objection\Enum\VarType;


class ValueValidationTest extends \PHPUnit_Framework_TestCase
{
	public function test_fixValue_Scalars() 
	{
		$this->assertSame(1.0, ValueValidation::fixValue(LiteSetup::createDouble(), "1"));
		$this->assertSame(23, ValueValidation::fixValue(LiteSetup::createInt(), "23"));
		$this->assertSame("1", ValueValidation::fixValue(LiteSetup::createString(), 1));
		$this->assertSame(false, ValueValidation::fixValue(LiteSetup::createBool(), []));
			
		/* $this->assertSame(1.0, ValueValidation::fixValue(LiteSetup::createDouble(), 1));
		$this->assertSame(1.0, ValueValidation::fixValue(LiteSetup::createDouble(), 1));
		$this->assertSame(1.0, ValueValidation::fixValue(LiteSetup::createDouble(), 1));
		$this->assertSame(1.0, ValueValidation::fixValue(LiteSetup::createDouble(), 1));
		$this->assertSame(1.0, ValueValidation::fixValue(LiteSetup::createDouble(), 1)); */
	}
	
	public function test_fixValue_Array() 
	{
		$this->assertEquals([1], ValueValidation::fixValue(LiteSetup::createArray(), 1));
		$this->assertEquals([1, 2], ValueValidation::fixValue(LiteSetup::createArray(), [1, 2]));
	}
	
	public function test_fixValue_Mixed() 
	{
		$this->assertEquals($this, ValueValidation::fixValue(LiteSetup::createMixed(), $this));
	}
	
	
	public function test_fixValue_Enum() 
	{
		$this->assertSame('a', ValueValidation::fixValue(LiteSetup::createEnum(['a', 'b']), 'a'));
	}
	
	/**
	 * @expectedException \Objection\Exceptions\InvalidEnumValueTypeException
	 */
	public function test_fixValue_InvalidEnumValue_ThrowException() 
	{
		ValueValidation::fixValue(LiteSetup::createEnum(['a', 'b']), 'c');<commit_msg>Remove commented out code<commit_after><?php
namespace Objection\Setup;


use Objection\LiteSetup;
use Objection\Enum\VarType;


class ValueValidationTest extends \PHPUnit_Framework_TestCase
{
	public function test_fixValue_Scalars() 
	{
		$this->assertSame(1.0, ValueValidation::fixValue(LiteSetup::createDouble(), "1"));
		$this->assertSame(23, ValueValidation::fixValue(LiteSetup::createInt(), "23"));
		$this->assertSame("1", ValueValidation::fixValue(LiteSetup::createString(), 1));
		$this->assertSame(false, ValueValidation::fixValue(LiteSetup::createBool(), []));
	}
	
	public function test_fixValue_Array() 
	{
		$this->assertEquals([1], ValueValidation::fixValue(LiteSetup::createArray(), 1));
		$this->assertEquals([1, 2], ValueValidation::fixValue(LiteSetup::createArray(), [1, 2]));
	}
	
	public function test_fixValue_Mixed() 
	{
		$this->assertEquals($this, ValueValidation::fixValue(LiteSetup::createMixed(), $this));
	}
	
	
	public function test_fixValue_Enum() 
	{
		$this->assertSame('a', ValueValidation::fixValue(LiteSetup::createEnum(['a', 'b']), 'a'));
	}
	
	/**
	 * @expectedException \Objection\Exceptions\InvalidEnumValueTypeException
	 */
	public function test_fixValue_InvalidEnumValue_ThrowException() 
	{
		ValueValidation::fixValue(LiteSetup::createEnum(['a', 'b']), 'c');
{'fraction_non_alphanumeric': 0.1752235839682014, 'fraction_numerical': 0.014905597880092747, 'mean_word_length': 7.9614243323442135, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, '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': '815383', 'n_tokens_mistral': 1002, 'n_tokens_neox': 949, 'n_words': 131}