Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/4.0-dev' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	media/system/js/core.min.js
  • Loading branch information
dneukirchen committed Apr 2, 2018
2 parents 25642a5 + 61eb898 commit eadf286
Show file tree
Hide file tree
Showing 43 changed files with 709 additions and 1,137 deletions.
1 change: 1 addition & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ environment:
matrix:
- php_ver_target: 7.0
- php_ver_target: 7.1
- php_ver_target: 7.2

init:
- SET PATH=C:\Program Files\OpenSSL;C:\tools\php;%PATH%
Expand Down
26 changes: 26 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,32 @@ pipeline:
commands:
- ./libraries/vendor/bin/phpunit --configuration ./libraries/vendor/joomla/test-unit/phpunit.xml.dist

javascript:
image: joomlaprojects/docker-systemtests:latest
commands:
- apt-get install nodejs npm
- ln -s /usr/bin/nodejs /usr/bin/node
- export DISPLAY=:0
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
- sleep 3
- mv -f drone-package.json package.json
- fluxbox > /dev/null 2>&1 &
- npm install
- node_modules/karma/bin/karma start node_modules/joomla-javascript-tests/src/karma.conf.js --single-run

system-tests:
image: joomlaprojects/docker-systemtests:latest
commands:
- date
- apache2ctl -D FOREGROUND &
- google-chrome --version
- apt-get update > /dev/null 2>&1
- composer update > /dev/null 2>&1
- chmod 755 libraries/vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/linux/chromedriver
- mv libraries/vendor/joomla/test-system/src/acceptance.suite.dist.yml libraries/vendor/joomla/test-system/src/acceptance.suite.yml
- libraries/vendor/bin/robo run:tests
- date

services:
mysql:
image: mysql:5.7
Expand Down
6 changes: 0 additions & 6 deletions RoboFile.dist.ini

This file was deleted.

162 changes: 60 additions & 102 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,96 +57,24 @@ class RoboFile extends \Robo\Tasks
*/
private $testsPath = 'libraries/vendor/joomla/test-system/src/';

/**
* Local configuration parameters
*
* @var array
* @since 3.7.3
*/
private $configuration = array();

/**
* @var array | null
* @since 3.7.3
*/
private $suiteConfig;

/**
* Path to the local CMS test folder
*
* @var string
* @since 3.7.3
*/
protected $cmsPath = null;

/**
* RoboFile constructor.
*
* @since 3.7.3
*/
public function __construct()
{
$this->configuration = $this->getConfiguration();
$this->cmsPath = $this->getTestingPath();

// Set default timezone (so no warnings are generated if it is not set)
date_default_timezone_set('UTC');
}

/**
* Get (optional) configuration from an external file
*
* @since 3.7.3
*
* @return \stdClass|null
*/
public function getConfiguration()
{
$configurationFile = __DIR__ . '/RoboFile.ini';

if (!file_exists($configurationFile))
{
$this->say('No local configuration file');

return null;
}

$configuration = parse_ini_file($configurationFile);

if ($configuration === false)
{
$this->say('Local configuration file is empty or wrong (check is it in correct .ini format');

return null;
}

return json_decode(json_encode($configuration));
}

/**
* Get the correct CMS root path
*
* @since 3.7.3
*
* @return string
*/
private function getTestingPath()
{
if (empty($this->configuration->cmsPath))
{
return 'test-install';
}

if (!file_exists(dirname($this->configuration->cmsPath)))
{
$this->say('CMS path written in local configuration does not exists or is not readable');

return 'test-install';
}

return $this->configuration->cmsPath;
}

/**
* Creates a testing Joomla site for running the tests (use it before run:test)
*
Expand All @@ -158,48 +86,80 @@ private function getTestingPath()
*/
public function createTestingSite($useHtaccess = false)
{
$cmsPath = $this->getSuiteConfig()['modules']['config']['Helper\\Acceptance']['cmsPath'];
$localUser = $this->getSuiteConfig()['modules']['config']['Helper\\Acceptance']['localUser'];

// Clean old testing site
if (is_dir($this->cmsPath))
if (is_dir($cmsPath))
{
try
{
$this->taskDeleteDir($this->cmsPath)->run();
$this->taskDeleteDir($cmsPath)->run();
}
catch (Exception $e)
{
// Sorry, we tried :(
$this->say('Sorry, you will have to delete ' . $this->cmsPath . ' manually.');
$this->say('Sorry, you will have to delete ' . $cmsPath . ' manually.');

exit(1);
}
}

$exclude = [
'tests',
'tests-phpunit',
'.run',
'.drone',
'.github',
'.git',
'.run',
'.idea',
'build',
'dev',
'node_modules',
'tests',
'test-install',
'libraries/vendor/codeception',
'libraries/vendor/behat',
'libraries/vendor/joomla-projects',
'libraries/vendor/consolidation'
'.appveyor.yml',
'.babelrc',
'.drone.yml',
'.eslintignore',
'.eslintrc',
'.gitignore',
'.hound.yml',
'.php_cs',
'.travis.yml',
'appveyor-phpunit.xml',
'build.js',
'build.xml',
'codeception.yml',
'composer.json',
'composer.lock',
'configuration.php',
'drone-package.json',
'Gemfile',
'htaccess.txt',
'karma.conf.js',
'package.json',
'package-lock.json',
'phpunit.xml.dist',
'RoboFile.dist.ini',
'RoboFile.php',
'robots.txt.dist',
'scss-lint.yml',
'selenium.log',
'travisci-phpunit.xml',
];

$this->copyJoomla($this->cmsPath, $exclude);
$this->copyJoomla($cmsPath, $exclude);

// Optionally change owner to fix permissions issues
if (!empty($this->configuration->localUser))
if (!empty($localUser))
{
$this->_exec('chown -R ' . $this->configuration->localUser . ' ' . $this->cmsPath);
$this->_exec('chown -R ' . $localUser . ' ' . $cmsPath);
}

// Optionally uses Joomla default htaccess file. Used by TravisCI
if ($useHtaccess == true)
{
$this->say('Renaming htaccess.txt to .htaccess');
$this->_copy('./htaccess.txt', $this->cmsPath . '/.htaccess');
$this->_copy('./htaccess.txt', $cmsPath . '/.htaccess');
$this->_exec('sed -e "s,# RewriteBase /,RewriteBase /test-install/joomla-cms,g" -in-place test-install/joomla-cms/.htaccess');
}
}
Expand Down Expand Up @@ -290,23 +250,21 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
$pathToCodeception = $this->vendorPath . 'bin/codecept';
}

