Changeset 15133
- Timestamp:
- 07/04/08 00:48:44 (3 months ago)
- Location:
- events/phpframework/piece_framework/trunk
- Files:
-
- 2 modified
-
libs/Phwittr/Service.php (modified) (3 diffs)
-
specs/Phwittr/Authentication/NormalSpec.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/piece_framework/trunk/libs/Phwittr/Service.php
r14842 r15133 13 13 require_once 'Phwittr/Config.php'; 14 14 require_once 'Phwittr/Service/Exception.php'; 15 require_once 'Phwittr/Self.php'; 15 16 require_once 'Piece/Right/Validator/Email.php'; 16 17 … … 164 165 * @param string $user 165 166 * @param string $password 166 * @return boolean167 * @return object 167 168 */ 168 169 public function authenticate($name, $password) … … 185 186 } 186 187 187 return $user; 188 $self = new Phwittr_Self($user->id); 189 190 return $self; 188 191 } 189 192 -
events/phpframework/piece_framework/trunk/specs/Phwittr/Authentication/NormalSpec.php
r14659 r15133 58 58 } 59 59 60 public function it認証はユーザ名とパスワードで行い、成功すると ユーザ情報が得られる()60 public function it認証はユーザ名とパスワードで行い、成功するとphwittr_selfオブジェクトが得られる() 61 61 { 62 62 63 $ user= Phwittr_Service::authenticate($this->_foo->userName,63 $self = Phwittr_Service::authenticate($this->_foo->userName, 64 64 $this->_foo->password 65 65 ); 66 66 67 $this->spec($user->userName)->should->be($this->_foo->userName); 68 $this->spec($user->email)->should->be($this->_foo->email); 67 $this->spec($self instanceof Phwittr_Self)->should->beTrue(); 68 $this->spec($self->userName)->should->be($this->_foo->userName); 69 $this->spec($self->email)->should->be($this->_foo->email); 69 70 } 70 71 71 public function it認証はメールアドレスとパスワードでも行え、成功すると ユーザ情報が得られる()72 public function it認証はメールアドレスとパスワードでも行え、成功するとphwittr_selfオブジェクトが得られる() 72 73 { 73 $ user= Phwittr_Service::authenticate($this->_foo->email,74 $self = Phwittr_Service::authenticate($this->_foo->email, 74 75 $this->_foo->password 75 76 ); 76 77 77 $this->spec($user->userName)->should->be($this->_foo->userName); 78 $this->spec($user->email)->should->be($this->_foo->email); 78 $this->spec($self instanceof Phwittr_Self)->should->beTrue(); 79 $this->spec($self->userName)->should->be($this->_foo->userName); 80 $this->spec($self->email)->should->be($this->_foo->email); 79 81 } 80 82
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)