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

Commit

Permalink
Fix code style in tests/suites/unit/joomla/application
Browse files Browse the repository at this point in the history
(cherry-picked from a9320db)
  • Loading branch information
elkuku committed Oct 8, 2012
1 parent eb0a98d commit 5a7e7ff
Show file tree
Hide file tree
Showing 3 changed files with 1,964 additions and 1,828 deletions.
33 changes: 17 additions & 16 deletions tests/suites/unit/joomla/application/JApplicationCliTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/

include_once __DIR__.'/stubs/JApplicationCliInspector.php';
include_once __DIR__ . '/stubs/JApplicationCliInspector.php';

/**
* Test class for JApplicationCli.
Expand Down Expand Up @@ -75,7 +75,7 @@ public function test__construct()
// TODO Test that configuration data loaded.

$this->assertGreaterThan(2001, $this->class->get('execution.datetime'), 'Tests execution.datetime was set.');
$this->assertGreaterThan(1, $this->class->get('execution.timestamp'), 'Tests execution.timestamp was set.' );
$this->assertGreaterThan(1, $this->class->get('execution.timestamp'), 'Tests execution.timestamp was set.');
}

/**
Expand All @@ -92,24 +92,24 @@ public function test__constructDependancyInjection()
->expects($this->any())
->method('test')
->will(
$this->returnValue('ok')
);
$this->returnValue('ok')
);

$mockConfig = $this->getMock('JRegistry', array('test'), array(null), '', true);
$mockConfig
->expects($this->any())
->method('test')
->will(
$this->returnValue('ok')
);
$this->returnValue('ok')
);

$mockDispatcher = $this->getMockDispatcher();
$mockDispatcher
->expects($this->any())
->method('test')
->will(
$this->returnValue('ok')
);
$this->returnValue('ok')
);

$class = new JApplicationCliInspector($mockInput, $mockConfig, $mockDispatcher);

Expand Down Expand Up @@ -186,24 +186,25 @@ public function testExecute()
public function getFetchConfigurationData()
{
return array(
// file, class, expectsClass, (expected result array), whether there should be an exception
// Note: file, class, expectsClass, (expected result array), whether there should be an exception
'Default configuration class' => array(null, null, 'JConfig', 'ConfigEval'),
'Custom file, invalid class' => array(JPATH_BASE . '/config.JCli-wrongclass.php', 'noclass', false, array(), true),
'Custom file, invalid class' => array(JPATH_BASE . '/config.JCli-wrongclass.php', 'noclass', false, array(), true),
);
}

/**
* Tests the JApplicationCli::fetchConfigurationData method.
*
* @param string $fileName The name of the configuration file.
* @param string $fileName The name of the configuration file.
* @param boolean $expectsClass The result is expected to be a class.
* @param array $expects The expected result as an array.
* @param string $file The name of the configuration file.
* @param string $class The name of the class.
* @param boolean $expectsClass The result is expected to be a class.
* @param array $expects The expected result as an array.
* @param boolean $expectedException The expected exception
*
* @return void
*
* @dataProvider getFetchConfigurationData
* @since 11.3
* @since 11.3
*/
public function testFetchConfigurationData($file, $class, $expectsClass, $expects, $expectedException = false)
{
Expand All @@ -228,7 +229,7 @@ public function testFetchConfigurationData($file, $class, $expectsClass, $expect
if ($expects == 'ConfigEval')
{
$expects = new JConfig;
$expects = (array)$expects;
$expects = (array) $expects;
}

if ($expectsClass)
Expand Down
Loading

0 comments on commit 5a7e7ff

Please sign in to comment.