Skip to content

Commit

Permalink
Some improvements in tests #4:
Browse files Browse the repository at this point in the history
- removal of some unused variables (and inserted todo's if unclear)
- removal of null assignments on class properties;
  • Loading branch information
frankmayer committed Dec 29, 2016
1 parent 3cca174 commit 70241c8
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion tests/unit/core/case/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ protected function saveFactoryState()
protected function setErrorHandlers($errorHandlers)
{
$mode = null;
$options = null;

foreach ($errorHandlers as $type => $params)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/core/mock/database/driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestMockDatabaseDriver
* @var mixed
* @since 11.3
*/
public static $lastQuery = null;
public static $lastQuery;

/**
* Creates and instance of the mock JDatabaseDriver object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class JDatabaseExporterMysqlTest extends TestCase
/**
* @var JDatabaseDriverMysql The mocked database object for use by test methods.
*/
protected $dbo = null;
protected $dbo;

/**
* This method is called before the first test of this test class is run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class JDatabaseExporterMysqliTest extends TestCase
/**
* @var JDatabaseDriverMysqli The mocked database object for use by test methods.
*/
protected $dbo = null;
protected $dbo;

/**
* Sets up the testing conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class JDatabaseExporterPdomysqlTest extends PHPUnit_Framework_TestCase
* @var object The mocked database object for use by test methods.
* @since 3.4
*/
protected $dbo = null;
protected $dbo;

/**
* Sets up the testing conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class JDatabaseExporterPostgresqlTest extends TestCase
/**
* @var JDatabaseDriverPostgresql The mocked database object for use by test methods.
*/
protected $dbo = null;
protected $dbo;

/**
* @var string A query string or object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function __construct($options = array())
*/
public function get($id, $group, $checkTime = true)
{
//todo: OK to remove this unused assignment? Or is some implementation missing?
$cache_id = $this->_getCacheId($id, $group);

if (isset($this->_storage[$id]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class JFeedParserMock extends JFeedParser
* @var mixed The value to return when the parse method is called.
* @since 12.3
*/
public static $parseReturn = null;
public static $parseReturn;

/**
* Do Nothing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class JGoogleAuthOauth2Test extends TestCase
*
* @var int
*/
private static $closed = null;
private static $closed;

/**
* Backup of the SERVER superglobal
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/suites/libraries/joomla/language/JLanguageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,8 @@ public function testParseXMLLanguageFile()
'Line: ' . __LINE__
);

//todo: OK to remove this unused assignment and following assertion? Or is some implementation missing?
$path2 = __DIR__ . '/data/language/es-ES/es-ES.xml';
$this->assertEquals(
$option,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class JOAuth2ClientTest extends TestCase
*
* @var int
*/
private static $closed = null;
private static $closed;

/**
* Backup of the SERVER superglobal
Expand Down

0 comments on commit 70241c8

Please sign in to comment.