This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Style fixes to make code (more) readable.

  • Loading branch information...
Ian MacLennan
Ian MacLennan committed Oct 6, 2012
1 parent f1dfc46 commit 884e17bb0fe8cc81e822725967feebdf835e7f11
Showing with 19 additions and 24 deletions.
  1. +19 −24 tests/suites/unit/joomla/cache/storage/JCacheStorageMemcacheTest.php
@@ -36,45 +36,40 @@ 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()
}
}
}
-?>
+

0 comments on commit 884e17b

Please sign in to comment.