mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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:
parent
88da8d5b44
commit
047b331c5b
1 changed files with 4 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue