Changeset 1682
- Timestamp:
- 03/05/10 10:28:11 (5 months ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
plugins/ullCorePlugin/lib/task/UserDeactivationTask.class.php (modified) (3 diffs)
-
test/functional/frontend/ullCorePlugin/ullUserSearchBasicTest.php (modified) (2 diffs)
-
test/functional/frontend/ullCorePlugin/ullUserSearchRangeTest.php (modified) (2 diffs)
-
test/functional/frontend/ullCorePlugin/ullUserSearchTypesTest.php (modified) (3 diffs)
-
test/unit/ullCorePlugin/ullUserDeactivationTaskTest.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/ullCorePlugin/lib/task/UserDeactivationTask.class.php
r1680 r1682 26 26 protected function execute($arguments = array(), $options = array()) 27 27 { 28 // Delegated to a public method to allow testing 29 $this->deactivateUsers($arguments, $options); 30 } 31 32 33 public function deactivateUsers($arguments = array(), $options = array()) 34 { 28 35 $this->initializeDatabaseConnection($arguments, $options); 29 36 … … 31 38 32 39 $q 33 ->update('UllUser u') 34 ->set('u.ull_user_status_id', '?', Doctrine::getTable('UllUserStatus')->findOneBySlug('inactive')->id) 40 ->from('UllUser u') 35 41 ->where('u.deactivation_date <= ?', date('Y-m-d')) 36 42 ->orWhere('u.separation_date <= ?', date('Y-m-d')) … … 38 44 ; 39 45 40 $ num= $q->execute();46 $users = $q->execute(); 41 47 42 $this->log("Deactivated {$num} users"); 48 $this->logSection($this->name, 'Deactivating ' . count($users) . ' users'); 49 50 foreach ($users as $user) 51 { 52 $this->log('Deactivating '. $user->display_name); 53 $user['ull_user_status_id'] = Doctrine::getTable('UllUserStatus')->findOneBySlug('inactive')->id; 54 $user->save(); 55 } 43 56 } 44 57 -
trunk/test/functional/frontend/ullCorePlugin/ullUserSearchBasicTest.php
r1496 r1682 67 67 ->isParameter('action', 'list') 68 68 ->end() 69 70 // redirect to edit if single result 71 ->with('response')->begin() 72 ->isRedirected() 73 ->isStatusCode(302) 74 ->end() 75 ->followRedirect() 76 ->with('request')->begin() 77 ->isParameter('module', 'ullUser') 78 ->isParameter('action', 'edit') 79 ->end() 80 ->with('response')->begin() 81 ->isStatusCode(200) 82 ->end() 83 ->click('Result list') 84 85 ->with('request')->begin() 86 ->isParameter('module', 'ullUser') 87 ->isParameter('action', 'list') 88 ->end() 69 89 ->with('response')->begin() 70 90 ->isStatusCode(200) … … 130 150 131 151 $browser 152 ->with('request')->begin() 153 ->isParameter('module', 'ullUser') 154 ->isParameter('action', 'list') 155 ->end() 156 157 // redirect to edit if single result 158 ->with('response')->begin() 159 ->isRedirected() 160 ->isStatusCode(302) 161 ->end() 162 ->followRedirect() 163 ->with('request')->begin() 164 ->isParameter('module', 'ullUser') 165 ->isParameter('action', 'edit') 166 ->end() 167 ->with('response')->begin() 168 ->isStatusCode(200) 169 ->end() 170 ->click('Result list') 171 132 172 ->with('request')->begin() 133 173 ->isParameter('module', 'ullUser') -
trunk/test/functional/frontend/ullCorePlugin/ullUserSearchRangeTest.php
r1561 r1682 190 190 ->isParameter('action', 'list') 191 191 ->end() 192 193 // redirect to edit if single result 194 ->with('response')->begin() 195 ->isRedirected() 196 ->isStatusCode(302) 197 ->end() 198 ->followRedirect() 199 ->with('request')->begin() 200 ->isParameter('module', 'ullUser') 201 ->isParameter('action', 'edit') 202 ->end() 203 ->with('response')->begin() 204 ->isStatusCode(200) 205 ->end() 206 ->click('Result list') 207 208 ->with('request')->begin() 209 ->isParameter('module', 'ullUser') 210 ->isParameter('action', 'list') 211 ->end() 192 212 ->with('response')->begin() 193 213 ->isStatusCode(200) … … 244 264 ->isParameter('action', 'list') 245 265 ->end() 266 267 // redirect to edit if single result 268 ->with('response')->begin() 269 ->isRedirected() 270 ->isStatusCode(302) 271 ->end() 272 ->followRedirect() 273 ->with('request')->begin() 274 ->isParameter('module', 'ullUser') 275 ->isParameter('action', 'edit') 276 ->end() 277 ->with('response')->begin() 278 ->isStatusCode(200) 279 ->end() 280 ->click('Result list') 281 282 ->with('request')->begin() 283 ->isParameter('module', 'ullUser') 284 ->isParameter('action', 'list') 285 ->end() 246 286 ->with('response')->begin() 247 287 ->isStatusCode(200) -
trunk/test/functional/frontend/ullCorePlugin/ullUserSearchTypesTest.php
r1496 r1682 85 85 ->isParameter('action', 'list') 86 86 ->end() 87 88 // redirect to edit if single result 89 ->with('response')->begin() 90 ->isRedirected() 91 ->isStatusCode(302) 92 ->end() 93 ->followRedirect() 94 ->with('request')->begin() 95 ->isParameter('module', 'ullUser') 96 ->isParameter('action', 'edit') 97 ->end() 98 ->with('response')->begin() 99 ->isStatusCode(200) 100 ->end() 101 ->click('Result list') 102 103 ->with('request')->begin() 104 ->isParameter('module', 'ullUser') 105 ->isParameter('action', 'list') 106 ->end() 87 107 ->with('response')->begin() 88 108 ->isStatusCode(200) … … 120 140 ->isParameter('action', 'list') 121 141 ->end() 142 143 // redirect to edit if single result 144 ->with('response')->begin() 145 ->isRedirected() 146 ->isStatusCode(302) 147 ->end() 148 ->followRedirect() 149 ->with('request')->begin() 150 ->isParameter('module', 'ullUser') 151 ->isParameter('action', 'edit') 152 ->end() 153 ->with('response')->begin() 154 ->isStatusCode(200) 155 ->end() 156 ->click('Result list') 157 158 ->with('request')->begin() 159 ->isParameter('module', 'ullUser') 160 ->isParameter('action', 'list') 161 ->end() 122 162 ->with('response')->begin() 123 163 ->isStatusCode(200) … … 155 195 ->isParameter('action', 'list') 156 196 ->end() 197 198 // redirect to edit if single result 199 ->with('response')->begin() 200 ->isRedirected() 201 ->isStatusCode(302) 202 ->end() 203 ->followRedirect() 204 ->with('request')->begin() 205 ->isParameter('module', 'ullUser') 206 ->isParameter('action', 'edit') 207 ->end() 208 ->with('response')->begin() 209 ->isStatusCode(200) 210 ->end() 211 ->click('Result list') 212 213 ->with('request')->begin() 214 ->isParameter('module', 'ullUser') 215 ->isParameter('action', 'list') 216 ->end() 157 217 ->with('response')->begin() 158 218 ->isStatusCode(200) -
trunk/test/unit/ullCorePlugin/ullUserDeactivationTaskTest.php
r1677 r1682 16 16 $app = 'frontend'; 17 17 18 $t->begin(' execute()');18 $t->begin('deactivateUsers()'); 19 19 20 20 $q = new UllQuery('UllUser'); … … 23 23 24 24 $task = new UserDeactivationTask(new sfEventDispatcher(), new sfFormatter()); 25 $task-> execute(array('application' => $app, 'env' => 'test'));25 $task->deactivateUsers(array('application' => $app, 'env' => 'test')); 26 26 27 27 $q = new UllQuery('UllUser'); … … 35 35 36 36 $task = new UserDeactivationTask(new sfEventDispatcher(), new sfFormatter()); 37 $task-> execute(array('application' => $app, 'env' => 'test'));37 $task->deactivateUsers(array('application' => $app, 'env' => 'test')); 38 38 39 39 $q = new UllQuery('UllUser'); … … 46 46 47 47 $task = new UserDeactivationTask(new sfEventDispatcher(), new sfFormatter()); 48 $task-> execute(array('application' => $app, 'env' => 'test'));48 $task->deactivateUsers(array('application' => $app, 'env' => 'test')); 49 49 50 50 $q = new UllQuery('UllUser');
