Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:joomla/joomla-platform into files…

…ystem
  • Loading branch information...
commit 0aca1125a12d84e7230afaf7971942042ab96298 2 parents d14f7dc + 49a4e5b
@chdemko authored
Showing with 169 additions and 447 deletions.
  1. +1 −1  libraries/joomla/access/access.php
  2. +2 −0  libraries/joomla/application/web.php
  3. +1 −1  libraries/joomla/database/driver/postgresql.php
  4. +16 −2 libraries/joomla/factory.php
  5. +5 −3 libraries/joomla/github/forks.php
  6. +1 −1  libraries/joomla/html/html.php
  7. +30 −5 libraries/joomla/log/logger.php
  8. 0  libraries/joomla/log/{loggers → logger}/database.php
  9. 0  libraries/joomla/log/{loggers → logger}/echo.php
  10. 0  libraries/joomla/log/{loggers → logger}/formattedtext.php
  11. +1 −1  libraries/joomla/log/{loggers → logger}/messagequeue.php
  12. 0  libraries/joomla/log/{loggers → logger}/syslog.php
  13. 0  libraries/joomla/log/{loggers → logger}/w3c.php
  14. +62 −0 libraries/joomla/pagination/object.php
  15. +7 −59 libraries/joomla/{html → pagination}/pagination.php
  16. +1 −1  libraries/joomla/session/storage/xcache.php
  17. +8 −0 libraries/joomla/user/user.php
  18. +3 −3 libraries/{joomla/html → legacy/editor}/editor.php
  19. +7 −4 libraries/{joomla/form/fields → legacy/form/field}/editor.php
  20. +0 −47 libraries/legacy/form/field/helpsite.php
  21. +0 −49 libraries/legacy/form/field/menu.php
  22. +0 −129 libraries/legacy/form/field/user.php
  23. +0 −1  libraries/legacy/model/list.php
  24. +1 −1  tests/bootstrap.legacy.php
  25. +1 −1  tests/bootstrap.php
  26. +4 −1 tests/suites/database/driver/postgresql/JDatabasePostgresqlTest.php
  27. +1 −4 tests/suites/{unit/joomla/html → legacy/editor}/JEditorTest.php
  28. +2 −3 tests/suites/legacy/form/field/JFormFieldContentLanguageTest.php
  29. +1 −2  tests/suites/{unit/joomla/form/fields → legacy/form/field}/JFormFieldEditorTest.php
  30. +0 −52 tests/suites/legacy/form/field/JFormFieldHelpsiteTest.php
  31. +0 −53 tests/suites/legacy/form/field/JFormFieldUserTest.php
  32. +1 −1  tests/suites/unit/joomla/application/JApplicationCliTest.php
  33. +7 −7 tests/suites/unit/joomla/application/JApplicationWebTest.php
  34. +1 −1  tests/suites/unit/joomla/github/JGithubForksTest.php
  35. +0 −1  tests/suites/unit/joomla/log/loggers/JLogLoggerDatabaseTest.php
  36. +0 −2  tests/suites/unit/joomla/log/loggers/JLogLoggerEchoTest.php
  37. +0 −1  tests/suites/unit/joomla/log/loggers/JLogLoggerFormattedTextTest.php
  38. +1 −2  tests/suites/unit/joomla/log/loggers/JLogLoggerMessageQueueTest.php
  39. +0 −2  tests/suites/unit/joomla/log/loggers/JLogLoggerSyslogTest.php
  40. +0 −1  tests/suites/unit/joomla/log/loggers/JLogLoggerW3CTest.php
  41. +1 −1  tests/suites/unit/joomla/log/loggers/stubs/formattedtext/inspector.php
  42. +1 −1  tests/suites/unit/joomla/log/loggers/stubs/w3c/inspector.php
  43. +2 −3 tests/suites/unit/joomla/{html → pagination}/JPaginationTest.php
