Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Style fixes to make code (more) readable. #1570

Merged
merged 1 commit into from Oct 6, 2012
Jump to file or symbol
Failed to load files and symbols.
+19 −24
Split
@@ -36,46 +36,41 @@ class JCacheStorageMemcacheTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
- $memcachetest = false;
include_once JPATH_PLATFORM.'/joomla/cache/storage.php';
include_once JPATH_PLATFORM.'/joomla/cache/storage/memcache.php';
- if ((extension_loaded('memcache') && class_exists('Memcache')) != true ) {
+ $memcachetest = false;
+
+ if (!extension_loaded('memcache') || !class_exists('Memcache'))
+ {
$this->memcacheAvailable = false;
}
- else {
+ else
+ {
$config = JFactory::getConfig();
$host = $config->get('memcache_server_host', 'localhost');
$port = $config->get('memcache_server_port', 11211);
$memcache = new Memcache;
- $memcachetest = @$memcache->connect($host, $port); }
-
- if (!$memcachetest) {
- $this->memcacheAvailable = false;
- }
- else {
- $this->memcacheAvailable = true;
- }
+ $memcachetest = @$memcache->connect($host, $port);
+ }
+ if (!$memcachetest)
+ {
+ $this->memcacheAvailable = false;
+ }
+ else
+ {
+ $this->memcacheAvailable = true;
+ }
- if ($this->memcacheAvailable) {
+ if ($this->memcacheAvailable)
+ {
$this->object = JCacheStorage::getInstance('memcache');
}
}
/**
- * Tears down the fixture, for example, closes a network connection.
- * This method is called after a test is executed.
- *
- * @return void
- * @access protected
- */
- protected function tearDown()
- {
- }
-
- /**
* @return void
* @todo Implement testGetConnection().
*/
@@ -224,4 +219,4 @@ public function testGetCacheId()
}
}
}
-?>
+