Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Renaming JWebMock to JApplicationWebMock
Browse files Browse the repository at this point in the history
  • Loading branch information
pasamio committed Jan 7, 2012
1 parent 234e56f commit 26955ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions tests/includes/JoomlaDatabaseTestCase.php
Expand Up @@ -516,7 +516,7 @@ public function getMockSession($options = array())
*
* @param array $options A set of options to configure the mock.
*
* @return JWeb
* @return JApplicationWeb
*
* @since 12.1
*/
Expand All @@ -526,8 +526,8 @@ public function getMockWeb($options = array())
require_once JPATH_PLATFORM . '/joomla/application/web.php';

// Load the mock class builder.
require_once JPATH_TESTS . '/includes/mocks/JWebMock.php';
require_once JPATH_TESTS . '/includes/mocks/JApplicationWebMock.php';

return JWebGlobalMock::create($this, $options);
return JApplicationWebGlobalMock::create($this, $options);
}
}
6 changes: 3 additions & 3 deletions tests/includes/JoomlaTestCase.php
Expand Up @@ -457,7 +457,7 @@ public function getMockSession($options = array())
*
* @param array $options A set of options to configure the mock.
*
* @return JWeb
* @return JApplicationWeb
*
* @since 12.1
*/
Expand All @@ -467,8 +467,8 @@ public function getMockWeb($options = array())
require_once JPATH_PLATFORM . '/joomla/application/web.php';

// Load the mock class builder.
require_once JPATH_TESTS . '/includes/mocks/JWebMock.php';
require_once JPATH_TESTS . '/includes/mocks/JApplicationWebMock.php';

return JWebGlobalMock::create($this, $options);
return JApplicationWebGlobalMock::create($this, $options);
}
}
Expand Up @@ -11,15 +11,15 @@
require_once __DIR__ . '/JSessionMock.php';

/**
* Mock class for JWeb.
* Mock class for JApplicationWeb.
*
* @package Joomla.UnitTest
* @since 12.1
*/
class JWebGlobalMock
class JApplicationWebGlobalMock
{
/**
* Creates and instance of the mock JWeb object.
* Creates and instance of the mock JApplicationWeb object.
*
* @param object $test A test object.
* @param array $options A set of options to configure the mock.
Expand All @@ -36,7 +36,7 @@ public static function create($test, $options = array())
$_SERVER['HTTP_HOST'] = 'localhost';
}

// Collect all the relevant methods in JWeb (work in progress).
// Collect all the relevant methods in JApplicationWeb (work in progress).
$methods = array(
'get',
'getDocument',
Expand All @@ -46,7 +46,7 @@ public static function create($test, $options = array())

// Create the mock.
$mockObject = $test->getMock(
'JWeb',
'JApplicationWeb',
$methods,
// Constructor arguments.
array(),
Expand All @@ -56,13 +56,13 @@ public static function create($test, $options = array())
true
);

// Mock calls to JWeb::getDocument().
// Mock calls to JApplicationWeb::getDocument().
$mockObject->expects($test->any())->method('getDocument')->will($test->returnValue(JDocumentGlobalMock::create($test)));

// Mock calls to JWeb::getLanguage().
// Mock calls to JApplicationWeb::getLanguage().
$mockObject->expects($test->any())->method('getLanguage')->will($test->returnValue(JLanguageGlobalMock::create($test)));

// Mock a call to JWeb::getSession().
// Mock a call to JApplicationWeb::getSession().
if (isset($options['session']))
{
$mockObject->expects($test->any())->method('getSession')->will($test->returnValue($options['session']));
Expand Down

0 comments on commit 26955ef

Please sign in to comment.