Changeset 8782bd4 in iPeer


Ignore:
Timestamp:
2012-12-10T22:56:43-08:00 (6 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
3ec1eb5
Parents:
92c5185
git-author:
Compass <pan.luo@…> (12/10/2012 10:47:17 PM)
git-committer:
Compass <pan.luo@…> (12/10/2012 10:56:43 PM)
Message:

Fixed a bug that controller in extended auth test case didn't get properly initialized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/libs/extended_auth_test_case.php

    r92c5185 r8782bd4  
    4040            return parent::testAction($url, $params);
    4141        }
     42
     43        // reset parameters
     44        ClassRegistry::flush();
     45        $Controller->passedArgs = array();
     46        $Controller->params = array();
     47        $Controller->url = null;
     48        $Controller->action = null;
     49        $Controller->viewVars = array();
     50        $keys = ClassRegistry::keys();
     51        foreach ($keys as $key) {
     52            if (is_a(ClassRegistry::getObject(Inflector::camelize($key)), 'Model')) {
     53                ClassRegistry::getObject(Inflector::camelize($key))->create(false);
     54            }
     55        }
     56
    4257        $Controller->__construct();
    4358        $Controller->constructClasses();
     59
     60        $Controller->Session->delete('Message');
     61        $Controller->activeUser = null;
    4462
    4563        $default = array(
     
    5674        $params = array_merge($default, $params);
    5775
    58         // reset parameters
    59         ClassRegistry::flush();
    60         $Controller->passedArgs = array();
    61         $Controller->params = array();
    62         $Controller->url = null;
    63         $Controller->action = null;
    64         $Controller->viewVars = array();
    65         $keys = ClassRegistry::keys();
    66         foreach ($keys as $key) {
    67             if (is_a(ClassRegistry::getObject(Inflector::camelize($key)), 'Model')) {
    68                 ClassRegistry::getObject(Inflector::camelize($key))->create(false);
    69             }
    70         }
    71         $Controller->Session->delete('Message');
    72         $Controller->activeUser = null;
    7376
    7477        $default = array(
Note: See TracChangeset for help on using the changeset viewer.