|
Open Journal Systems
3.3.0
|
12 use PHPUnit\Framework\TestCase;
22 $xml =
"<style><bibliography><sort><key variable=\"author\"/></sort><layout><names variable=\"author\"><name/></names><text prefix=\", \" variable=\"title\"/></layout></bibliography></style>";
26 \"title\": \"Book 1\",
37 \"title\": \"Book 2\",
48 \"title\": \"Book 3\",
51 \"family\": \"Flinders\",
59 $jsonObject = json_decode($json);
60 $citeProc =
new CiteProc($xml,
"en-US");
61 $result = $citeProc->render($jsonObject);
63 $expected =
"<div class=\"csl-bib-body\">
64 <div class=\"csl-entry\">John Doe, Book 2</div>
65 <div class=\"csl-entry\">Jacob Flinders, Book 3</div>
66 <div class=\"csl-entry\">Jane Roe, Book 1</div>
69 $this->assertEquals($expected, $result);
75 $xml =
"<style><bibliography><sort><key variable=\"issued\" sort=\"descending\"/><key variable=\"author\"/></sort><layout><names variable=\"author\"><name/></names><text prefix=\", \" variable=\"title\"/><date prefix=\" (\" suffix=\").\" variable=\"issued\" date-parts=\"year\" /></layout></bibliography></style>";
79 \"title\": \"Book 3\",
82 \"family\": \"Zeppelin\",
86 \"issued\": {\"date-parts\":[[\"2000\"]]},
91 \"title\": \"Book 4\",
94 \"family\": \"Anderson\",
98 \"issued\": {\"date-parts\":[[\"2003\"]]},
103 \"title\": \"Book 1\",
110 \"issued\": {\"date-parts\":[[\"2003\"]]},
116 \"title\": \"Book 2\",
123 \"issued\": {\"date-parts\":[[\"2003\"]]},
129 $jsonObject = json_decode($json);
130 $citeProc =
new CiteProc($xml,
"en-US");
131 $result = $citeProc->render($jsonObject);
133 $expected =
"<div class=\"csl-bib-body\">
134 <div class=\"csl-entry\">Jakob Anderson, Book 4 (2003).</div>
135 <div class=\"csl-entry\">John Doe, Book 2 (2003).</div>
136 <div class=\"csl-entry\">Jane Roe, Book 1 (2003).</div>
137 <div class=\"csl-entry\">Graf Zeppelin, Book 3 (2000).</div>
140 $this->assertEquals($expected, $result);
trait TestSuiteTestCaseTrait
testSortVariousNameMacros2()
testSortDateMacroSortWithSecondFieldAlign()
testSortVariableWithTwoKeys()
testSortSubstituteTitle()
testSortVariousNameMacros1()
testSortDateVariableMixedElements()
testSortCaseInsensitiveCitation()
testSortVariousNameMacros3()
testSortDateVariableRange()
_testRenderTestSuite($filterTests, $ignore=null)
testSortDateVariableRangeMixed()
testSortCaseInsensitiveBibliography()
testSortBibliographyCitationNumberDescending()
testSortBibliographyCitationNumberDescendingViaMacro()