Skip to content

Commit

Permalink
Merge pull request joomla#13408 from frankmayer/improvements-in-tests-4
Browse files Browse the repository at this point in the history
Some improvements in tests #4:
  • Loading branch information
wilsonge authored Dec 30, 2016
2 parents 7765af7 + cae13bf commit 57337f7
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 32 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 @@ -46,9 +46,9 @@ public function get($id, $group, $checkTime = true)
{
$cache_id = $this->_getCacheId($id, $group);

if (isset($this->_storage[$id]))
if (isset($this->_storage[$cache_id]))
{
return $this->_storage[$id];
return $this->_storage[$cache_id];
}

return false;
Expand All @@ -69,7 +69,7 @@ public function store($id, $group, $data)
{
$cache_id = $this->_getCacheId($id, $group);

return ($this->_storage[$id] = $data);
return ($this->_storage[$cache_id] = $data);
}

/**
Expand All @@ -85,7 +85,7 @@ public function store($id, $group, $data)
public function remove($id, $group)
{
$cache_id = $this->_getCacheId($id, $group);
unset($this->_storage[$id]);
unset($this->_storage[$cache_id]);
}

/**
Expand All @@ -105,18 +105,6 @@ public function clean($group, $mode = null)
return ($this->_storage = array());
}

/**
* Test to see if the storage handler is available.
*
* @return boolean True on success, false otherwise
*
* @since 12.1
*/
public static function isSupported()
{
return true;
}

/**
* Get a cache_id string from an id/group pair
*
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
7 changes: 0 additions & 7 deletions tests/unit/suites/libraries/joomla/language/JLanguageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1200,13 +1200,6 @@ public function testParseXMLLanguageFile()
JLanguage::parseXMLLanguageFile($path),
'Line: ' . __LINE__
);

$path2 = __DIR__ . '/data/language/es-ES/es-ES.xml';
$this->assertEquals(
$option,
JLanguage::parseXMLLanguageFile($path),
'Line: ' . __LINE__
);
}

/**
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 57337f7

Please sign in to comment.