$this->taskCodecept($pathToCodeception)
->arg('--steps')
->arg('--debug')
->arg('--fail-fast')
->env($opts['env'])
->arg($this->testsPath . 'acceptance/install/')
->run()
->stopOnFail();
$suites = [
'acceptance/install/',
'acceptance/administrator/components/com_users',
'acceptance/administrator/components/com_content',
'acceptance/administrator/components/com_menu',
];

$this->taskCodecept()
->arg('--steps')
->arg('--debug')
->arg('--fail-fast')
->env($opts['env'])
->arg($this->testsPath . '/acceptance/administrator/components/com_users')
->run()
->stopOnFail();
foreach ($suites as $suite) {
$this->taskCodecept($pathToCodeception)
->arg('--fail-fast')
->env($opts['env'])
->arg($this->testsPath . $suite)
->run()
->stopOnFail();
}
}

/**
Expand Down
57 changes: 31 additions & 26 deletions administrator/components/com_menus/tmpl/item/edit_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,33 @@

JFactory::getDocument()->addScriptOptions('menus-edit-modules', ['viewLevels' => $allLevels, 'itemId' => $this->item->id]);
JHtml::_('stylesheet', 'com_menus/admin-item-edit_modules.css', array('version' => 'auto', 'relative' => true));

// TODO: Re-remove the jQuery dependency in the admin-item-edit_modules.js file:
JHtml::_('jquery.framework');
JHtml::_('script', 'com_menus/admin-item-edit_modules.min.js', array('version' => 'auto', 'relative' => true));

// Set up the bootstrap modal that will be used for all module editors
echo JHtml::_(
'bootstrap.renderModal',
'moduleEditModal',
array(
'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<a type="button" class="btn" data-dismiss="modal" data-target="#closeBtn" aria-hidden="true">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<button type="button" class="btn btn-primary" data-dismiss="modal" data-target="#saveBtn" aria-hidden="true">'
. JText::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success" data-target="#applyBtn" aria-hidden="true">'
. JText::_('JAPPLY') . '</button>',
)
);

?>
<?php
// Set main fields.
$this->fields = array('toggle_modules_assigned','toggle_modules_published');

Expand Down Expand Up @@ -63,8 +88,12 @@
<?php endif; ?>
<tr class="<?php echo $no; ?><?php echo $status; ?>row<?php echo $i % 2; ?>" id="tr-<?php echo $module->id; ?>">
<td id="<?php echo $module->id; ?>" style="width:40%">
<?php $link = 'index.php?option=com_modules&amp;client_id=0&amp;task=module.edit&amp;id=' . $module->id . '&amp;tmpl=component&amp;view=module&amp;layout=modal'; ?>
<a href="#moduleEdit<?php echo $module->id; ?>Modal" role="button" data-toggle="modal" title="<?php echo JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'); ?>" id="title-<?php echo $module->id; ?>">
<a href="#moduleEditModal"
role="button"
class="btn btn-link module-edit-link"
title="<?php echo JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'); ?>"
id="title-<?php echo $module->id; ?>"
data-module-id="<?php echo $module->id; ?>">
<?php echo $this->escape($module->title); ?></a>
</td>
<td id="access-<?php echo $module->id; ?>" style="width:15%" class="text-center">
Expand Down Expand Up @@ -109,30 +138,6 @@
</span>
<?php endif; ?>
</td>
<?php echo JHtml::_(
'bootstrap.renderModal',
'moduleEdit' . $module->id . 'Modal',
array(
'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'),
'backdrop' => 'static',
'keyboard' => false,
'closeButton' => false,
'url' => $link,
'height' => '400px',
'width' => '800px',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<a type="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleEdit' . $module->id . 'Modal iframe\').contents().find(\'#closeBtn\').click();">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<button type="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleEdit' . $module->id . 'Modal iframe\').contents().find(\'#saveBtn\').click();">'
. JText::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="jQuery(\'#moduleEdit' . $module->id . 'Modal iframe\').contents().find(\'#applyBtn\').click();">'
. JText::_('JAPPLY') . '</button>',
)
); ?>
</tr>
<?php endforeach; ?>
</tbody>
Expand Down
18 changes: 0 additions & 18 deletions administrator/language/en-GB/en-GB.plg_authentication_gmail.ini

This file was deleted.

This file was deleted.

Loading

0 comments on commit eadf286

Please sign in to comment.