@@ -545,8 +545,10 @@ public function testCanGetDataFields()
545545
546546 $ pdf = new Pdf ($ form );
547547 $ data = $ pdf ->getDataFields ();
548- $ this ->assertInternalType ('string ' , $ data );
549- $ this ->assertEquals ($ this ->formDataFields , $ data );
548+ $ this ->assertInternalType ('string ' , $ data ->__toString ());
549+ $ this ->assertEquals ($ this ->formDataFields , $ data ->__toString ());
550+ $ this ->assertInternalType ('array ' , $ data ->__toArray ());
551+ $ this ->assertEquals ($ this ->formDataFieldsArray , $ data ->__toArray ());
550552 }
551553
552554 protected function getDocument1 ()
@@ -621,4 +623,42 @@ protected function getOutFile()
621623FieldJustification: Left
622624EOD ;
623625
626+ protected $ formDataFieldsArray = array (
627+ array (
628+ 'FieldType ' => 'Button ' ,
629+ 'FieldName ' => 'checkbox 1 ' ,
630+ 'FieldFlags ' => '0 ' ,
631+ 'FieldValue ' => 'On ' ,
632+ 'FieldJustification ' => 'Left ' ,
633+ 'FieldStateOption ' => array ('Off ' , 'On ' ),
634+ ),
635+ array (
636+ 'FieldType ' => 'Button ' ,
637+ 'FieldName ' => 'checkbox 2 ' ,
638+ 'FieldFlags ' => '0 ' ,
639+ 'FieldValue ' => 'On ' ,
640+ 'FieldJustification ' => 'Left ' ,
641+ 'FieldStateOption ' => array ('Off ' , 'On ' ),
642+ ),
643+ array (
644+ 'FieldType ' => 'Button ' ,
645+ 'FieldName ' => 'radio 1 ' ,
646+ 'FieldFlags ' => '49152 ' ,
647+ 'FieldValue ' => '2 ' ,
648+ 'FieldJustification ' => 'Left ' ,
649+ 'FieldStateOption ' => array ('1 ' , '2 ' , 'Off ' ),
650+ ),
651+ array (
652+ 'FieldType ' => 'Text ' ,
653+ 'FieldName ' => 'email ' ,
654+ 'FieldFlags ' => '0 ' ,
655+ 'FieldJustification ' => 'Left ' ,
656+ ),
657+ array (
658+ 'FieldType ' => 'Text ' ,
659+ 'FieldName ' => 'name ' ,
660+ 'FieldFlags ' => '0 ' ,
661+ 'FieldJustification ' => 'Left ' ,
662+ ),
663+ );
624664}
0 commit comments