Commits

kenjis committed b621085

update test_form_prep_bug.php

Comments (0)

Files changed (1)

application/controllers/tests/test_form_prep_bug.php

 	
 	function setup()
 	{
-		// reset Form validation class data
-		$this->form_validation->_field_data = array();
-		$this->form_validation->_error_array = array();
-		$this->form_validation->_safe_form_data = FALSE;
+		// reset Form validation class protected properties
+		$reflectionClass = new ReflectionClass('CI_Form_validation');
+		$data = array(
+						'_field_data' => array(),
+						'_error_array' => array(),
+						'_safe_form_data' => FALSE
+				);
+		foreach ($data as $property => $value)
+		{
+			$reflectionProperty = $reflectionClass->getProperty($property);
+			$reflectionProperty->setAccessible(TRUE);
+			$reflectionProperty->setValue($this->form_validation, $value);
+		}
 	}
 	
 	function test_form_input_set_value_array()