예제 #1
0
 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('{"itemKey":"","itemVersion":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":"","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('{"itemKey":"","itemVersion":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":"","tags":[],"collections":[],"relations":{}}')) . '</zapi:subcontent></content>';
 }
예제 #2
0
 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] = array("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, n.d.)</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>, n.d.</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. (n.d.). <i>Title</i>.</div></div></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] = array("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, n.d.)</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, n.d.</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. (n.d.). <i>Title 2</i>. (E. McEditor, Ed.).</div></div></content>'));
 }
예제 #3
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     require 'include/config.inc.php';
     foreach ($config as $k => $v) {
         self::$config[$k] = $v;
     }
     self::$nsZAPI = 'http://zotero.org/ns/api';
     API::useAPIVersion(2);
     // Enable note access
     API::setKeyOption(self::$config['userID'], self::$config['apiKey'], 'libraryNotes', 1);
 }
예제 #4
0
 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');
     		}*/
 }
예제 #5
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     API::userClear(self::$config['userID']);
 }
예제 #6
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     require 'include/config.inc.php';
     API::userClear($config['userID']);
 }
예제 #7
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     API::userClear(self::$config['userID']);
     API::groupClear(self::$config['ownedPrivateGroupID']);
 }
예제 #8
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
 }