Improved code

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4871 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-04-17 08:45:06 +00:00
parent 88da8d5b44
commit 047b331c5b

View file

@ -93,12 +93,6 @@ class CakeTestCase extends UnitTestCase {
* @access protected
*/
function requestAction($url, $requested = true, $data = null, $method = 'post') {
$params = array();
if (!$requested) {
$params['return'] = true;
}
if (is_array($data) && !empty($data)) {
$data = array('data' => $data);
@ -110,11 +104,13 @@ class CakeTestCase extends UnitTestCase {
}
$dispatcher =& new Dispatcher();
if (in_array('return', $params)) {
$params = array();
if (!$requested) {
$params['return'] = 0;
ob_start();
@$dispatcher->dispatch($url, $params);
$result = ob_get_clean();
} else {
$params['return'] = 1;