Changeset 14784

Show
Ignore:
Timestamp:
06/28/08 22:45:54 (5 years ago)
Author:
kumatch
Message:

Returned beforeAll().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/piece_framework/trunk/specs/Phwittr/User/BasicSpec.php

    r14781 r14784  
    1111 */ 
    1212 
    13 require_once dirname(__FILE__). '/../StatusesSpecCommon.php'; 
     13require_once dirname(__FILE__). '/../SpecCommon.php'; 
    1414require_once 'Phwittr/User.php'; 
    1515 
     
    2424 * @since      Class available since Release 0.1.0 
    2525 */ 
    26 class Describe任意のユーザ情報 extends StatusesSpecCommon 
     26class Describe任意のユーザ情報 extends SpecCommon 
    2727{ 
    2828 
     
    5454    { 
    5555        parent::beforeAll(); 
     56 
     57        $this->_createUserRecord($this->_foo); 
     58        $this->_createUserRecord($this->_bar); 
     59        $this->_createUserRecord($this->_baz); 
     60 
     61        $mapper = Piece_ORM::getMapper('Users'); 
     62        $this->_foo = $mapper->findByUserName($this->_foo->userName); 
     63        $this->_bar = $mapper->findByUserName($this->_bar->userName); 
     64        $this->_baz = $mapper->findByUserName($this->_baz->userName); 
     65 
     66        for ($i = 0; $i < 100; ++$i) { 
     67            $this->_createStatusRecord($this->_foo->id, $i + 2, 
     68                                       sprintf('foo%d', $i), $i 
     69                                       ); 
     70        } 
     71        $this->_createStatusRecord($this->_bar->id, null, 'bar1', 1000); 
     72        $this->_createStatusRecord($this->_baz->id, null, 'baz1', 1001); 
     73 
     74        $this->_createFollowerRecord($this->_foo->id, $this->_bar->id); 
     75        $this->_createFollowerRecord($this->_bar->id, $this->_foo->id); 
     76        $this->_createFollowerRecord($this->_baz->id, $this->_foo->id); 
     77 
     78        for ($i = 0; $i < 100; ++$i) { 
     79            $basename = sprintf('user%d', $i); 
     80 
     81            $mockUser = new stdClass(); 
     82            $mockUser->userName = $basename; 
     83            $mockUser->email = "{$basename}@example.com"; 
     84            $mockUser->password = sha1($basename); 
     85            $mockUser->image = "{$basename}.jpg"; 
     86            $mockUser->registrationKey = 1; 
     87            $mockId = $this->_createUserRecord($mockUser); 
     88            $this->_createFollowerRecord($this->_foo->id, $mockId); 
     89            $this->_createFollowerRecord($mockId, $this->_foo->id); 
     90        } 
    5691 
    5792        $this->_user = new Phwittr_User($this->_foo->userName);