Changeset 15221
- Timestamp:
- 07/05/08 23:34:20 (5 years ago)
- Location:
- events/phpframework/piece_framework/trunk
- Files:
-
- 2 modified
-
libs/Phwittr/Account.php (modified) (2 diffs)
-
specs/Phwittr/AccountSpec.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/piece_framework/trunk/libs/Phwittr/Account.php
r14663 r15221 118 118 */ 119 119 public function updatePicture($id, $file) 120 {120 { 121 121 $pathinfo = pathinfo($file); 122 122 $pathinfo['filename'] = basename($file, ".{$pathinfo['extension']}"); … … 144 144 $normalImage->save(ASIDO_OVERWRITE_ENABLED); 145 145 } 146 147 // }}} 148 // {{{ deletePicture 149 150 /** 151 * アイコンを削除する 152 * 153 * @param integer $id 154 * @return mixed 155 */ 156 public function deletePicture($id) 157 { 158 $mapper = Piece_ORM::getMapper('Users'); 159 $user = $mapper->findById($id); 160 161 $user->image = null; 162 $user->updatedAt = date('Y-m-d H:i:s'); 163 164 $mapper->update($user); 165 } 166 167 146 168 147 169 // }}} -
events/phpframework/piece_framework/trunk/specs/Phwittr/AccountSpec.php
r14837 r15221 183 183 $this->spec(file_exists($this->_sampleDirectory . '/example_normal.png')) 184 184 ->should->beTrue(); 185 } 186 187 public function itユーザ画像を個別で削除すると、フィールド値が削除される() 188 { 189 $mapper = Piece_ORM::getMapper('Users'); 190 $newUser = $mapper->findById($this->_foo->id); 191 192 $this->spec($newUser->image)->should->be('example.png'); 193 194 Phwittr_Account::deletePicture($this->_foo->id); 195 196 $mapper = Piece_ORM::getMapper('Users'); 197 $newUser = $mapper->findById($this->_foo->id); 198 199 $this->spec($newUser->image)->should->beNull(); 185 200 } 186 201
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)