diff --git a/.appveyor.yml b/.appveyor.yml index e067ca7090..ca6ceb7d89 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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% diff --git a/.drone.yml b/.drone.yml index 8839a3216c..3b07485be5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/RoboFile.dist.ini b/RoboFile.dist.ini deleted file mode 100644 index a4f60e68ee..0000000000 --- a/RoboFile.dist.ini +++ /dev/null @@ -1,6 +0,0 @@ -; If you want to setup your test website (document root) in a different folder, you can do that here. -; You can also set an absolute path, i.e. /path/to/my/cms/folder -cmsPath = test-install - -; (Linux / Mac only) If you want to set a different owner for the CMS root folder, you can set it here. -localUser = diff --git a/RoboFile.php b/RoboFile.php index 4f65c925f3..bd920884da 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -57,28 +57,12 @@ 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. * @@ -86,67 +70,11 @@ class RoboFile extends \Robo\Tasks */ 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) * @@ -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'); } } @@ -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(); + } } /** diff --git a/administrator/components/com_menus/tmpl/item/edit_modules.php b/administrator/components/com_menus/tmpl/item/edit_modules.php index 34c27a8570..9b26308914 100644 --- a/administrator/components/com_menus/tmpl/item/edit_modules.php +++ b/administrator/components/com_menus/tmpl/item/edit_modules.php @@ -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' => '
' + . '' + . '', + ) +); + +?> +fields = array('toggle_modules_assigned','toggle_modules_published'); @@ -63,8 +88,12 @@