Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ install:
# Install OJS/OMP & prep data environment
- lib/pkp/lib/vendor/phpunit/phpunit/phpunit --configuration lib/pkp/tests/phpunit-env1.xml tests/data/10-InstallationTest.php
- lib/pkp/lib/vendor/phpunit/phpunit/phpunit --configuration lib/pkp/tests/phpunit-env1.xml tests/data/20-CreateContextTest.php
- lib/pkp/lib/vendor/phpunit/phpunit/phpunit --configuration lib/pkp/tests/phpunit-env1.xml tests/data/59-LogOutTest.php
- lib/pkp/tools/travis/dump-database.sh
script:
- set +xe
Expand Down
4 changes: 2 additions & 2 deletions CustomHeaderPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* @file CustomHeaderPlugin.inc.php
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class CustomHeaderPlugin
Expand Down
4 changes: 2 additions & 2 deletions CustomHeaderSettingsForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* @file CustomHeaderSettingsForm.inc.php
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class CustomHeaderSettingsForm
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/**
* @file index.php
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @ingroup plugins_generic_customHeader
Expand Down
4 changes: 2 additions & 2 deletions locale/da_DK/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<!--
* locale/da_DK/locale.xml
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Javascript plugin localization strings
Expand Down
4 changes: 2 additions & 2 deletions locale/de_DE/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<!--
* locale/de_DE/locale.xml
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Javascript plugin localization strings
Expand Down
4 changes: 2 additions & 2 deletions locale/en_US/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<!--
* locale/en_US/locale.xml
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Javascript plugin localization strings
Expand Down
4 changes: 2 additions & 2 deletions locale/es_ES/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<!--
* locale/es_ES/locale.xml
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Javascript plugin localization strings
Expand Down
4 changes: 2 additions & 2 deletions locale/pt_PT/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<!--
* locale/pt_PT/locale.xml
*
* Copyright (c) 2014-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2014-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Localization strings.
Expand Down
6 changes: 3 additions & 3 deletions templates/settingsForm.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{**
* templates/settingsForm.tpl
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Plugin settings
Expand Down Expand Up @@ -31,7 +31,7 @@
{/fbvFormArea}

{fbvFormArea id="customHeaderSettingsFormArea"}
{fbvFormSection for="footerContent" title="plugins.generic.customHeader.content"}
{fbvFormSection for="footerContent" title="plugins.generic.customHeader.footerContent"}
{fbvElement type="textarea" name="footerContent" id="footerContent" value=$footerContent height=$fbvStyles.height.TALL}
{/fbvFormSection}
{/fbvFormArea}
Expand Down
24 changes: 15 additions & 9 deletions tests/functional/CustomHeaderFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

import('lib.pkp.tests.WebTestCase');

use Facebook\WebDriver\Interactions\WebDriverActions;
use Facebook\WebDriver\WebDriverExpectedCondition;
use Facebook\WebDriver\WebDriverBy;

class CustomHeaderFunctionalTest extends WebTestCase {
/**
* Enable and exercise the plugin
Expand All @@ -23,27 +27,29 @@ function testCustomHeader() {
$this->open(self::$baseUrl);

$this->logIn('admin', 'admin');
$this->waitForElementPresent($selector='link=Website');
$this->clickAndWait($selector);
$this->click('link=Plugins');
$actions = new WebDriverActions(self::$driver);
$actions->moveToElement($this->waitForElementPresent('//ul[@id="navigationPrimary"]//a[contains(text(),"Settings")]'))
->click($this->waitForElementPresent('//ul[@id="navigationPrimary"]//a[contains(text(),"Website")]'))
->perform();
$this->click('//a[text()="Plugins"]');

// Find and enable the plugin
$this->waitForElementPresent($selector = '//input[starts-with(@id, \'select-cell-customheaderplugin-enabled\')]');
$this->assertElementNotPresent('link=Custom Header Plugin'); // Plugin should be disabled
$this->click($selector); // Enable plugin
$this->click('//input[starts-with(@id, \'select-cell-customheaderplugin-enabled\')]');
$this->waitForElementPresent('//div[contains(.,\'The plugin "Custom Header Plugin" has been enabled.\')]');
sleep(1);

// Edit the plugin settings
$this->waitForElementPresent($selector='//a[contains(@id,\'customheaderplugin-settings\')]');
$this->click($selector);
self::$driver->executeScript('window.scroll(0,-50);'); // FIXME: Give it an extra margin of pixels
$this->click('//tr[contains(@id,"customheaderplugin")]//a[contains(@class,"show_extras")]');
$this->click('//a[contains(@id,\'customheaderplugin-settings\')]');
$this->waitForElementPresent($selector='//textarea[starts-with(@id, \'headerContent-\')]');
$this->type($selector, '<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>');
$this->type('//textarea[starts-with(@id, \'footerContent-\')]', '<a class="twitter-timeline" href="https://twitter.com/pkp?ref_src=twsrc%5Etfw">Tweets by pkp</a>');
$this->click('//form[@id=\'customHeaderSettingsForm\']//button[text()=\'OK\']');
$this->waitForElementPresent('//div[contains(.,\'Your changes have been saved.\')]');

// Check that a Twitter timeline appears on the homepage.
sleep(5);
sleep(1);
$this->open(self::$baseUrl);
$this->waitForElementPresent('//script[@src=\'https://platform.twitter.com/widgets.js\']');
$this->waitForElementPresent('//iframe[contains(@id,\'twitter-widget\')]');
Expand Down
8 changes: 4 additions & 4 deletions version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<!--
* version.xml
*
* Copyright (c) 2013-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2003-2019 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Plugin version information.
-->
<version>
<application>customHeader</application>
<type>plugins.generic</type>
<release>1.0.0.0</release>
<date>2017-02-03</date>
<release>1.0.1.0</release>
<date>2019-03-04</date>
<lazy-load>1</lazy-load>
<class>CustomHeaderPlugin</class>
</version>