On Nov 24, 8:24 am, Ian MacLennan <
ian.maclen...@joomla.org> wrote:
> Hmmm... I may have misspoke, because the old values of course get rendered
> in the form.
>
> Here's what happens:
> $param = new JParameter($data, $xmlFilePath);
> echo $param->render();
> render:
> calls getParams()
> getParams
> iterates through the children of the
> specified group and invokes getParam
> getParam
> loads the proper element type
> calls its own get method
> (which is inherited from JRegistry) to retrieve its value
> invokes the JParameterType
> render method to return the HTML for the parameter
> getParams then pieces those all together to
> render the final form
But the question is about JUser::getParameters, not getParam or
getParams (the latter isn't part of JUser, anyway). I've seen,
understood and already tested getParam; I can't write tests for
getParameters until I understand what it's supposed to be doing, and
so far it seems to me it does nothing at all that anything else uses.
And the question possibly gets more complicated when I note that I
have as yet been completely unable to find a single example of this
call "in the wild" so I could learn from it.
JUser::setParameters stores a new parameter object in the user object,
so that's pretty clear, even if it also is not used anywhere in Joomla
that I've been able to discover. But the function and purpose for the
getParameters method completely escapes me.
I honestly don't understand why either of those methods exist, but I
think I can at least write a reasonable test for setParameters. I
can't begin to test getParameters until I can figure out what it's
supposed to be used for.