Changeset 4364 for trunk/tests_old/Record
- Timestamp:
- 05/13/08 22:20:34 (8 months ago)
- Location:
- trunk/tests_old/Record
- Files:
-
- 4 modified
-
FilterTestCase.php (modified) (2 diffs)
-
HookTestCase.php (modified) (1 diff)
-
InheritanceTestCase.php (modified) (2 diffs)
-
StateTestCase.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests_old/Record/FilterTestCase.php
r3882 r4364 85 85 } 86 86 } 87 class CompositeRecord extends Doctrine_ Record87 class CompositeRecord extends Doctrine_Entity 88 88 { 89 89 public static function initMetadata($class) … … 95 95 } 96 96 } 97 class RelatedCompositeRecord extends Doctrine_ Record97 class RelatedCompositeRecord extends Doctrine_Entity 98 98 { 99 99 public static function initMetadata($class) -
trunk/tests_old/Record/HookTestCase.php
r4002 r4364 91 91 92 92 $this->assertEqual($r->deleted, null); 93 $this->assertEqual($r->state(), Doctrine_ Record::STATE_CLEAN);93 $this->assertEqual($r->state(), Doctrine_Entity::STATE_CLEAN); 94 94 95 95 try { 96 96 $r->delete(); 97 $this->assertEqual($r->state(), Doctrine_ Record::STATE_CLEAN);97 $this->assertEqual($r->state(), Doctrine_Entity::STATE_CLEAN); 98 98 $this->assertEqual($r->deleted, true); 99 99 } catch(Doctrine_Exception $e) { -
trunk/tests_old/Record/InheritanceTestCase.php
r3882 r4364 5 5 * 6 6 * This test case demonstrates the use of inheritance involving subclasses of 7 * Doctrine_ Record. This type of inheritance is heavily used in sfDoctrine,7 * Doctrine_Entity. This type of inheritance is heavily used in sfDoctrine, 8 8 * and as new inheritance-related features get added to Doctrine it seems to 9 9 * be an area where subtle breakage can sneak in. … … 50 50 $this->assertTrue($record instanceof PluginSymfonyRecord); 51 51 $this->assertTrue($record instanceof BaseSymfonyRecord); 52 $this->assertTrue($record instanceof Doctrine_ Record);52 $this->assertTrue($record instanceof Doctrine_Entity); 53 53 54 54 // does it have the expected data? -
trunk/tests_old/Record/StateTestCase.php
r3882 r4364 91 91 $this->pass(); 92 92 } 93 $this->assertEqual($user->state(), Doctrine_ Record::STATE_TCLEAN);93 $this->assertEqual($user->state(), Doctrine_Entity::STATE_TCLEAN); 94 94 try { 95 95 $user->state('some unknown state'); 96 96 $this->fail(); 97 } catch(Doctrine_ Record_State_Exception $e) {97 } catch(Doctrine_Entity_State_Exception $e) { 98 98 $this->pass(); 99 99 } 100 $this->assertEqual($user->state(), Doctrine_ Record::STATE_TCLEAN);100 $this->assertEqual($user->state(), Doctrine_Entity::STATE_TCLEAN); 101 101 } 102 102 … … 105 105 $user = new User(); 106 106 107 $user->state(Doctrine_ Record::STATE_DIRTY);108 109 $this->assertEqual($user->state(), Doctrine_ Record::STATE_DIRTY);107 $user->state(Doctrine_Entity::STATE_DIRTY); 108 109 $this->assertEqual($user->state(), Doctrine_Entity::STATE_DIRTY); 110 110 111 111 $user->state('dirty'); 112 112 113 $this->assertEqual($user->state(), Doctrine_ Record::STATE_DIRTY);113 $this->assertEqual($user->state(), Doctrine_Entity::STATE_DIRTY); 114 114 } 115 115 … … 118 118 $user = new User(); 119 119 120 $user->state(Doctrine_ Record::STATE_CLEAN);121 122 $this->assertEqual($user->state(), Doctrine_ Record::STATE_CLEAN);120 $user->state(Doctrine_Entity::STATE_CLEAN); 121 122 $this->assertEqual($user->state(), Doctrine_Entity::STATE_CLEAN); 123 123 124 124 $user->state('clean'); 125 125 126 $this->assertEqual($user->state(), Doctrine_ Record::STATE_CLEAN);126 $this->assertEqual($user->state(), Doctrine_Entity::STATE_CLEAN); 127 127 } 128 128 … … 131 131 $user = new User(); 132 132 133 $user->state(Doctrine_ Record::STATE_TCLEAN);134 135 $this->assertEqual($user->state(), Doctrine_ Record::STATE_TCLEAN);133 $user->state(Doctrine_Entity::STATE_TCLEAN); 134 135 $this->assertEqual($user->state(), Doctrine_Entity::STATE_TCLEAN); 136 136 137 137 $user->state('tclean'); 138 138 139 $this->assertEqual($user->state(), Doctrine_ Record::STATE_TCLEAN);139 $this->assertEqual($user->state(), Doctrine_Entity::STATE_TCLEAN); 140 140 } 141 141 … … 144 144 $user = new User(); 145 145 146 $user->state(Doctrine_ Record::STATE_TDIRTY);147 148 $this->assertEqual($user->state(), Doctrine_ Record::STATE_TDIRTY);146 $user->state(Doctrine_Entity::STATE_TDIRTY); 147 148 $this->assertEqual($user->state(), Doctrine_Entity::STATE_TDIRTY); 149 149 150 150 $user->state('tdirty'); 151 151 152 $this->assertEqual($user->state(), Doctrine_ Record::STATE_TDIRTY);152 $this->assertEqual($user->state(), Doctrine_Entity::STATE_TDIRTY); 153 153 } 154 154 … … 157 157 $user = new User(); 158 158 159 $user->state(Doctrine_ Record::STATE_PROXY);160 161 $this->assertEqual($user->state(), Doctrine_ Record::STATE_PROXY);159 $user->state(Doctrine_Entity::STATE_PROXY); 160 161 $this->assertEqual($user->state(), Doctrine_Entity::STATE_PROXY); 162 162 163 163 $user->state('proxy'); 164 164 165 $this->assertEqual($user->state(), Doctrine_ Record::STATE_PROXY);165 $this->assertEqual($user->state(), Doctrine_Entity::STATE_PROXY); 166 166 } 167 167 … … 177 177 $user = $this->connection->queryOne("SELECT u.name FROM User u WHERE u.name = 'someuser'"); 178 178 179 $this->assertEqual($user->state(), Doctrine_ Record::STATE_PROXY);179 $this->assertEqual($user->state(), Doctrine_Entity::STATE_PROXY); 180 180 181 181 $user2 = $this->connection->queryOne("FROM User u WHERE u.name = 'someuser'"); … … 209 209 // to make sure it is saved correctly 210 210 $user1 = $this->connection->queryOne("FROM User u WHERE u.name = '" . UNAME . "'"); 211 $this->assertEqual($user1->state(), Doctrine_ Record::STATE_CLEAN);211 $this->assertEqual($user1->state(), Doctrine_Entity::STATE_CLEAN); 212 212 $this->assertEqual($user1->name,UNAME) ; 213 213 $this->assertEqual($user1->password,UPWD1) ; … … 223 223 224 224 // the object should be in state proxy with only 'name' fetched ... 225 $this->assertEqual($user2->state(), Doctrine_ Record::STATE_PROXY);225 $this->assertEqual($user2->state(), Doctrine_Entity::STATE_PROXY); 226 226 $this->assertEqual($user2->name,UNAME) ; 227 227 $this->assertEqual($user2->password,null) ; … … 232 232 233 233 // now it should be dirty (but may be PDIRTY ... ?) 234 $this->assertEqual($user2->state(),Doctrine_ Record::STATE_DIRTY) ;234 $this->assertEqual($user2->state(),Doctrine_Entity::STATE_DIRTY) ; 235 235 $this->assertEqual($user2->name,UNAME) ; 236 236 $this->assertEqual($user2->password,UPWD2) ; … … 241 241 242 242 // the logic would suggest the object to go back to PROXY mode (becausse $user2->loginname is null aka not sync with DB) 243 $boolState = ($user2->loginname == null) && ($user2->state() === Doctrine_ Record::STATE_PROXY) ;243 $boolState = ($user2->loginname == null) && ($user2->state() === Doctrine_Entity::STATE_PROXY) ; 244 244 // this one will currently fail 245 245 $this->assertTrue($boolState) ; 246 246 // this will also currently fail (becausse it currently goes back to STATE_CLEAN, which shouldnt be the case) 247 //$this->assertEqual($user2->state(), Doctrine_ Record::STATE_PROXY);247 //$this->assertEqual($user2->state(), Doctrine_Entity::STATE_PROXY); 248 248 $this->assertEqual($user2->name,UNAME) ; 249 249 $this->assertEqual($user2->password,UPWD2) ;