public static function setUpBeforeClass() { parent::setUpBeforeClass(); API::userClear(self::$config['userID']); // Create test data $key = API::createItem("book", array("title" => "Title", "creators" => array(array("creatorType" => "author", "firstName" => "First", "lastName" => "Last"))), null, 'key'); self::$items[$key] = '<content xmlns:zapi="http://zotero.org/ns/api" type="application/xml"><zapi:subcontent zapi:type="bib"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 1.35; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, First. <i>Title</i>, n.d.</div></div></zapi:subcontent><zapi:subcontent zapi:type="json">' . \Zotero_Utilities::formatJSON(json_decode('{"key":"","version":0,"itemType":"book","title":"Title","creators":[{"creatorType":"author","firstName":"First","lastName":"Last"}],"abstractNote":"","series":"","seriesNumber":"","volume":"","numberOfVolumes":"","edition":"","place":"","publisher":"","date":"","numPages":"","language":"","ISBN":"","shortTitle":"","url":"","accessDate":"","archive":"","archiveLocation":"","libraryCatalog":"","callNumber":"","rights":"","extra":"","dateAdded":"","dateModified":"","tags":[],"collections":[],"relations":{}}')) . '</zapi:subcontent></content>'; $key = API::createItem("book", array("title" => "Title 2", "creators" => array(array("creatorType" => "author", "firstName" => "First", "lastName" => "Last"), array("creatorType" => "editor", "firstName" => "Ed", "lastName" => "McEditor"))), null, 'key'); self::$items[$key] = '<content xmlns:zapi="http://zotero.org/ns/api" type="application/xml"><zapi:subcontent zapi:type="bib"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 1.35; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, First. <i>Title 2</i>. Edited by Ed McEditor, n.d.</div></div></zapi:subcontent><zapi:subcontent zapi:type="json">' . \Zotero_Utilities::formatJSON(json_decode('{"key":"","version":0,"itemType":"book","title":"Title 2","creators":[{"creatorType":"author","firstName":"First","lastName":"Last"},{"creatorType":"editor","firstName":"Ed","lastName":"McEditor"}],"abstractNote":"","series":"","seriesNumber":"","volume":"","numberOfVolumes":"","edition":"","place":"","publisher":"","date":"","numPages":"","language":"","ISBN":"","shortTitle":"","url":"","accessDate":"","archive":"","archiveLocation":"","libraryCatalog":"","callNumber":"","rights":"","extra":"","dateAdded":"","dateModified":"","tags":[],"collections":[],"relations":{}}')) . '</zapi:subcontent></content>'; }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); API::userClear(self::$config['userID']); // Create test data $key = API::createItem("book", array("title" => "Title", "date" => "January 1, 2014", "creators" => array(array("creatorType" => "author", "firstName" => "First", "lastName" => "Last"))), null, 'key'); self::$items[$key] = ['bibtex' => "\n@book{last_title_2014,\n\ttitle = {Title},\n\tauthor = {Last, First},\n\tmonth = jan,\n\tyear = {2014}\n}", 'ris' => "TY - BOOK\r\nTI - Title\r\nAU - Last, First\r\nDA - 2014/01/01/\r\nPY - 2014\r\nER - \r\n\r\n"]; $key = API::createItem("book", array("title" => "Title 2", "date" => "June 24, 2014", "creators" => array(array("creatorType" => "author", "firstName" => "First", "lastName" => "Last"), array("creatorType" => "editor", "firstName" => "Ed", "lastName" => "McEditor"))), null, 'key'); self::$items[$key] = ['bibtex' => "\n@book{last_title_2014,\n\ttitle = {Title 2},\n\tauthor = {Last, First},\n\teditor = {McEditor, Ed},\n\tmonth = jun,\n\tyear = {2014}\n}", 'ris' => "TY - BOOK\r\nTI - Title 2\r\nAU - Last, First\r\nA3 - McEditor, Ed\r\nDA - 2014/06/24/\r\nPY - 2014\r\nER - \r\n\r\n"]; self::$multiResponses = ['bibtex' => ["contentType" => "application/x-bibtex", "content" => "\n@book{last_title_2014,\n\ttitle = {Title 2},\n\tauthor = {Last, First},\n\teditor = {McEditor, Ed},\n\tmonth = jun,\n\tyear = {2014}\n}\n\n@book{last_title_2014-1,\n\ttitle = {Title},\n\tauthor = {Last, First},\n\tmonth = jan,\n\tyear = {2014}\n}"], 'ris' => ["contentType" => "application/x-research-info-systems", "content" => "TY - BOOK\r\nTI - Title 2\r\nAU - Last, First\r\nA3 - McEditor, Ed\r\nDA - 2014/06/24/\r\nPY - 2014\r\nER - \r\n\r\nTY - BOOK\r\nTI - Title\r\nAU - Last, First\r\nDA - 2014/01/01/\r\nPY - 2014\r\nER - \r\n\r\n"]]; }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); API::userClear(self::$config['userID']); // Create test data $key = API::createItem("book", array("title" => "Title", "date" => "January 1, 2014", "creators" => array(array("creatorType" => "author", "firstName" => "First", "lastName" => "Last"))), null, 'key'); self::$items[$key] = ['json' => ["citation" => array("default" => '<span>Last, <i>Title</i>.</span>', "apa" => '<span>(Last, 2014)</span>', "https://www.zotero.org/styles/apa" => '<span>(Last, 2014)</span>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<span>[1]</span>'), "bib" => array("default" => '<div class="csl-bib-body" style="line-height: 1.35; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, First. <i>Title</i>, 2014.</div></div>', "apa" => '<div class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014). <i>Title</i>.</div></div>', "https://www.zotero.org/styles/apa" => '<div class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014). <i>Title</i>.</div></div>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<div class="csl-bib-body" style="line-height: 1.35; "><div class="csl-entry" style="clear: left; "><div class="csl-left-margin" style="float: left; padding-right: 0.5em; text-align: right; width: 1em;">[1]</div><div class="csl-right-inline" style="margin: 0 .4em 0 1.5em;">F. Last, <i>Title</i>. 2014.</div></div></div>')], 'atom' => ["citation" => array("default" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="citation" type="xhtml"><span xmlns="http://www.w3.org/1999/xhtml">Last, <i>Title</i>.</span></content>', "apa" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="citation" type="xhtml"><span xmlns="http://www.w3.org/1999/xhtml">(Last, 2014)</span></content>', "https://www.zotero.org/styles/apa" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="citation" type="xhtml"><span xmlns="http://www.w3.org/1999/xhtml">(Last, 2014)</span></content>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="citation" type="xhtml"><span xmlns="http://www.w3.org/1999/xhtml">[1]</span></content>'), "bib" => array("default" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="bib" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 1.35; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, First. <i>Title</i>, 2014.</div></div></content>', "apa" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="bib" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014). <i>Title</i>.</div></div></content>', "https://www.zotero.org/styles/apa" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="bib" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014). <i>Title</i>.</div></div></content>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="bib" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 1.35; "><div class="csl-entry" style="clear: left; "><div class="csl-left-margin" style="float: left; padding-right: 0.5em; text-align: right; width: 1em;">[1]</div><div class="csl-right-inline" style="margin: 0 .4em 0 1.5em;">F. Last, <i>Title</i>. 2014.</div></div></div></content>')]]; $key = API::createItem("book", array("title" => "Title 2", "date" => "June 24, 2014", "creators" => array(array("creatorType" => "author", "firstName" => "First", "lastName" => "Last"), array("creatorType" => "editor", "firstName" => "Ed", "lastName" => "McEditor"))), null, 'key'); self::$items[$key] = ['json' => ["citation" => array("default" => '<span>Last, <i>Title 2</i>.</span>', "apa" => '<span>(Last, 2014)</span>', "https://www.zotero.org/styles/apa" => '<span>(Last, 2014)</span>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<span>[1]</span>'), "bib" => array("default" => '<div class="csl-bib-body" style="line-height: 1.35; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, First. <i>Title 2</i>. Edited by Ed McEditor, 2014.</div></div>', "apa" => '<div class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014). <i>Title 2</i>. (E. McEditor, Ed.).</div></div>', "https://www.zotero.org/styles/apa" => '<div class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014). <i>Title 2</i>. (E. McEditor, Ed.).</div></div>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<div class="csl-bib-body" style="line-height: 1.35; "><div class="csl-entry" style="clear: left; "><div class="csl-left-margin" style="float: left; padding-right: 0.5em; text-align: right; width: 1em;">[1]</div><div class="csl-right-inline" style="margin: 0 .4em 0 1.5em;">F. Last, <i>Title 2</i>. 2014.</div></div></div>')], 'atom' => ["citation" => array("default" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="citation" type="xhtml"><span xmlns="http://www.w3.org/1999/xhtml">Last, <i>Title 2</i>.</span></content>', "apa" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="citation" type="xhtml"><span xmlns="http://www.w3.org/1999/xhtml">(Last, 2014)</span></content>', "https://www.zotero.org/styles/apa" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="citation" type="xhtml"><span xmlns="http://www.w3.org/1999/xhtml">(Last, 2014)</span></content>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="citation" type="xhtml"><span xmlns="http://www.w3.org/1999/xhtml">[1]</span></content>'), "bib" => array("default" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="bib" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 1.35; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, First. <i>Title 2</i>. Edited by Ed McEditor, 2014.</div></div></content>', "apa" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="bib" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014). <i>Title 2</i>. (E. McEditor, Ed.).</div></div></content>', "https://www.zotero.org/styles/apa" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="bib" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014). <i>Title 2</i>. (E. McEditor, Ed.).</div></div></content>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<content xmlns:zapi="http://zotero.org/ns/api" zapi:type="bib" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 1.35; "><div class="csl-entry" style="clear: left; "><div class="csl-left-margin" style="float: left; padding-right: 0.5em; text-align: right; width: 1em;">[1]</div><div class="csl-right-inline" style="margin: 0 .4em 0 1.5em;">F. Last, <i>Title 2</i>. 2014.</div></div></div></content>')]]; self::$multiResponses = ["default" => '<?xml version="1.0"?><div class="csl-bib-body" style="line-height: 1.35; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, First. <i>Title</i>, 2014.</div><div class="csl-entry">———. <i>Title 2</i>. Edited by Ed McEditor, 2014.</div></div>', "apa" => '<?xml version="1.0"?><div class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014a). <i>Title</i>.</div><div class="csl-entry">Last, F. (2014b). <i>Title 2</i>. (E. McEditor, Ed.).</div></div>', "https://www.zotero.org/styles/apa" => '<?xml version="1.0"?><div class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Last, F. (2014a). <i>Title</i>.</div><div class="csl-entry">Last, F. (2014b). <i>Title 2</i>. (E. McEditor, Ed.).</div></div>', "https://raw.githubusercontent.com/citation-style-language/styles/master/ieee.csl" => '<?xml version="1.0"?><div class="csl-bib-body" style="line-height: 1.35; "><div class="csl-entry" style="clear: left; "><div class="csl-left-margin" style="float: left; padding-right: 0.5em; text-align: right; width: 1em;">[1]</div><div class="csl-right-inline" style="margin: 0 .4em 0 1.5em;">F. Last, <i>Title 2</i>. 2014.</div></div><div class="csl-entry" style="clear: left; "><div class="csl-left-margin" style="float: left; padding-right: 0.5em; text-align: right; width: 1em;">[2]</div><div class="csl-right-inline" style="margin: 0 .4em 0 1.5em;">F. Last, <i>Title</i>. 2014.</div></div></div>']; }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); API::userClear(self::$config['userID']); // // Collections // /*for ($i=0; $i<5; $i++) { self::$collectionKeys[] = API::createCollection("Test", false, null, 'key'); }*/ // // Items // $titles = self::$titles; $names = self::$names; for ($i = 0; $i < sizeOf(self::$titles) - 2; $i++) { $key = API::createItem("book", ['title' => array_shift($titles), 'creators' => [["creatorType" => "author", "name" => array_shift($names)]]], null, 'key'); // Child attachments if (!is_null(self::$attachmentTitles[$i])) { self::$childAttachmentKeys[] = API::createAttachmentItem("imported_file", ['title' => self::$attachmentTitles[$i]], $key, null, 'key'); } // Child notes if (!is_null(self::$notes[$i])) { self::$childNoteKeys[] = API::createNoteItem(self::$notes[$i], $key, null, 'key'); } self::$itemKeys[] = $key; } // Top-level attachment self::$itemKeys[] = API::createAttachmentItem("imported_file", ['title' => array_shift($titles)], false, null, 'key'); // Top-level note self::$itemKeys[] = API::createNoteItem(array_shift($titles), false, null, 'key'); // // Searches // /*for ($i=0; $i<5; $i++) { self::$searchKeys[] = API::createSearch("Test", 'default', null, 'key'); }*/ }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); API::userClear(self::$config['userID']); API::groupClear(self::$config['ownedPrivateGroupID']); }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); API::userClear(self::$config['userID']); }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); require 'include/config.inc.php'; API::userClear($config['userID']); }