File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,9 @@ public function deserializeValue($value) {
7171 if ($ this ->uploadData === null ) {
7272 $ this ->uploadData = [];
7373 }
74- if (count ($ this ->uploadData ) === 0 ) {
74+ $ this ->value = __ ('No attached document ' , 'formcreator ' );;
75+ if (count ($ this ->uploadData ) > 0 ) {
7576 $ this ->value = __ ('Attached document ' , 'formcreator ' );
76- } else {
77- $ this ->value = '' ;
7877 }
7978 }
8079
Original file line number Diff line number Diff line change @@ -39,4 +39,23 @@ public function testIsPrerequisites() {
3939 $ output = $ instance ->isPrerequisites ();
4040 $ this ->boolean ($ output )->isEqualTo (true );
4141 }
42+
43+ public function testDeserializeValue () {
44+ $ instance = $ this ->newTestedInstance ([]);
45+ $ instance ->deserializeValue ('invalid Json ' );
46+ $ this ->string ($ instance ->getValueForTargetText (true ))
47+ ->isEqualTo ('No attached document ' );
48+
49+ $ instance ->deserializeValue ('[] ' );
50+ $ this ->string ($ instance ->getValueForTargetText (true ))
51+ ->isEqualTo ('No attached document ' );
52+
53+ $ instance ->deserializeValue ('[1] ' );
54+ $ this ->string ($ instance ->getValueForTargetText (true ))
55+ ->isEqualTo ('Attached document ' );
56+
57+ $ instance ->deserializeValue ('[1,2] ' );
58+ $ this ->string ($ instance ->getValueForTargetText (true ))
59+ ->isEqualTo ('Attached document ' );
60+ }
4261}
You can’t perform that action at this time.
0 commit comments