html-formhandler
html-formhandler copied to clipboard
TextCSV field type appears to be broken?
Changing t/fields/textcsv.t thusly:
-$form->process( init_object => $init_obj );
+ok($form->process( init_object => $init_obj ), 'form processed without errors');
-$form->process( $params );
+ok($form->process( $params ), 'form processed without errors');
results in test output:
ok 1
not ok 2 - form processed without errors
# Failed test 'form processed without errors'
# at t/fields/textcsv.t line 20.
ok 3 - fif is correct
ok 4 - rendering worked
ok 5 - form processed without errors
ok 6 - fif ok
ok 7 - right value
ok 8 - rendering worked
1..8
# Looks like you failed 1 test of 8.
Field inflation/deflation is really confusing, so I'm not sure what is going
wrong here -- and I'm not sure what TextCSV is expecting as an input value
when called as $form->process(init_obj => ...) vs $form->process($hash) --
does it want a string or a listref? I'm having difficulty getting anything
to validate.
That failure is because $form->process doesn’t return a positive result ($form->validated) when validation hasn’t been run, i.e. there are no params.
On Mon, Oct 17, 2016 at 6:39 PM, Karen Etheridge [email protected] wrote:
Changing t/fields/textcsv.t thusly:
-$form->process( init_object => $init_obj ); +ok($form->process( init_object => $init_obj ), 'form processed without errors');
-$form->process( $params ); +ok($form->process( $params ), 'form processed without errors');
results in test output:
ok 1 not ok 2 - form processed without errors
Failed test 'form processed without errors'
at t/fields/textcsv.t line 20.
ok 3 - fif is correct ok 4 - rendering worked ok 5 - form processed without errors ok 6 - fif ok ok 7 - right value ok 8 - rendering worked 1..8
Looks like you failed 1 test of 8.
Field inflation/deflation is really confusing, so I'm not sure what is going wrong here -- and I'm not sure what TextCSV is expecting as an input value when called as $form->process(init_obj => ...) vs$form->process($hash)` -- does it want a string or a listref? I'm having difficulty getting anything to validate.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gshank/html-formhandler/issues/126, or mute the thread https://github.com/notifications/unsubscribe-auth/AACUoxeqWeOCzuTuxb70JieqUEN_NsCiks5q0_kxgaJpZM4KZMBi .
ah, ok, I was thinking validation would happen with init_object as well, but that makes sense.
If I just wrap the $form->process( $params ); call on line 29 with an ok, that test also fails.