Skip to content

Commit

Permalink
Make constructor param $version last. 1.0a is used more often
Browse files Browse the repository at this point in the history
Change contructor param order in test file
  • Loading branch information
dianaprajescu committed Jan 10, 2013
1 parent 4e00f8d commit 96d3f6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions libraries/joomla/oauth1/client.php
Expand Up @@ -59,21 +59,22 @@ abstract class JOAuth1Client
/**
* Constructor.
*
* @param string $version Specify the OAuth version. By default we are using 1.0a.
* @param JRegistry $options OAuth1Client options object.
* @param JHttp $client The HTTP client object.
* @param JInput $input The input object
* @param JApplicationWeb $application The application object
* @param string $version Specify the OAuth version. By default we are using 1.0a.
*
* @since 12.3
*/
public function __construct($version = null, JRegistry $options = null, JHttp $client = null, JInput $input = null, JApplicationWeb $application = null)
public function __construct(JRegistry $options = null, JHttp $client = null, JInput $input = null, JApplicationWeb $application = null,
$version = null)
{
$this->version = isset($version) ? $version : '1.0a';
$this->options = isset($options) ? $options : new JRegistry;
$this->client = isset($client) ? $client : JHttpFactory::getHttp($this->options);
$this->input = isset($input) ? $input : JFactory::getApplication()->input;
$this->application = isset($application) ? $application : new JApplicationWeb;
$this->version = isset($version) ? $version : '1.0a';
}

/**
Expand Down
3 changes: 1 addition & 2 deletions tests/suites/unit/joomla/oauth1/JOAuth1ClientTest.php
Expand Up @@ -7,7 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

require_once JPATH_PLATFORM . '/joomla/oauth1/client.php';
include_once __DIR__ . '/stubs/JOAuth1ClientInspector.php';
include_once __DIR__ . '/../application/stubs/JApplicationWebInspector.php';

Expand Down Expand Up @@ -88,7 +87,7 @@ protected function setUp()

$this->options->set('consumer_key', $key);
$this->options->set('consumer_secret', $secret);
$this->object = new JOAuth1ClientInspector(null, $this->options, $this->client, $this->input, $this->application);
$this->object = new JOAuth1ClientInspector($this->options, $this->client, $this->input, $this->application);
}

/**
Expand Down

0 comments on commit 96d3f6c

Please sign in to comment.