mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06: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
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function requestAction($url, $requested = true, $data = null, $method = 'post') {
|
function requestAction($url, $requested = true, $data = null, $method = 'post') {
|
||||||
$params = array();
|
|
||||||
|
|
||||||
if (!$requested) {
|
|
||||||
$params['return'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_array($data) && !empty($data)) {
|
if (is_array($data) && !empty($data)) {
|
||||||
$data = array('data' => $data);
|
$data = array('data' => $data);
|
||||||
|
|
||||||
|
@ -110,11 +104,13 @@ class CakeTestCase extends UnitTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
$dispatcher =& new Dispatcher();
|
$dispatcher =& new Dispatcher();
|
||||||
if (in_array('return', $params)) {
|
$params = array();
|
||||||
|
|
||||||
|
if (!$requested) {
|
||||||
$params['return'] = 0;
|
$params['return'] = 0;
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
@$dispatcher->dispatch($url, $params);
|
@$dispatcher->dispatch($url, $params);
|
||||||
|
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
} else {
|
} else {
|
||||||
$params['return'] = 1;
|
$params['return'] = 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue