getTestInstance('', '', $value); if (null !== $value) { self::assertEquals($value, $instance->getValue()); } else { self::assertNull($instance->getValue()); } } public static function validValueDataProvider() { return [ [null], [''], ['value'], [['test']], [new stdClass()], [new DateTime()], ]; } protected function getTestInstance($message, $property, $value = null): InvalidPropertyValueException { return new InvalidPropertyValueException($message, 0, $property, $value); } }