jawittdesigns
4/30/2017 - 11:39 AM

Set protected property for phpunit testing

Set protected property for phpunit testing

	public function set_protected_property( $object, $property, $value ) {
		$reflection = new ReflectionClass( $object );
		$reflection_property = $reflection->getProperty( $property );
		$reflection_property->setAccessible( true );
		$reflection_property->setValue( $object, $value );
	}