Changeset 12855
- Timestamp:
- Sep 8, 2009, 8:15:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/branches/fukamachi/db-convert-from-2.x/lib/task/openpneUpgradeFrom2Task.class.php
r12851 r12855 27 27 28 28 private $memoryBuf = 0; 29 private $adminPassword = null; 29 30 30 31 protected function configure() … … 1211 1212 1212 1213 /** 1213 * Tests method1214 * Tests 1214 1215 */ 1215 1216 protected function testInitialize($app = 'pc_frontend') … … 1222 1223 sfContext::createInstance($configuration); 1223 1224 } 1224 } 1225 1226 protected function testAdminUser() 1227 { 1228 $adminUser = $this->selectOne('AdminUser', 1); 1229 $this->testInitialize('pc_backend'); 1230 $user = $this->createTestUser(); 1231 1232 $password = $this->ask('Please input administrator\'s password.'); 1225 1226 $this->connectTo3(); 1227 } 1228 1229 protected function loginAdminUser($user) 1230 { 1231 $adminUser = $this->selectOne('AdminUser'); 1232 1233 if (is_null($this->adminPassword)) 1234 { 1235 $this->adminPassword = $this->ask('Please input the administrator\'s password.'); 1236 } 1233 1237 1234 1238 $params = array('admin_user' => array( 1235 'username' => $adminUser->getUsername (),1236 'password' => $ password,1239 'username' => $adminUser->getUsername, 1240 'password' => $this->adminPassword, 1237 1241 )); 1242 $this->_login($user, '/default/login', $params); 1243 } 1244 1245 // TODO: how to know the user's password? 1246 protected function loginUser($user, $mailAddress, $password) 1247 { 1248 $params = array('authMailAddress' => array( 1249 'mail_address' => $mailAddress, 1250 'password' => $password, 1251 )); 1252 $this->_login($user, '/member/login/authMode/MailAddress', $params); 1253 } 1254 1255 protected function _login($user, $path = '', $params) 1256 { 1238 1257 $user-> 1239 post( '/default/login', $params)->1258 post($path, $params)-> 1240 1259 isRedirected()-> 1241 1260 with('request')->begin()-> … … 1244 1263 end() 1245 1264 ; 1265 } 1266 1267 protected function testAdminUser() 1268 { 1269 $this->testInitialize('pc_backend'); 1270 $this->loginAdminUser($this->createTestUser()); 1271 } 1272 1273 protected function testBlacklist() 1274 { 1275 if ($blacklist = $this->selectOne('Blacklist')) 1276 { 1277 $this->testInitialize('pc_backend'); 1278 $user = $this->loginAdminUser($this->createTestUser()); 1279 1280 // TODO 1281 } 1246 1282 } 1247 1283
Note: See TracChangeset
for help on using the changeset viewer.