View
2  libraries/joomla/access/access.php
@@ -464,7 +464,7 @@ public static function getActions($component, $section = 'component')
JLog::add(__METHOD__ . ' is deprecated. Use JAccess::getActionsFromFile or JAcces::getActionsFromData instead.', JLog::WARNING, 'deprecated');
$actions = self::getActionsFromFile(
JPATH_ADMINISTRATOR . '/components/' . $component . '/access.xml',
- "/access/section[@name='" . $section . "']"
+ "/access/section[@name='" . $section . "']/"
);
if (empty($actions))
{
View
2  libraries/joomla/application/web.php
@@ -1146,6 +1146,8 @@ protected function loadSystemUris($requestUri = null)
}
else
{
+ // Normalise slashes.
+ $mediaURI = '/' . trim($mediaURI, '/\\') . '/';
$this->set('uri.media.full', $this->get('uri.base.host') . $mediaURI);
$this->set('uri.media.path', $mediaURI);
}
View
2  libraries/joomla/database/driver/postgresql.php
@@ -43,7 +43,7 @@ class JDatabaseDriverPostgresql extends JDatabaseDriver
* @var string The minimum supported database version.
* @since 12.1
*/
- protected static $dbMinimum = '9.1.2';
+ protected static $dbMinimum = '8.3.18';
/**
* Operator used for concatenation
View
18 libraries/joomla/factory.php
@@ -271,9 +271,13 @@ public static function getCache($group = '', $handler = 'callback', $storage = n
* if it doesn't already exist.
*
* @return JAccess object
+ *
+ * @deprecated 13.3 Use JAccess directly.
*/
public static function getACL()
{
+ JLog::add(__METHOD__ . ' is deprecated. Use JAccess directly.', JLog::WARNING, 'deprecated');
+
if (!self::$acl)
{
self::$acl = new JAccess;
@@ -381,9 +385,12 @@ public static function getFeedParser($url, $cache_time = 0)
* @since 11.1
* @note This method will return SimpleXMLElement object in the future. Do not rely on JXMLElement's methods.
* @todo This may go in a separate class - error reporting may be improved.
+ * @deprecated 13.3 Use SimpleXML directly.
*/
public static function getXML($data, $isFile = true)
{
+ JLog::add(__METHOD__ . ' is deprecated. Use SimpleXML directly.', JLog::WARNING, 'deprecated');
+
jimport('joomla.utilities.xmlelement');
// Disable libxml errors and allow to fetch error information as needed
@@ -423,13 +430,17 @@ public static function getXML($data, $isFile = true)
*
* @param string $editor The editor to load, depends on the editor plugins that are installed
*
- * @return JEditor object
+ * @return JEditor instance of JEditor
*
* @since 11.1
+ * @deprecated 12.3 Use JEditor directly
*/
public static function getEditor($editor = null)
{
- jimport('joomla.html.editor');
+ if (!class_exists('JEditor'))
+ {
+ throw new BadMethodCallException('JEditor not found');
+ }
// Get the editor configuration setting
if (is_null($editor))
@@ -450,9 +461,12 @@ public static function getEditor($editor = null)
*
* @see JURI
* @since 11.1
+ * @deprecated 13.3 Use JURI directly.
*/
public static function getURI($uri = 'SERVER')
{
+ JLog::add(__METHOD__ . ' is deprecated. Use JURI directly.', JLog::WARNING, 'deprecated');
+
jimport('joomla.environment.uri');
return JURI::getInstance($uri);
View
8 libraries/joomla/github/forks.php
@@ -10,7 +10,7 @@
defined('JPATH_PLATFORM') or die;
/**
- * GitHub API References class for the Joomla Platform.
+ * GitHub API Forks class for the Joomla Platform.
*
* @package Joomla.Platform
* @subpackage GitHub
@@ -19,7 +19,7 @@
class JGithubForks extends JGithubObject
{
/**
- * Method to create an issue.
+ * Method to fork a repository.
*
* @param string $user The name of the owner of the GitHub repository.
* @param string $repo The name of the GitHub repository.
@@ -28,6 +28,7 @@ class JGithubForks extends JGithubObject
* @return object
*
* @since 11.4
+ * @throws DomainException
*/
public function create($user, $repo, $org = '')
{
@@ -49,7 +50,7 @@ public function create($user, $repo, $org = '')
$response = $this->client->post($this->fetchUrl($path), $data);
// Validate the response code.
- if ($response->code != 201)
+ if ($response->code != 202)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
@@ -70,6 +71,7 @@ public function create($user, $repo, $org = '')
* @return array
*
* @since 11.4
+ * @throws DomainException
*/
public function getList($user, $repo, $page = 0, $limit = 0)
{
View
2  libraries/joomla/html/html.php
@@ -823,7 +823,7 @@ public static function calendar($value, $name, $id, $format = '%Y-%m-%d', $attri
else
{
return '<input type="text" title="' . (0 !== (int) $value ? self::_('date', $value) : '')
- . '" value="' . (0 !== (int) $value ? self::_('date', $value, JFactory::getDbo()->getDateFormat()) : '') . '" ' . $attribs
+ . '" value="' . (0 !== (int) $value ? self::_('date', $value) : '') . '" ' . $attribs
. ' /><input type="hidden" name="' . $name . '" id="' . $id . '" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" />';
}
}
View
35 libraries/joomla/log/logger.php
@@ -17,20 +17,20 @@
*
* @package Joomla.Platform
* @subpackage Log
- * @since 11.1
+ * @since 12.2
*/
abstract class JLogLogger
{
/**
* Options array for the JLog instance.
* @var array
- * @since 11.1
+ * @since 12.2
*/
protected $options = array();
/**
* @var array Translation array for JLogEntry priorities to text strings.
- * @since 11.1
+ * @since 12.2
*/
protected $priorities = array(
JLog::EMERGENCY => 'EMERGENCY',
@@ -47,7 +47,7 @@
*
* @param array &$options Log object options.
*
- * @since 11.1
+ * @since 12.2
*/
public function __construct(array &$options)
{
@@ -62,7 +62,32 @@ public function __construct(array &$options)
*
* @return void
*
- * @since 11.1
+ * @since 12.2
*/
abstract public function addEntry(JLogEntry $entry);
}
+
+/**
+ * Deprecated class placeholder. You should use JAccessRule instead.
+ *
+ * @package Joomla.Platform
+ * @subpackage Access
+ * @since 11.1
+ * @deprecated 13.3
+ */
+abstract class JLogger extends JLogLogger
+{
+ /**
+ * Constructor.
+ *
+ * @param array &$options Log object options.
+ *
+ * @since 11.1
+ * @deprecated 13.3
+ */
+ public function __construct(array &$options)
+ {
+ JLog::add('JLogger is deprecated. Use JLogLogger instead.', JLog::WARNING, 'deprecated');
+ parent::__construct($$options);
+ }
+}
View
0  libraries/joomla/log/loggers/database.php → libraries/joomla/log/logger/database.php
File renamed without changes
View
0  libraries/joomla/log/loggers/echo.php → libraries/joomla/log/logger/echo.php
File renamed without changes
View
0  libraries/joomla/log/loggers/formattedtext.php → libraries/joomla/log/logger/formattedtext.php
File renamed without changes
View
2  libraries/joomla/log/loggers/messagequeue.php → libraries/joomla/log/logger/messagequeue.php
@@ -20,7 +20,7 @@
* @subpackage Log
* @since 11.1
*/
-class JLogLoggerMessageQueue extends JLogLogger
+class JLogLoggerMessagequeue extends JLogLogger
{
/**
* Method to add an entry to the log.
View
0  libraries/joomla/log/loggers/syslog.php → libraries/joomla/log/logger/syslog.php
File renamed without changes
View
0  libraries/joomla/log/loggers/w3c.php → libraries/joomla/log/logger/w3c.php
File renamed without changes
View
62 libraries/joomla/pagination/object.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * @package Joomla.Platform
+ * @subpackage Pagination
+ *
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+defined('JPATH_PLATFORM') or die;
+
+/**
+ * Pagination object representing a particular item in the pagination lists.
+ *
+ * @package Joomla.Platform
+ * @subpackage Pagination
+ * @since 11.1
+ */
+class JPaginationObject
+{
+ /**
+ * @var string The link text.
+ * @since 11.1
+ */
+ public $text;
+
+ /**
+ * @var integer The number of rows as a base offset.
+ * @since 11.1
+ */
+ public $base;
+
+ /**
+ * @var string The link URL.
+ * @since 11.1
+ */
+ public $link;
+
+ /**
+ * @var integer The prefix used for request variables.
+ * @since 11.1
+ */
+ public $prefix;
+
+ /**
+ * Class constructor.
+ *
+ * @param string $text The link text.
+ * @param integer $prefix The prefix used for request variables.
+ * @param integer $base The number of rows as a base offset.
+ * @param string $link The link URL.
+ *
+ * @since 11.1
+ */
+ public function __construct($text, $prefix = '', $base = null, $link = null)
+ {
+ $this->text = $text;
+ $this->prefix = $prefix;
+ $this->base = $base;
+ $this->link = $link;
+ }
+}
View
66 libraries/joomla/html/pagination.php → libraries/joomla/pagination/pagination.php
@@ -1,7 +1,7 @@
<?php
/**
* @package Joomla.Platform
- * @subpackage HTML
+ * @subpackage Pagination
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
@@ -10,11 +10,11 @@
defined('JPATH_PLATFORM') or die;
/**
- * Pagination Class. Provides a common interface for content pagination for the
+ * Pagination Class. Provides a common interface for content pagination for the
* Joomla! Platform.
*
* @package Joomla.Platform
- * @subpackage HTML
+ * @subpackage Pagination
* @since 11.1
*/
class JPagination extends JObject
@@ -571,13 +571,13 @@ protected function _list_render($list)
/**
* Method to create an active pagination link to the item
*
- * @param JPaginationObject &$item The object with which to make an active link.
+ * @param JPaginationObject $item The object with which to make an active link.
*
* @return string HTML link
*
* @since 11.1
*/
- protected function _item_active(&$item)
+ protected function _item_active(JPaginationObject $item)
{
$app = JFactory::getApplication();
if ($app->isAdmin())
@@ -602,13 +602,13 @@ protected function _item_active(&$item)
/**
* Method to create an inactive pagination string
*
- * @param object &$item The item to be processed
+ * @param JPaginationObject $item The item to be processed
*
* @return string
*
* @since 11.1
*/
- protected function _item_inactive(&$item)
+ protected function _item_inactive(JPaginationObject $item)
{
$app = JFactory::getApplication();
if ($app->isAdmin())
@@ -701,55 +701,3 @@ protected function _buildDataObject()
return $data;
}
}
-
-/**
- * Pagination object representing a particular item in the pagination lists.
- *
- * @package Joomla.Platform
- * @subpackage HTML
- * @since 11.1
- */
-class JPaginationObject extends JObject
-{
- /**
- * @var string The link text.
- * @since 11.1
- */
- public $text;
-
- /**
- * @var integer The number of rows as a base offset.
- * @since 11.1
- */
- public $base;
-
- /**
- * @var string The link URL.
- * @since 11.1
- */
- public $link;
-
- /**
- * @var integer The prefix used for request variables.
- * @since 11.1
- */
- public $prefix;
-
- /**
- * Class constructor.
- *
- * @param string $text The link text.
- * @param integer $prefix The prefix used for request variables.
- * @param integer $base The number of rows as a base offset.
- * @param string $link The link URL.
- *
- * @since 11.1
- */
- public function __construct($text, $prefix = '', $base = null, $link = null)
- {
- $this->text = $text;
- $this->prefix = $prefix;
- $this->base = $base;
- $this->link = $link;
- }
-}
View
2  libraries/joomla/session/storage/xcache.php
@@ -13,7 +13,7 @@
* XCache session storage handler
*
* @package Joomla.Platform
- * @subpackage Cache
+ * @subpackage Session
* @since 11.1
*/
class JSessionStorageXcache extends JSessionStorage
View
8 libraries/joomla/user/user.php
@@ -236,6 +236,14 @@ public static function getInstance($identifier = 0)
$id = $identifier;
}
+ // If the $id is zero, just return an empty JUser.
+ // Note: don't cache this user because it'll have a new ID on save!
+ if ($id === 0)
+ {
+ return new JUser;
+ }
+
+ // Check if the user ID is already cached.
if (empty(self::$instances[$id]))
{
$user = new JUser($id);
View
6 libraries/joomla/html/editor.php → libraries/legacy/editor/editor.php
@@ -1,7 +1,7 @@
<?php
/**
* @package Joomla.Platform
- * @subpackage HTML
+ * @subpackage Editor
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
@@ -13,7 +13,7 @@
* JEditor class to handle WYSIWYG editors
*
* @package Joomla.Platform
- * @subpackage HTML
+ * @subpackage Editor
* @since 11.1
*/
class JEditor extends JObject
@@ -92,7 +92,7 @@ public function __construct($editor = 'none')
*
* @param string $editor The editor to use.
*
- * @return object JEditor The Editor object.
+ * @return JEditor The Editor object.
*
* @since 11.1
*/
View
11 libraries/joomla/form/fields/editor.php → libraries/legacy/form/field/editor.php
@@ -9,8 +9,6 @@
defined('JPATH_PLATFORM') or die;
-jimport('joomla.html.editor');
-
/**
* Form Field class for the Joomla Platform.
* An editarea field for content creation
@@ -93,7 +91,7 @@ protected function getInput()
*
* @since 11.1
*/
- protected function &getEditor()
+ protected function getEditor()
{
// Only create the editor if it is not already created.
if (empty($this->editor))
@@ -136,7 +134,12 @@ protected function &getEditor()
}
// Create the JEditor instance based on the given editor.
- $this->editor = JFactory::getEditor($editor ? $editor : null);
+ if (is_null($editor))
+ {
+ $conf = JFactory::getConfig();
+ $editor = $conf->get('editor');
+ }
+ $this->editor = JEditor::getInstance($editor);
}
return $this->editor;
View
47 libraries/legacy/form/field/helpsite.php
@@ -1,47 +0,0 @@
-<?php
-/**
- * @package Joomla.Platform
- * @subpackage Form
- *
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
- */
-
-defined('JPATH_PLATFORM') or die;
-
-JFormHelper::loadFieldClass('list');
-
-/**
- * Form Field class for the Joomla Platform.
- * Provides a select list of help sites.
- *
- * @package Joomla.Platform
- * @subpackage Form
- * @since 11.1
- */
-class JFormFieldHelpsite extends JFormFieldList
-{
-
- /**
- * The form field type.
- *
- * @var string
- * @since 11.1
- */
- public $type = 'Helpsite';
-
- /**
- * Method to get the help site field options.
- *
- * @return array The field option objects.
- *
- * @since 11.1
- */
- protected function getOptions()
- {
- // Merge any additional options in the XML definition.
- $options = array_merge(parent::getOptions(), JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml', $this->value));
-
- return $options;
- }
-}
View
49 libraries/legacy/form/field/menu.php
@@ -1,49 +0,0 @@
-<?php
-/**
- * @package Joomla.Platform
- * @subpackage Form
- *
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
- */
-
-defined('JPATH_PLATFORM') or die;
-
-JFormHelper::loadFieldClass('list');
-
-// Import the com_menus helper.
-require_once realpath(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');
-
-/**
- * Supports an HTML select list of menus
- *
- * @package Joomla.Platform
- * @subpackage Form
- * @since 11.1
- */
-class JFormFieldMenu extends JFormFieldList
-{
-
- /**
- * The form field type.
- *
- * @var string
- * @since 11.1
- */
- public $type = 'Menu';
-
- /**
- * Method to get the list of menus for the field options.
- *
- * @return array The field option objects.
- *
- * @since 11.1
- */
- protected function getOptions()
- {
- // Merge any additional options in the XML definition.
- $options = array_merge(parent::getOptions(), JHtml::_('menu.menus'));
-
- return $options;
- }
-}
View
129 libraries/legacy/form/field/user.php
@@ -1,129 +0,0 @@
-<?php
-/**
- * @package Joomla.Platform
- * @subpackage Form
- *
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
- */
-
-defined('JPATH_PLATFORM') or die;
-
-/**
- * Field to select a user id from a modal list.
- *
- * @package Joomla.Platform
- * @subpackage Form
- * @since 11.1
- */
-class JFormFieldUser extends JFormField
-{
- /**
- * The form field type.
- *
- * @var string
- * @since 11.1
- */
- public $type = 'User';
-
- /**
- * Method to get the user field input markup.
- *
- * @return string The field input markup.
- *
- * @since 11.1
- */
- protected function getInput()
- {
- // Initialize variables.
- $html = array();
- $groups = $this->getGroups();
- $excluded = $this->getExcluded();
- $link = 'index.php?option=com_users&amp;view=users&amp;layout=modal&amp;tmpl=component&amp;field=' . $this->id
- . (isset($groups) ? ('&amp;groups=' . base64_encode(json_encode($groups))) : '')
- . (isset($excluded) ? ('&amp;excluded=' . base64_encode(json_encode($excluded))) : '');
-
- // Initialize some field attributes.
- $attr = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
- $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
-
- // Initialize JavaScript field attributes.
- $onchange = (string) $this->element['onchange'];
-
- // Load the modal behavior script.
- JHtml::_('behavior.modal', 'a.modal_' . $this->id);
-
- // Build the script.
- $script = array();
- $script[] = ' function jSelectUser_' . $this->id . '(id, title) {';
- $script[] = ' var old_id = document.getElementById("' . $this->id . '_id").value;';
- $script[] = ' if (old_id != id) {';
- $script[] = ' document.getElementById("' . $this->id . '_id").value = id;';
- $script[] = ' document.getElementById("' . $this->id . '_name").value = title;';
- $script[] = ' ' . $onchange;
- $script[] = ' }';
- $script[] = ' SqueezeBox.close();';
- $script[] = ' }';
-
- // Add the script to the document head.
- JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
-
- // Load the current username if available.
- $table = JTable::getInstance('user');
- if ($this->value)
- {
- $table->load($this->value);
- }
- else
- {
- $table->username = JText::_('JLIB_FORM_SELECT_USER');
- }
-
- // Create a dummy text field with the user name.
- $html[] = '<div class="fltlft">';
- $html[] = ' <input type="text" id="' . $this->id . '_name"' . ' value="' . htmlspecialchars($table->name, ENT_COMPAT, 'UTF-8') . '"'
- . ' disabled="disabled"' . $attr . ' />';
- $html[] = '</div>';
-
- // Create the user select button.
- $html[] = '<div class="button2-left">';
- $html[] = ' <div class="blank">';
- if ($this->element['readonly'] != 'true')
- {
- $html[] = ' <a class="modal_' . $this->id . '" title="' . JText::_('JLIB_FORM_CHANGE_USER') . '"' . ' href="' . $link . '"'
- . ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">';
- $html[] = ' ' . JText::_('JLIB_FORM_CHANGE_USER') . '</a>';
- }
- $html[] = ' </div>';
- $html[] = '</div>';
-
- // Create the real field, hidden, that stored the user id.
- $html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />';
-
- return implode("\n", $html);
- }
-
- /**
- * Method to get the filtering groups (null means no filtering)
- *
- * @return mixed array of filtering groups or null.
- *
- * @since 11.1
- */
- protected function getGroups()
- {
- return null;
- }
-
- /**
- * Method to get the users to exclude from the list of users
- *
- * @return mixed Array of users to exclude or null to to not exclude them
- *
- * @since 11.1
- */
- protected function getExcluded()
- {
- return null;
- }
-}
View
1  libraries/legacy/model/list.php
@@ -172,7 +172,6 @@ public function getPagination()
}
// Create the pagination object.
- jimport('joomla.html.pagination');
$limit = (int) $this->getState('list.limit') - (int) $this->getState('list.links');
$page = new JPagination($this->getTotal(), $this->getStart(), $limit);
View
2  tests/bootstrap.legacy.php
@@ -19,7 +19,7 @@
// Maximise error reporting.
@ini_set('zend.ze1_compatibility_mode', '0');
-error_reporting(E_ALL);
+error_reporting(E_ALL & ~E_STRICT);
ini_set('display_errors', 1);
/*
View
2  tests/bootstrap.php
@@ -19,7 +19,7 @@
// Maximise error reporting.
@ini_set('zend.ze1_compatibility_mode', '0');
-error_reporting(E_ALL);
+error_reporting(E_ALL & ~E_STRICT);
ini_set('display_errors', 1);
/*
View
5 tests/suites/database/driver/postgresql/JDatabasePostgresqlTest.php
@@ -553,7 +553,10 @@ public function testInsertid()
*/
public function testInsertObject()
{
- self::$driver->setQuery('TRUNCATE TABLE "jos_dbtest" RESTART IDENTITY');
+ self::$driver->setQuery('ALTER SEQUENCE jos_dbtest_id_seq RESTART WITH 1');
+ $result = self::$driver->execute();
+
+ self::$driver->setQuery('TRUNCATE TABLE "jos_dbtest"');
$result = self::$driver->execute();
$tst = new JObject;
View
5 tests/suites/unit/joomla/html/JEditorTest.php → tests/suites/legacy/editor/JEditorTest.php
@@ -1,15 +1,12 @@
<?php
/**
* @package Joomla.UnitTest
- * @subpackage HTML
+ * @subpackage Editor
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/base/observable.php';
-require_once JPATH_PLATFORM.'/joomla/html/editor.php';
-
/**
* Test class for JEditor.
* Generated by PHPUnit on 2009-10-27 at 15:28:47.
View
5 tests/suites/legacy/form/field/JFormFieldContentLanguageTest.php
@@ -14,7 +14,7 @@
* @subpackage Form
* @since 11.1
*/
-class JFormFieldContentLanguageTest extends TestCaseDatabase
+class JFormFieldContentlanguageTest extends TestCaseDatabase
{
/**
* Sets up dependencies for the test.
@@ -25,7 +25,6 @@ class JFormFieldContentLanguageTest extends TestCaseDatabase
*/
protected function setUp()
{
- require_once JPATH_PLATFORM . '/legacy/form/field/contentlanguage.php';
require_once JPATH_TESTS . '/suites/unit/joomla/form/inspectors.php';
}
@@ -59,7 +58,7 @@ public function testGetInput()
'Line:'.__LINE__.' XML string should load successfully.'
);
- $field = new JFormFieldContentLanguage($form);
+ $field = new JFormFieldContentlanguage($form);
$this->assertThat(
$field->setup($form->getXml()->field, 'value'),
View
3  .../unit/joomla/form/fields/JFormFieldEditorTest.php → ...suites/legacy/form/field/JFormFieldEditorTest.php
@@ -25,8 +25,7 @@ class JFormFieldEditorTest extends TestCaseDatabase
*/
protected function setUp()
{
- require_once JPATH_PLATFORM . '/joomla/form/fields/editor.php';
- include_once dirname(__DIR__) . '/inspectors.php';
+ require_once JPATH_TESTS . '/suites/unit/joomla/form/inspectors.php';
}
/**
View
52 tests/suites/legacy/form/field/JFormFieldHelpsiteTest.php
@@ -1,52 +0,0 @@
-<?php
-/**
- * @package Joomla.UnitTest
- * @subpackage Form
- *
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
- */
-
-require_once JPATH_TESTS . '/suites/unit/joomla/form/inspectors.php';
-
-/**
- * Test class for JForm.
- *
- * @package Joomla.UnitTest
- * @subpackage Form
- */
-class JFormFieldHelpsiteTest extends TestCase
-{
- /**
- * Test the getInput method.
- * @covers JFormFieldHelpsite::getOptions
- */
- public function testGetInput()
- {
- $form = new JFormInspector('form1');
-
- $this->assertThat(
- $form->load('<form><field name="helpsite" type="helpsite" /></form>'),
- $this->isTrue(),
- 'Line:'.__LINE__.' XML string should load successfully.'
- );
-
- $field = new JFormFieldHelpsite($form);
-
- $this->assertThat(
- $field->setup($form->getXml()->field, 'value'),
- $this->isTrue(),
- 'Line:'.__LINE__.' The setup method should return true.'
- );
-
- $this->markTestIncomplete('Problems encountered in next assertion');
-
- $this->assertThat(
- strlen($field->input),
- $this->greaterThan(0),
- 'Line:'.__LINE__.' The getInput method should return something without error.'
- );
-
- // TODO: Should check all the attributes have come in properly.
- }
-}
View
53 tests/suites/legacy/form/field/JFormFieldUserTest.php
@@ -1,53 +0,0 @@
-<?php
-/**
- * @package Joomla.UnitTest
- * @subpackage Form
- *
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
- */
-
-require_once JPATH_TESTS . '/suites/unit/joomla/form/inspectors.php';
-
-/**
- * Test class for JForm.
- *
- * @package Joomla.UnitTest
- * @subpackage Form
- */
-class JFormFieldUserTest extends TestCase
-{
- /**
- * Test the getInput method.
- * @covers JFormFieldUser::getInput()
- * @covers JFormFieldUser::<!public>
- */
- public function testGetInput()
- {
- $form = new JFormInspector('form1');
-
- $this->assertThat(
- $form->load('<form><field name="user" type="user" /></form>'),
- $this->isTrue(),
- 'Line:'.__LINE__.' XML string should load successfully.'
- );
-
- $field = new JFormFieldUser($form);
-
- $this->assertThat(
- $field->setup($form->getXml()->field, 'value'),
- $this->isTrue(),
- 'Line:'.__LINE__.' The setup method should return true.'
- );
-
- $this->markTestIncomplete('Incomplete test');
-
- $this->assertThat(
- strlen($field->input),
- $this->greaterThan(0),
- 'Line:'.__LINE__.' The getInput method should return something without error.'
- );
-
- // TODO: Should check all the attributes have come in properly.
- }
-}
View
2  tests/suites/unit/joomla/application/JApplicationCliTest.php
@@ -95,7 +95,7 @@ public function test__constructDependancyInjection()
$this->returnValue('ok')
);
- $mockConfig = $this->getMock('JRegistry', array('test'), array(), '', false);
+ $mockConfig = $this->getMock('JRegistry', array('test'), array(null), '', true);
$mockConfig
->expects($this->any())
->method('test')
View
14 tests/suites/unit/joomla/application/JApplicationWebTest.php
@@ -198,7 +198,7 @@ public function test__constructDependancyInjection()
$this->returnValue('ok')
);
- $mockConfig = $this->getMock('JRegistry', array('test'), array(), '', false);
+ $mockConfig = $this->getMock('JRegistry', array('test'), array(null), '', true);
$mockConfig
->expects($this->any())
->method('test')
@@ -285,12 +285,12 @@ public function testAppendBody()
'Checks the body array has been appended.'
);
- $this->class->appendBody(array('goo'));
+ $this->class->appendBody(true);
$this->assertThat(
TestReflection::getValue($this->class, 'response')->body,
$this->equalTo(
- array('foo', 'bar', 'Array')
+ array('foo', 'bar', '1')
),
'Checks that non-strings are converted to strings.'
);
@@ -1372,12 +1372,12 @@ public function testPrependBody()
'Checks the body array has been prepended.'
);
- $this->class->prependBody(array('goo'));
+ $this->class->prependBody(true);
$this->assertThat(
TestReflection::getValue($this->class, 'response')->body,
$this->equalTo(
- array('Array', 'bar', 'foo')
+ array('1', 'bar', 'foo')
),
'Checks that non-strings are converted to strings.'
);
@@ -1738,12 +1738,12 @@ public function testSetBody()
'Checks the body array has been reset.'
);
- $this->class->setBody(array('goo'));
+ $this->class->setBody(true);
$this->assertThat(
TestReflection::getValue($this->class, 'response')->body,
$this->equalTo(
- array('Array')
+ array('1')
),
'Checks reset and that non-strings are converted to strings.'
);
View
2  tests/suites/unit/joomla/github/JGithubForksTest.php
@@ -66,7 +66,7 @@ protected function setUp()
public function testCreate()
{
$returnData = new stdClass;
- $returnData->code = 201;
+ $returnData->code = 202;
$returnData->body = $this->sampleString;
// Build the request data.
View
1  tests/suites/unit/joomla/log/loggers/JLogLoggerDatabaseTest.php
@@ -7,7 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/loggers/database.php';
require_once __DIR__.'/stubs/database/inspector.php';
/**
View
2  tests/suites/unit/joomla/log/loggers/JLogLoggerEchoTest.php
@@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/loggers/echo.php';
-
/**
* Test class for JLogLoggerEcho.
*/
View
1  tests/suites/unit/joomla/log/loggers/JLogLoggerFormattedTextTest.php
@@ -7,7 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/loggers/formattedtext.php';
require_once __DIR__.'/stubs/formattedtext/inspector.php';
/**
View
3  tests/suites/unit/joomla/log/loggers/JLogLoggerMessageQueueTest.php
@@ -7,7 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/loggers/messagequeue.php';
require_once __DIR__.'/stubs/messagequeue/mock.application.php';
/**
@@ -51,7 +50,7 @@ public function testAddEntry01()
$config = array();
// Get an instance of the logger.
- $logger = new JLogLoggerMessageQueue($config);
+ $logger = new JLogLoggerMessagequeue($config);
// Add a basic error message, it ignores the category.
$logger->addEntry(new JLogEntry('TESTING', JLog::ERROR, 'DePrEcAtEd'));
View
2  tests/suites/unit/joomla/log/loggers/JLogLoggerSyslogTest.php
@@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/loggers/syslog.php';
-
/**
* Test class for JLogLoggerSysLog.
*/
View
1  tests/suites/unit/joomla/log/loggers/JLogLoggerW3CTest.php
@@ -7,7 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/loggers/w3c.php';
require_once __DIR__.'/stubs/w3c/inspector.php';
/**
View
2  tests/suites/unit/joomla/log/loggers/stubs/formattedtext/inspector.php
@@ -15,7 +15,7 @@
* @package Joomla.UnitTest
* @subpackage Log
*/
-class JLogLoggerFormattedTextInspector extends JLogLoggerFormattedText
+class JLogLoggerFormattedTextInspector extends JLogLoggerFormattedtext
{
public $file;
public $format = '{DATETIME} {PRIORITY} {CATEGORY} {MESSAGE}';
View
2  tests/suites/unit/joomla/log/loggers/stubs/w3c/inspector.php
@@ -15,7 +15,7 @@
* @package Joomla.UnitTest
* @subpackage Log
*/
-class JLogLoggerW3CInspector extends JLogLoggerW3C
+class JLogLoggerW3CInspector extends JLogLoggerW3c
{
public $file;
public $format = '{DATE} {TIME} {PRIORITY} {CLIENTIP} {CATEGORY} {MESSAGE}';
View
5 tests/suites/unit/joomla/html/JPaginationTest.php → ...suites/unit/joomla/pagination/JPaginationTest.php
@@ -1,14 +1,12 @@
<?php
/**
* @package Joomla.UnitTest
- * @subpackage HTML
+ * @subpackage Pagination
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/html/pagination.php';
-
class JPaginationTest extends PHPUnit_Framework_TestCase
{
/**
@@ -69,6 +67,7 @@ public function dataTestConstructor()
*
* @since 11.1
* @dataProvider dataTestConstructor
+ * @covers JPagination::__construct
*/
public function testConstructor($total, $limitstart, $limit, $expected)
{
Please sign in to comment.
Something went wrong with that request. Please try again.