Skip to content

UT 4/10: Codecoverage fixes for base package #517

Merged
merged 1 commit into from Nov 13, 2011
View
2 libraries/joomla/base/object.php
@@ -239,9 +239,11 @@ public function setError($error)
*/
function toString()
{
+ // @codeCoverageIgnoreStart
// Deprecation warning.
JLog::add('JObject::toString() is deprecated.', JLog::WARNING, 'deprecated');
return $this->__toString();
+ // @codeCoverageIgnoreEnd
}
}
View
1 libraries/joomla/base/observable.php
@@ -16,6 +16,7 @@
* @subpackage Base
* @since 11.1
* @deprecated 12.3
+ * @codeCoverageIgnore
*/
class JObservable extends JObject
{
View
1 libraries/joomla/base/observer.php
@@ -16,6 +16,7 @@
* @subpackage Base
* @since 11.1
* @deprecated 12.3
+ * @codeCoverageIgnore
*/
abstract class JObserver extends JObject
{
View
11 tests/suite/joomla/base/JObjectTest.php
@@ -150,6 +150,17 @@ public function testGetError() {
$this->o->getError(),
'Should return the third test error'
);
+ $this->assertFalse(
+ $this->o->getError(20),
+ 'Should return false, since the error does not exist'
+ );
+
+ $exception = new Exception('error');
+ $this->o->setError($exception);
+ $this->assertThat(
+ $this->o->getError(3, true),
+ $this->equalTo((string)$exception)
+ );
}
/**
View
110 tests/suite/joomla/cache/JCacheControllerTest.php
@@ -0,0 +1,110 @@
+<?php
+/**
+ * @package Joomla.UnitTest
+ *
+ * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+include_once JPATH_PLATFORM . '/joomla/cache/controller.php';
+
+/**
+ * Test class for JCacheController.
+ * Generated by PHPUnit on 2011-10-26 at 19:33:28.
+ */
+class JCacheControllerTest extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @var JCacheController
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp() {
+ //$this->object = new JCacheController;
+ }
+
+ /**
+ * Tears down the fixture, for example, closes a network connection.
+ * This method is called after a test is executed.
+ */
+ protected function tearDown() {
+
+ }
+
+ /**
+ * @todo Implement test__call().
+ */
+ public function test__call() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testGetInstance().
+ */
+ public function testGetInstance() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testSetCaching().
+ */
+ public function testSetCaching() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testSetLifeTime().
+ */
+ public function testSetLifeTime() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testAddIncludePath().
+ */
+ public function testAddIncludePath() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testGet().
+ */
+ public function testGet() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testStore().
+ */
+ public function testStore() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+}
+
+?>
View
10 tests/suite/joomla/cache/JCacheStorageTest.php
@@ -79,7 +79,12 @@ protected function setUp()
JCacheStorageTest::$actualError = array();
$this->object = new JCacheStorage;
-
+
+ $this->checkStores();
+ }
+
+ protected function checkStores()
+ {
$this->apcAvailable = extension_loaded('apc');
$this->eacceleratorAvailable = extension_loaded('eaccelerator') && function_exists('eaccelerator_get');
$this->memcacheAvailable = (extension_loaded('memcache') && class_exists('Memcache')) != true;
@@ -105,6 +110,7 @@ protected function tearDown()
*/
function casesGetInstance()
{
+ $this->checkStores();
return array(
'defaultfile' => array(
'file',
@@ -127,7 +133,7 @@ function casesGetInstance()
'lifetime' => null,
'now' => time(),
),
- $this->apcAvailable ? 'JCacheStorageApc' : false,
+ ($this->apcAvailable ? 'JCacheStorageApc' : false),
),
'defaulteaccelerator' => array(
'eaccelerator',
View
111 tests/suite/joomla/cache/storage/JCacheStorageCacheliteTest.php
@@ -0,0 +1,111 @@
+<?php
+/**
+ * @package Joomla.UnitTest
+ *
+ * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+include_once JPATH_PLATFORM . '/joomla/cache/storage.php';
+include_once JPATH_PLATFORM . '/joomla/cache/storage/cachelite.php';
+
+/**
+ * Test class for JCacheStorageCachelite.
+ * Generated by PHPUnit on 2011-10-26 at 19:41:40.
+ */
+class JCacheStorageCacheliteTest extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @var JCacheStorageCachelite
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp() {
+ //$this->object = new JCacheStorageCachelite;
+ }
+
+ /**
+ * Tears down the fixture, for example, closes a network connection.
+ * This method is called after a test is executed.
+ */
+ protected function tearDown() {
+
+ }
+
+ /**
+ * @todo Implement testGet().
+ */
+ public function testGet() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testGetAll().
+ */
+ public function testGetAll() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testStore().
+ */
+ public function testStore() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testRemove().
+ */
+ public function testRemove() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testClean().
+ */
+ public function testClean() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testGc().
+ */
+ public function testGc() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testTest().
+ */
+ public function testTest() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+}
+
+?>
View
110 tests/suite/joomla/cache/storage/JCacheStorageWincacheTest.php
@@ -0,0 +1,110 @@
+<?php
+/**
+ * @package Joomla.UnitTest
+ *
+ * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+include_once JPATH_PLATFORM . '/joomla/cache/storage/wincache.php';
+
+/**
+ * Test class for JCacheStorageWincache.
+ * Generated by PHPUnit on 2011-10-26 at 19:41:46.
+ */
+class JCacheStorageWincacheTest extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @var JCacheStorageWincache
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp() {
+ //$this->object = new JCacheStorageWincache;
+ }
+
+ /**
+ * Tears down the fixture, for example, closes a network connection.
+ * This method is called after a test is executed.
+ */
+ protected function tearDown() {
+
+ }
+
+ /**
+ * @todo Implement testGet().
+ */
+ public function testGet() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testGetAll().
+ */
+ public function testGetAll() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testStore().
+ */
+ public function testStore() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testRemove().
+ */
+ public function testRemove() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testClean().
+ */
+ public function testClean() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testGc().
+ */
+ public function testGc() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+ /**
+ * @todo Implement testTest().
+ */
+ public function testTest() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+}
+
+?>
View
50 tests/suite/joomla/cache/storage/helpers/JCacheStorageHelperTest.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * @package Joomla.UnitTest
+ *
+ * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ */
+
+include_once JPATH_PLATFORM . '/joomla/cache/storage/helpers/helper.php';
+
+/**
+ * Test class for JCacheStorageHelper.
+ * Generated by PHPUnit on 2011-10-26 at 19:38:58.
+ */
+class JCacheStorageHelperTest extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @var JCacheStorageHelper
+ */
+ protected $object;
+
+ /**
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test is executed.
+ */
+ protected function setUp() {
+ //$this->object = new JCacheStorageHelper;
+ }
+
+ /**
+ * Tears down the fixture, for example, closes a network connection.
+ * This method is called after a test is executed.
+ */
+ protected function tearDown() {
+
+ }
+
+ /**
+ * @todo Implement testUpdateSize().
+ */
+ public function testUpdateSize() {
+ // Remove the following lines when you implement this test.
+ $this->markTestIncomplete(
+ 'This test has not been implemented yet.'
+ );
+ }
+
+}
+
+?>
Something went wrong with that request. Please try again.