Show
Ignore:
Timestamp:
06/10/08 23:53:31 (5 years ago)
Author:
kumatch
Message:

Added the spec code for the missing key in user registration.

Location:
events/phpframework/piece_framework/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/piece_framework/trunk/libs/Phwittr/Service.php

    r13492 r13635  
    104104 
    105105        $mapper = Piece_ORM::getMapper('Users'); 
    106         return $mapper->updateToRegistrationUser($criteria); 
     106        $result = $mapper->updateToRegistrationUser($criteria); 
     107        if (!$result) { 
     108            throw new Phwittr_Service_Exception('登録キーが不正'); 
     109        } 
     110 
     111        return true; 
    107112    } 
    108113 
  • events/phpframework/piece_framework/trunk/specs/Phwittr/SignupSpec.php

    r13523 r13635  
    102102    } 
    103103 
    104     public function itユーザ名が重複しているにも関わらず仮登録処理を行うと、処理は中断され() 
     104    public function itユーザ名が重複しているにも関わらず仮登録処理を行うと、処理は中断され例外発生() 
    105105    { 
    106106        $this->_createUserRecord($this->_foo); 
     
    116116 
    117117        $this->fail(); 
     118    } 
    118119 
     120    public function it認証キーが間違えていると処理は中断され例外発生() 
     121    { 
     122        $this->_foo->flag = 0; 
     123        $this->_createUserRecord($this->_foo); 
     124 
     125        try { 
     126            Phwittr_Service::register('DummyKeyword'); 
     127        } catch (Phwittr_Service_Exception $e) { 
     128            return; 
     129        } 
     130 
     131        $this->fail(); 
    119132    } 
    120133