Changeset 15303

Show
Ignore:
Timestamp:
07/06/08 23:20:45 (5 years ago)
Author:
kumatch
Message:

Added a new spec.

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

Legend:

Unmodified
Added
Removed
  • events/phpframework/piece_framework/trunk/specs/Phwittr/Self/FriendRequestToPrivateUserSpec.php

    r15235 r15303  
    230230    } 
    231231 
     232    public function itプライベートユーザがフォローしているユーザからは、フォローリクエストになる() 
     233    { 
     234        $this->_fooSelf->removeFriend($this->_bar->id); 
     235        $this->_barSelf->follow($this->_foo->id); 
     236        $this->_fooSelf->follow($this->_bar->id); 
     237 
     238        $mapper = Piece_ORM::getMapper('Followers'); 
     239        $followers = $mapper->findAllByUserId($this->_foo->id); 
     240 
     241        $this->spec(count($followers))->should->be(1); 
     242        $this->spec($followers[0]->userId)->should->be($this->_foo->id); 
     243        $this->spec($followers[0]->followId)->should->be($this->_bar->id); 
     244 
     245        $mapper = Piece_ORM::getMapper('FriendRequests'); 
     246        $friendRequests = $mapper->findAllByRequesterId($this->_foo->id); 
     247 
     248        $this->spec(count($friendRequests))->should->be(0); 
     249    } 
     250 
    232251    /**#@-*/ 
    233252 
  • events/phpframework/piece_framework/trunk/specs/Phwittr/User/ProtectedUserSpec.php

    r14775 r15303  
    5959        $this->_createUserRecord($this->_foo); 
    6060        $this->_createUserRecord($this->_bar); 
     61        $this->_baz->privateFlag = 1; 
    6162        $this->_createUserRecord($this->_baz); 
    6263 
     
    136137    } 
    137138 
     139    public function itプライベートユーザがフォローしているユーザに対してはプロテクト状態にはならず、発言リストや個別を取得することができる() 
     140    { 
     141        $this->_createFollowerRecord($this->_baz->id, $this->_foo->id); 
     142        $this->_bazForFoo = new Phwittr_User($this->_baz->userName, $this->_foo->id); 
     143 
     144        $this->spec($this->_bazForFoo->isProtected())->should->beFalse(); 
     145        $statusList = $this->_bazForFoo->listArchives(); 
     146        $status = $this->_bazForFoo->findStatus(3); 
     147 
     148        $this->spec(count($statusList))->should->be(1); 
     149        $this->spec($status->userId)->should->be($this->_baz->id); 
     150    } 
     151 
    138152    /**#@-*/ 
    139153