File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -965,10 +965,7 @@ public function setType($type)
965965 $ this ->type = $ type ;
966966 }
967967
968- /**
969- * @return string|null
970- */
971- public function getType ()
968+ public function getType (): string |null
972969 {
973970 return $ this ->type ;
974971 }
Original file line number Diff line number Diff line change @@ -394,6 +394,9 @@ public function getFieldValues($field)
394394 if ($ fieldValues instanceof DateTimeZone) {
395395 $ fieldValues = $ fieldValues ->getName ();
396396 }
397+ if ($ field ->getType () === 'bool ' ) {
398+ $ fieldValues = $ fieldValues ? '1 ' : '0 ' ;
399+ }
397400
398401 return trim ($ fieldValues ?? '' );
399402 }
Original file line number Diff line number Diff line change @@ -949,8 +949,6 @@ public function testDateXml()
949949 $ xml ->setModel ($ document );
950950 $ dom = $ xml ->getDomDocument ();
951951
952- $ output = $ dom ->saveXml ();
953-
954952 $ elements = $ dom ->getElementsByTagName ('CompletedDate ' );
955953 $ this ->assertCount (1 , $ elements );
956954
@@ -971,4 +969,18 @@ public function testDateXml()
971969 $ this ->assertTrue ($ completedDate ->hasAttribute ('Timezone ' ));
972970 $ this ->assertTrue ($ completedDate ->hasAttribute ('UnixTimestamp ' ));
973971 }
972+
973+ public function testOutputBelongsToBibliographyFalseAsZero ()
974+ {
975+ $ doc = Document::new ();
976+ $ doc ->setBelongsToBibliography (false );
977+
978+ $ xml = new Xml ();
979+ $ xml ->setStrategy (new Version1 ());
980+ $ xml ->setModel ($ doc );
981+ $ dom = $ xml ->getDomDocument ();
982+
983+ $ docElement = $ dom ->getElementsByTagName ('Opus_Document ' )->item (0 );
984+ $ this ->assertEquals ('0 ' , $ docElement ->attributes ->getNamedItem ('BelongsToBibliography ' )->nodeValue );
985+ }
974986}
You can’t perform that action at this time.
0 commit comments