Skip to content

Instantly share code, notes, and snippets.

@asmecher
Created September 20, 2018 15:36
Show Gist options
  • Save asmecher/7f6b7bcd7b5b9324525f2461c47b3918 to your computer and use it in GitHub Desktop.
Save asmecher/7f6b7bcd7b5b9324525f2461c47b3918 to your computer and use it in GitHub Desktop.
<?php
/**
* @file PluginTest.php
*
* Copyright (c) 2014-2018 Simon Fraser University
* Copyright (c) 2000-2018 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class PluginTest
*
* @brief Try creating some data programmatically in PHP.
*/
import('lib.pkp.tests.PKPTestCase');
import('lib.pkp.classes.xslt.XMLTypeDescription');
class PluginTest extends PKPTestCase {
/**
* @covers XMLTypeDescription
*/
public function testCreateJournal() {
$journalDao = DAORegistry::getDAO('JournalDAO');
$journal = $journalDao->newDataObject();
$journal->setPrimaryLocale('en_US');
$journal->setPath('testjournal');
$journal->setEnabled(true);
$journalDao->insertObject($journal);
$journal->updateSetting('supportedLocales', array('en_US', 'de_DE'));
$journal->updateSetting('supportedFormLocales', array('en_US', 'de_DE'));
$journal->updateSetting('supportedSubmissionLocales', array('en_US', 'de_DE'));
$journal->updateSetting('name', array(
'en_US' => 'Test journal',
'de_DE' => 'Wasserbüffel',
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment