Changeset 13492
- Timestamp:
- 06/08/08 18:10:47 (5 years ago)
- Location:
- events/phpframework/piece_framework/trunk
- Files:
-
- 2 modified
-
libs/Phwittr/Service.php (modified) (1 diff)
-
specs/Phwittr/AuthenticationSpec.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/piece_framework/trunk/libs/Phwittr/Service.php
r13490 r13492 155 155 156 156 if (!$user) { 157 return false;157 throw new Phwittr_Service_Exception('認証に失敗しました'); 158 158 } 159 159 -
events/phpframework/piece_framework/trunk/specs/Phwittr/AuthenticationSpec.php
r13490 r13492 79 79 $this->_createUserRecord($this->_foo); 80 80 81 $this->spec(Phwittr_Service::authenticate('dummy', 'dummy'))->should->beFalse(); 82 $this->spec(Phwittr_Service::authenticate('dummy@example.com', 'dummy'))->should->beFalse(); 83 $this->spec(Phwittr_Service::authenticate($this->_foo->userName, 'dummy'))->should->beFalse(); 84 $this->spec(Phwittr_Service::authenticate($this->_foo->email, 'dummy'))->should->beFalse(); 85 $this->spec(Phwittr_Service::authenticate('dummy', $this->_foo->password))->should->beFalse(); 86 $this->spec(Phwittr_Service::authenticate('dummy@example.com', $this->_foo->password))->should->beFalse(); 81 try { 82 Phwittr_Service::authenticate($this->_foo->userName, 'dummy'); 83 } catch (Phwittr_Service_Exception $e) { 84 return; 85 } 86 87 $this->fail(); 87 88 } 88 89 89 public function it仮登録状態のユーザ の認証は認められない()90 public function it仮登録状態のユーザではユーザ名とパスワードによる認証はできない() 90 91 { 91 92 $this->_foo->flag = 0; … … 93 94 $this->_foo->flag = 1; 94 95 95 $result1 = Phwittr_Service::authenticate($this->_foo->userName, 96 $this->_foo->password 97 ); 98 $result2 = Phwittr_Service::authenticate($this->_foo->email, 99 $this->_foo->password 100 ); 96 try { 97 Phwittr_Service::authenticate($this->_foo->userName, 98 $this->_foo->password 99 ); 100 } catch (Phwittr_Service_Exception $e) { 101 return; 102 } 101 103 102 $this->spec($result1)->should->beFalse(); 103 $this->spec($result2)->should->beFalse(); 104 $this->fail(); 105 } 106 107 public function it仮登録状態のユーザではメールアドレスとパスワードによる認証はできない() 108 { 109 $this->_foo->flag = 0; 110 $this->_createUserRecord($this->_foo); 111 $this->_foo->flag = 1; 112 113 try { 114 Phwittr_Service::authenticate($this->_foo->email, 115 $this->_foo->password 116 ); 117 } catch (Phwittr_Service_Exception $e) { 118 return; 119 } 120 121 $this->fail(); 104 122 } 105 123
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)