Changeset 1082 for trunk/generator/test
- Timestamp:
- 09/17/08 14:11:31 (3 months ago)
- Files:
-
- trunk (modified) (1 prop)
- trunk/generator/test/classes/bookstore/BookstoreDataPopulator.php (modified) (17 diffs)
- trunk/generator/test/classes/bookstore/BookstoreTestBase.php (modified) (2 diffs)
- trunk/generator/test/classes/cms/CmsDataPopulator.php (modified) (3 diffs)
- trunk/generator/test/classes/propel/CharacterEncodingTest.php (modified) (6 diffs)
- trunk/generator/test/classes/propel/FieldnameRelatedTest.php (modified) (26 diffs)
- trunk/generator/test/classes/propel/GeneratedNestedSetObjectTest.php (modified) (11 diffs)
- trunk/generator/test/classes/propel/GeneratedNestedSetPeerTest.php (modified) (15 diffs)
- trunk/generator/test/classes/propel/GeneratedNestedSetTest.php (modified) (5 diffs)
- trunk/generator/test/classes/propel/GeneratedObjectLobTest.php (modified) (6 diffs)
- trunk/generator/test/classes/propel/GeneratedObjectRelTest.php (modified) (16 diffs)
- trunk/generator/test/classes/propel/GeneratedObjectTest.php (modified) (53 diffs)
- trunk/generator/test/classes/propel/GeneratedPeerTest.php (modified) (52 diffs)
- trunk/generator/test/classes/propel/Ticket520Test.php (modified) (11 diffs)
- trunk/generator/test/classes/propel/util/BasePeerTest.php (modified) (5 diffs)
- trunk/generator/test/classes/propel/util/PropelPDOTest.php (modified) (3 diffs)
- trunk/generator/test/classes/propel/validator/ValidatorTest.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk
- Property svn:ignore set to
.project
.cache
.settings
- Property svn:ignore set to
trunk/generator/test/classes/bookstore/BookstoreDataPopulator.php
r1068 r1082 1 1 <?php 2 use bookstore::Model as PropelModel; 3 use bookstore::Peer as PropelPeer; 4 2 5 /* 3 6 * $Id$ … … 38 41 // --------------------- 39 42 40 $scholastic = new P ublisher();43 $scholastic = new PropelModel::Publisher(); 41 44 $scholastic->setName("Scholastic"); 42 45 // do not save, will do later to test cascade 43 46 44 $morrow = new P ublisher();47 $morrow = new PropelModel::Publisher(); 45 48 $morrow->setName("William Morrow"); 46 49 $morrow->save(); 47 50 $morrow_id = $morrow->getId(); 48 51 49 $penguin = new P ublisher();52 $penguin = new PropelModel::Publisher(); 50 53 $penguin->setName("Penguin"); 51 54 $penguin->save(); 52 55 $penguin_id = $penguin->getId(); 53 56 54 $vintage = new P ublisher();57 $vintage = new PropelModel::Publisher(); 55 58 $vintage->setName("Vintage"); 56 59 $vintage->save(); 57 60 $vintage_id = $vintage->getId(); 58 61 59 $rowling = new Author();62 $rowling = new PropelModel::Author(); 60 63 $rowling->setFirstName("J.K."); 61 64 $rowling->setLastName("Rowling"); 62 65 // no save() 63 66 64 $stephenson = new Author();67 $stephenson = new PropelModel::Author(); 65 68 $stephenson->setFirstName("Neal"); 66 69 $stephenson->setLastName("Stephenson"); … … 68 71 $stephenson_id = $stephenson->getId(); 69 72 70 $byron = new Author();73 $byron = new PropelModel::Author(); 71 74 $byron->setFirstName("George"); 72 75 $byron->setLastName("Byron"); … … 74 77 $byron_id = $byron->getId(); 75 78 76 $grass = new Author();79 $grass = new PropelModel::Author(); 77 80 $grass->setFirstName("Gunter"); 78 81 $grass->setLastName("Grass"); … … 80 83 $grass_id = $grass->getId(); 81 84 82 $phoenix = new Book();85 $phoenix = new PropelModel::Book(); 83 86 $phoenix->setTitle("Harry Potter and the Order of the Phoenix"); 84 87 $phoenix->setISBN("043935806X"); … … 89 92 $phoenix_id = $phoenix->getId(); 90 93 91 $qs = new Book();94 $qs = new PropelModel::Book(); 92 95 $qs->setISBN("0380977427"); 93 96 $qs->setTitle("Quicksilver"); … … 98 101 $qs_id = $qs->getId(); 99 102 100 $dj = new Book();103 $dj = new PropelModel::Book(); 101 104 $dj->setISBN("0140422161"); 102 105 $dj->setTitle("Don Juan"); … … 107 110 $dj_id = $dj->getId(); 108 111 109 $td = new Book();112 $td = new PropelModel::Book(); 110 113 $td->setISBN("067972575X"); 111 114 $td->setTitle("The Tin Drum"); … … 116 119 $td_id = $td->getId(); 117 120 118 $r1 = new Review();121 $r1 = new PropelModel::Review(); 119 122 $r1->setBook($phoenix); 120 123 $r1->setReviewedBy("Washington Post"); … … 124 127 $r1_id = $r1->getId(); 125 128 126 $r2 = new Review();129 $r2 = new PropelModel::Review(); 127 130 $r2->setBook($phoenix); 128 131 $r2->setReviewedBy("New York Times"); … … 135 138 $clob_path = _LOB_SAMPLE_FILE_PATH . '/tin_drum.txt'; 136 139 137 $m1 = new Media();140 $m1 = new PropelModel::Media(); 138 141 $m1->setBook($td); 139 142 $m1->setCoverImage(file_get_contents($blob_path)); … … 145 148 // (this is for many-to-many tests) 146 149 147 $blc1 = new BookClubList();150 $blc1 = new PropelModel::BookClubList(); 148 151 $blc1->setGroupLeader("Crazyleggs"); 149 152 $blc1->setTheme("Happiness"); 150 153 151 $brel1 = new BookListRel();154 $brel1 = new PropelModel::BookListRel(); 152 155 $brel1->setBook($phoenix); 153 156 154 $brel2 = new BookListRel();157 $brel2 = new PropelModel::BookListRel(); 155 158 $brel2->setBook($dj); 156 159 … … 158 161 $blc1->addBookListRel($brel2); 159 162 160 $bemp1 = new BookstoreEmployee();163 $bemp1 = new PropelModel::BookstoreEmployee(); 161 164 $bemp1->setName("John"); 162 165 $bemp1->setJobTitle("Manager"); 163 166 164 $bemp2 = new BookstoreEmployee();167 $bemp2 = new PropelModel::BookstoreEmployee(); 165 168 $bemp2->setName("Pieter"); 166 169 $bemp2->setJobTitle("Clerk"); … … 168 171 $bemp2->save(); 169 172 170 $role = new AcctAccessRole();173 $role = new PropelModel::AcctAccessRole(); 171 174 $role->setName("Admin"); 172 175 173 $bempacct = new BookstoreEmployeeAccount();176 $bempacct = new PropelModel::BookstoreEmployeeAccount(); 174 177 $bempacct->setBookstoreEmployee($bemp1); 175 178 $bempacct->setAcctAccessRole($role); … … 180 183 // Add bookstores 181 184 182 $store = new Bookstore();185 $store = new PropelModel::Bookstore(); 183 186 $store->setStoreName("Amazon"); 184 187 $store->setPopulationServed(5000000000); // world population … … 186 189 $store->save(); 187 190 188 $store = new Bookstore();191 $store = new PropelModel::Bookstore(); 189 192 $store->setStoreName("Local Store"); 190 193 $store->setPopulationServed(20); … … 195 198 public static function depopulate() 196 199 { 197 AcctAccessRolePeer::doDeleteAll(); 198 AuthorPeer::doDeleteAll(); 199 BookstorePeer::doDeleteAll(); 200 BookstoreContestPeer::doDeleteAll(); 201 BookstoreContestEntryPeer::doDeleteAll(); 202 BookstoreEmployeePeer::doDeleteAll(); 203 BookstoreEmployeeAccountPeer::doDeleteAll(); 204 BookstoreSalePeer::doDeleteAll(); 205 BookClubListPeer::doDeleteAll(); 206 BookOpinionPeer::doDeleteAll(); 207 BookReaderPeer::doDeleteAll(); 208 BookListRelPeer::doDeleteAll(); 209 BookPeer::doDeleteAll(); 210 ContestPeer::doDeleteAll(); 211 CustomerPeer::doDeleteAll(); 212 MediaPeer::doDeleteAll(); 213 PublisherPeer::doDeleteAll(); 214 ReaderFavoritePeer::doDeleteAll(); 215 ReviewPeer::doDeleteAll(); 200 //@todo figure out why I had to qualify these but not the stuff above. 201 PropelPeer::AcctAccessRolePeer::doDeleteAll(); 202 PropelPeer::AuthorPeer::doDeleteAll(); 203 PropelPeer::BookstorePeer::doDeleteAll(); 204 PropelPeer::BookstoreContestPeer::doDeleteAll(); 205 PropelPeer::BookstoreContestEntryPeer::doDeleteAll(); 206 PropelPeer::BookstoreEmployeePeer::doDeleteAll(); 207 PropelPeer::BookstoreEmployeeAccountPeer::doDeleteAll(); 208 PropelPeer::BookstoreSalePeer::doDeleteAll(); 209 PropelPeer::BookClubListPeer::doDeleteAll(); 210 PropelPeer::BookOpinionPeer::doDeleteAll(); 211 PropelPeer::BookReaderPeer::doDeleteAll(); 212 PropelPeer::BookListRelPeer::doDeleteAll(); 213 PropelPeer::BookPeer::doDeleteAll(); 214 PropelPeer::ContestPeer::doDeleteAll(); 215 PropelPeer::CustomerPeer::doDeleteAll(); 216 PropelPeer::MediaPeer::doDeleteAll(); 217 PropelPeer::PublisherPeer::doDeleteAll(); 218 PropelPeer::ReaderFavoritePeer::doDeleteAll(); 219 PropelPeer::ReviewPeer::doDeleteAll(); 216 220 } 217 221 trunk/generator/test/classes/bookstore/BookstoreTestBase.php
r1024 r1082 1 1 <?php 2 use bookstore::Peer as PropelPeer; 3 2 4 /* 3 5 * $Id$ … … 46 48 BookstoreDataPopulator::depopulate(); 47 49 48 $this->assertEquals(0, count( BookPeer::doSelect(newCriteria())), "Expect book table to be empty.");49 $this->assertEquals(0, count( AuthorPeer::doSelect(newCriteria())), "Expect author table to be empty.");50 $this->assertEquals(0, count(P ublisherPeer::doSelect(newCriteria())), "Expect publisher table to be empty.");51 $this->assertEquals(0, count( ReviewPeer::doSelect(newCriteria())), "Expect review table to be empty.");52 $this->assertEquals(0, count( MediaPeer::doSelect(newCriteria())), "Expect media table to be empty.");53 $this->assertEquals(0, count( BookstoreEmployeePeer::doSelect(newCriteria())), "Expect bookstore_employee table to be empty.");54 $this->assertEquals(0, count( BookstoreEmployeeAccountPeer::doSelect(newCriteria())), "Expect bookstore_employee_account table to be empty.");55 $this->assertEquals(0, count( BookstoreSalePeer::doSelect(newCriteria())), "Expect bookstore_sale table to be empty.");50 $this->assertEquals(0, count(PropelPeer::BookPeer::doSelect(new ::Criteria())), "Expect book table to be empty."); 51 $this->assertEquals(0, count(PropelPeer::AuthorPeer::doSelect(new ::Criteria())), "Expect author table to be empty."); 52 $this->assertEquals(0, count(PropelPeer::PublisherPeer::doSelect(new ::Criteria())), "Expect publisher table to be empty."); 53 $this->assertEquals(0, count(PropelPeer::ReviewPeer::doSelect(new ::Criteria())), "Expect review table to be empty."); 54 $this->assertEquals(0, count(PropelPeer::MediaPeer::doSelect(new ::Criteria())), "Expect media table to be empty."); 55 $this->assertEquals(0, count(PropelPeer::BookstoreEmployeePeer::doSelect(new ::Criteria())), "Expect bookstore_employee table to be empty."); 56 $this->assertEquals(0, count(PropelPeer::BookstoreEmployeeAccountPeer::doSelect(new ::Criteria())), "Expect bookstore_employee_account table to be empty."); 57 $this->assertEquals(0, count(PropelPeer::BookstoreSalePeer::doSelect(new ::Criteria())), "Expect bookstore_sale table to be empty."); 56 58 57 BookPeer::clearInstancePool();58 $this->assertEquals(0, count( BookPeer::$instances), "Expected 0 Book instances after clearInstancePool()");59 PropelPeer::BookPeer::clearInstancePool(); 60 $this->assertEquals(0, count(PropelPeer::BookPeer::$instances), "Expected 0 Book instances after clearInstancePool()"); 59 61 60 AuthorPeer::clearInstancePool();61 $this->assertEquals(0, count( AuthorPeer::$instances), "Expected 0 Author instances after clearInstancePool()");62 PropelPeer::AuthorPeer::clearInstancePool(); 63 $this->assertEquals(0, count(PropelPeer::AuthorPeer::$instances), "Expected 0 Author instances after clearInstancePool()"); 62 64 63 P ublisherPeer::clearInstancePool();64 $this->assertEquals(0, count(P ublisherPeer::$instances), "Expected 0 Publisher instances after clearInstancePool()");65 PropelPeer::PublisherPeer::clearInstancePool(); 66 $this->assertEquals(0, count(PropelPeer::PublisherPeer::$instances), "Expected 0 Publisher instances after clearInstancePool()"); 65 67 66 ReviewPeer::clearInstancePool();67 $this->assertEquals(0, count( ReviewPeer::$instances), "Expected 0 Review instances after clearInstancePool()");68 PropelPeer::ReviewPeer::clearInstancePool(); 69 $this->assertEquals(0, count(PropelPeer::ReviewPeer::$instances), "Expected 0 Review instances after clearInstancePool()"); 68 70 69 MediaPeer::clearInstancePool();70 $this->assertEquals(0, count( MediaPeer::$instances), "Expected 0 Media instances after clearInstancePool()");71 PropelPeer::MediaPeer::clearInstancePool(); 72 $this->assertEquals(0, count(PropelPeer::MediaPeer::$instances), "Expected 0 Media instances after clearInstancePool()"); 71 73 72 BookstoreEmployeePeer::clearInstancePool();73 $this->assertEquals(0, count( BookstoreEmployeePeer::$instances), "Expected 0 BookstoreEmployee instances after clearInstancePool()");74 PropelPeer::BookstoreEmployeePeer::clearInstancePool(); 75 $this->assertEquals(0, count(PropelPeer::BookstoreEmployeePeer::$instances), "Expected 0 BookstoreEmployee instances after clearInstancePool()"); 74 76 75 BookstoreEmployeeAccountPeer::clearInstancePool();76 $this->assertEquals(0, count( BookstoreEmployeeAccountPeer::$instances), "Expected 0 BookstoreEmployeeAccount instances after clearInstancePool()");77 PropelPeer::BookstoreEmployeeAccountPeer::clearInstancePool(); 78 $this->assertEquals(0, count(PropelPeer::BookstoreEmployeeAccountPeer::$instances), "Expected 0 BookstoreEmployeeAccount instances after clearInstancePool()"); 77 79 78 BookstoreSalePeer::clearInstancePool();79 $this->assertEquals(0, count( BookstoreSalePeer::$instances), "Expected 0 BookstoreSale instances after clearInstancePool()");80 PropelPeer::BookstoreSalePeer::clearInstancePool(); 81 $this->assertEquals(0, count(PropelPeer::BookstoreSalePeer::$instances), "Expected 0 BookstoreSale instances after clearInstancePool()"); 80 82 81 83 parent::tearDown(); trunk/generator/test/classes/cms/CmsDataPopulator.php
r1068 r1082 1 1 <?php 2 3 use bookstore::Peer as PropelPeer; 4 2 5 /* 3 * $Id : CmsDataPopulator.php 876 2007-12-19 13:16:31Z heltem$6 * $Id$ 4 7 * 5 8 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 29 32 public static function populate() 30 33 { 31 $dbh = Propel::getConnection(PagePeer::DATABASE_NAME);34 $dbh = ::Propel::getConnection(PropelPeer::PagePeer::DATABASE_NAME); 32 35 $dbh->exec("INSERT INTO Page (ScopeId, LeftChild, RightChild, Title) VALUES (1, 1,194,'home')"); 33 36 $dbh->exec("INSERT INTO Page (ScopeId, LeftChild, RightChild, Title) VALUES (1, 2,5,'school')"); … … 131 134 public static function depopulate() 132 135 { 133 $dbh = Propel::getConnection(PagePeer::DATABASE_NAME);136 $dbh = ::Propel::getConnection(PropelPeer::PagePeer::DATABASE_NAME); 134 137 $dbh->exec("DELETE FROM Page"); 135 138 } trunk/generator/test/classes/propel/CharacterEncodingTest.php
r1068 r1082 1 1 <?php 2 3 use bookstore::Peer as PropelPeer; 4 use bookstore::Model as PropelModel; 5 2 6 /* 3 7 * $Id: GeneratedPeerTest.php 842 2007-12-02 16:28:20Z heltem $ … … 54 58 public function testUtf8() 55 59 { 56 $db = Propel::getDB(BookPeer::DATABASE_NAME);60 $db = ::Propel::getDB(PropelPeer::BookPeer::DATABASE_NAME); 57 61 58 62 $title = "СЌеÑÑÑ ÐœÐ° бÑÑЎеÑÑаÑÑ. ÐÐ»Ð°ÐŽÐµÐœÐµÑ Ðž ÑеÑÑ"; … … 60 64 // 1 2 3 61 65 62 $a = new Author();66 $a = new PropelModel::Author(); 63 67 $a->setFirstName("Ð."); 64 68 $a->setLastName("ÐÐУÐÐÐ"); 65 69 66 $p = new P ublisher();70 $p = new PropelModel::Publisher(); 67 71 $p->setName("ÐеÑекÑОв ÑПÑÑОйÑкОй, ПÑÑÑПÑÑжеÑÐœÐ°Ñ Ð¿ÑПза"); 68 72 69 $b = new Book();73 $b = new PropelModel::Book(); 70 74 $b->setTitle($title); 71 75 $b->setISBN("B-59246"); … … 83 87 public function testInvalidCharset() 84 88 { 85 $db = Propel::getDB(BookPeer::DATABASE_NAME);89 $db = ::Propel::getDB(PropelPeer::BookPeer::DATABASE_NAME); 86 90 if ($db instanceof DBSQLite) { 87 91 $this->markTestSkipped(); 88 92 } 89 93 90 $a = new Author();94 $a = new PropelModel::Author(); 91 95 $a->setFirstName("Ð."); 92 96 $a->setLastName("ÐÐУÐÐÐ"); … … 110 114 $a->save(); 111 115 $a->reload(); 112 116 print_r($a); 113 117 $this->assertEquals("",$a->getLastName(), "Expected last_name to be empty (after inserting invalid charset data)"); 114 118 } … … 117 121 118 122 } 123 124 ?> trunk/generator/test/classes/propel/FieldnameRelatedTest.php
r1024 r1082 1 1 <?php 2 3 use bookstore::Peer as PropelPeer; 4 use bookstore::Model as PropelModel; 5 2 6 /* 3 7 * $Id$ … … 28 32 * - Base[Object]Peer::getFieldNames() 29 33 * - Base[Object]Peer::translateFieldName() 30 * - BasePeer::getFieldNames()31 * - BasePeer::translateFieldName()34 * - ::BasePeer::getFieldNames() 35 * - ::BasePeer::translateFieldName() 32 36 * - Base[Object]::getByName() 33 37 * - Base[Object]::setByName() … … 48 52 public function testFieldNameTypeConstants () { 49 53 50 $result = defined(' BasePeer::TYPE_PHPNAME');54 $result = defined('::BasePeer::TYPE_PHPNAME'); 51 55 $this->assertTrue($result); 52 56 } … … 58 62 59 63 $types = array( 60 BasePeer::TYPE_PHPNAME,61 BasePeer::TYPE_COLNAME,62 BasePeer::TYPE_FIELDNAME,63 BasePeer::TYPE_NUM64 ); 65 $expecteds = array ( 66 BasePeer::TYPE_PHPNAME => array(64 ::BasePeer::TYPE_PHPNAME, 65 ::BasePeer::TYPE_COLNAME, 66 ::BasePeer::TYPE_FIELDNAME, 67 ::BasePeer::TYPE_NUM 68 ); 69 $expecteds = array ( 70 ::BasePeer::TYPE_PHPNAME => array( 67 71 0 => 'Id', 68 72 1 => 'Title', … … 72 76 5 => 'AuthorId' 73 77 ), 74 BasePeer::TYPE_STUDLYPHPNAME => array(78 ::BasePeer::TYPE_STUDLYPHPNAME => array( 75 79 0 => 'id', 76 80 1 => 'title', … … 80 84 5 => 'authorId' 81 85 ), 82 BasePeer::TYPE_COLNAME => array(86 ::BasePeer::TYPE_COLNAME => array( 83 87 0 => 'book.ID', 84 88 1 => 'book.TITLE', … … 88 92 5 => 'book.AUTHOR_ID' 89 93 ), 90 BasePeer::TYPE_FIELDNAME => array(94 ::BasePeer::TYPE_FIELDNAME => array( 91 95 0 => 'id', 92 96 1 => 'title', … … 96 100 5 => 'author_id' 97 101 ), 98 BasePeer::TYPE_NUM => array(102 ::BasePeer::TYPE_NUM => array( 99 103 0 => 0, 100 104 1 => 1, … … 107 111 108 112 foreach ($types as $type) { 109 $results[$type] = BookPeer::getFieldnames($type);113 $results[$type] = PropelPeer::BookPeer::getFieldnames($type); 110 114 $this->assertEquals( 111 115 $expecteds[$type], … … 123 127 124 128 $types = array( 125 BasePeer::TYPE_PHPNAME,126 BasePeer::TYPE_STUDLYPHPNAME,127 BasePeer::TYPE_COLNAME,128 BasePeer::TYPE_FIELDNAME,129 BasePeer::TYPE_NUM130 ); 131 $expecteds = array ( 132 BasePeer::TYPE_PHPNAME => 'AuthorId',133 BasePeer::TYPE_STUDLYPHPNAME => 'authorId',134 BasePeer::TYPE_COLNAME => 'book.AUTHOR_ID',135 BasePeer::TYPE_FIELDNAME => 'author_id',136 BasePeer::TYPE_NUM => 5,129 ::BasePeer::TYPE_PHPNAME, 130 ::BasePeer::TYPE_STUDLYPHPNAME, 131 ::BasePeer::TYPE_COLNAME, 132 ::BasePeer::TYPE_FIELDNAME, 133 ::BasePeer::TYPE_NUM 134 ); 135 $expecteds = array ( 136 ::BasePeer::TYPE_PHPNAME => 'AuthorId', 137 ::BasePeer::TYPE_STUDLYPHPNAME => 'authorId', 138 ::BasePeer::TYPE_COLNAME => 'book.AUTHOR_ID', 139 ::BasePeer::TYPE_FIELDNAME => 'author_id', 140 ::BasePeer::TYPE_NUM => 5, 137 141 ); 138 142 foreach ($types as $fromType) { … … 140 144 $name = $expecteds[$fromType]; 141 145 $expected = $expecteds[$toType]; 142 $result = BookPeer::translateFieldName($name, $fromType, $toType);146 $result = PropelPeer::BookPeer::translateFieldName($name, $fromType, $toType); 143 147 $this->assertEquals($expected, $result); 144 148 } … … 147 151 148 152 /** 149 * Tests the BasePeer::getFieldNames() method153 * Tests the ::BasePeer::getFieldNames() method 150 154 */ 151 155 public function testGetFieldNamesStatic () { 152 156 153 157 $types = array( 154 BasePeer::TYPE_PHPNAME,155 BasePeer::TYPE_STUDLYPHPNAME,156 BasePeer::TYPE_COLNAME,157 BasePeer::TYPE_FIELDNAME,158 BasePeer::TYPE_NUM159 ); 160 $expecteds = array ( 161 BasePeer::TYPE_PHPNAME => array(158 ::BasePeer::TYPE_PHPNAME, 159 ::BasePeer::TYPE_STUDLYPHPNAME, 160 ::BasePeer::TYPE_COLNAME, 161 ::BasePeer::TYPE_FIELDNAME, 162 ::BasePeer::TYPE_NUM 163 ); 164 $expecteds = array ( 165 ::BasePeer::TYPE_PHPNAME => array( 162 166 0 => 'Id', 163 167 1 => 'Title', … … 167 171 5 => 'AuthorId' 168 172 ), 169 BasePeer::TYPE_STUDLYPHPNAME => array(173 ::BasePeer::TYPE_STUDLYPHPNAME => array( 170 174 0 => 'id', 171 175 1 => 'title', … … 175 179 5 => 'authorId' 176 180 ), 177 BasePeer::TYPE_COLNAME => array(181 ::BasePeer::TYPE_COLNAME => array( 178 182 0 => 'book.ID', 179 183 1 => 'book.TITLE', … … 183 187 5 => 'book.AUTHOR_ID' 184 188 ), 185 BasePeer::TYPE_FIELDNAME => array(189 ::BasePeer::TYPE_FIELDNAME => array( 186 190 0 => 'id', 187 191 1 => 'title', … … 191 195 5 => 'author_id' 192 196 ), 193 BasePeer::TYPE_NUM => array(197 ::BasePeer::TYPE_NUM => array( 194 198 0 => 0, 195 199 1 => 1, … … 202 206 203 207 foreach ($types as $type) { 204 $results[$type] = BasePeer::getFieldnames('Book', $type);208 $results[$type] = ::BasePeer::getFieldnames('Book', $type); 205 209 $this->assertEquals( 206 210 $expecteds[$type], … … 213 217 214 218 /** 215 * Tests the BasePeer::translateFieldName() method219 * Tests the ::BasePeer::translateFieldName() method 216 220 */ 217 221 public function testTranslateFieldNameStatic () { 218 222 219 223 $types = array( 220 BasePeer::TYPE_PHPNAME,221 BasePeer::TYPE_STUDLYPHPNAME,222 BasePeer::TYPE_COLNAME,223 BasePeer::TYPE_FIELDNAME,224 BasePeer::TYPE_NUM225 ); 226 $expecteds = array ( 227 BasePeer::TYPE_PHPNAME => 'AuthorId',228 BasePeer::TYPE_STUDLYPHPNAME => 'authorId',229 BasePeer::TYPE_COLNAME => 'book.AUTHOR_ID',230 BasePeer::TYPE_FIELDNAME => 'author_id',231 BasePeer::TYPE_NUM => 5,224 ::BasePeer::TYPE_PHPNAME, 225 ::BasePeer::TYPE_STUDLYPHPNAME, 226 ::BasePeer::TYPE_COLNAME, 227 ::BasePeer::TYPE_FIELDNAME, 228 ::BasePeer::TYPE_NUM 229 ); 230 $expecteds = array ( 231 ::BasePeer::TYPE_PHPNAME => 'AuthorId', 232 ::BasePeer::TYPE_STUDLYPHPNAME => 'authorId', 233 ::BasePeer::TYPE_COLNAME => 'book.AUTHOR_ID', 234 ::BasePeer::TYPE_FIELDNAME => 'author_id', 235 ::BasePeer::TYPE_NUM => 5, 232 236 ); 233 237 foreach ($types as $fromType) { … … 235 239 $name = $expecteds[$fromType]; 236 240 $expected = $expecteds[$toType]; 237 $result = BasePeer::translateFieldName('Book', $name, $fromType, $toType);241 $result = ::BasePeer::translateFieldName('Book', $name, $fromType, $toType); 238 242 $this->assertEquals($expected, $result); 239 243 } … … 247 251 248 252 $types = array( 249 BasePeer::TYPE_PHPNAME => 'Title',250 BasePeer::TYPE_STUDLYPHPNAME => 'title',251 BasePeer::TYPE_COLNAME => 'book.TITLE',252 BasePeer::TYPE_FIELDNAME => 'title',253 BasePeer::TYPE_NUM => 1254 ); 255 256 $book = new Book();253 ::BasePeer::TYPE_PHPNAME => 'Title', 254 ::BasePeer::TYPE_STUDLYPHPNAME => 'title', 255 ::BasePeer::TYPE_COLNAME => 'book.TITLE', 256 ::BasePeer::TYPE_FIELDNAME => 'title', 257 ::BasePeer::TYPE_NUM => 1 258 ); 259 260 $book = new PropelModel::Book(); 257 261 $book->setTitle('Harry Potter and the Order of the Phoenix'); 258 262 … … 269 273 public function testSetByName() { 270 274 271 $book = new Book();272 $types = array( 273 BasePeer::TYPE_PHPNAME => 'Title',274 BasePeer::TYPE_STUDLYPHPNAME => 'title',275 BasePeer::TYPE_COLNAME => 'book.TITLE',276 BasePeer::TYPE_FIELDNAME => 'title',277 BasePeer::TYPE_NUM => 1275 $book = new PropelModel::Book(); 276 $types = array( 277 ::BasePeer::TYPE_PHPNAME => 'Title', 278 ::BasePeer::TYPE_STUDLYPHPNAME => 'title', 279 ::BasePeer::TYPE_COLNAME => 'book.TITLE', 280 ::BasePeer::TYPE_FIELDNAME => 'title', 281 ::BasePeer::TYPE_NUM => 1 278 282 ); 279 283 … … 294 298 295 299 $types = array( 296 BasePeer::TYPE_PHPNAME,297 BasePeer::TYPE_STUDLYPHPNAME,298 BasePeer::TYPE_COLNAME,299 BasePeer::TYPE_FIELDNAME,300 BasePeer::TYPE_NUM301 ); 302 $expecteds = array ( 303 BasePeer::TYPE_PHPNAME => array (300 ::BasePeer::TYPE_PHPNAME, 301 ::BasePeer::TYPE_STUDLYPHPNAME, 302 ::BasePeer::TYPE_COLNAME, 303 ::BasePeer::TYPE_FIELDNAME, 304 ::BasePeer::TYPE_NUM 305 ); 306 $expecteds = array ( 307 ::BasePeer::TYPE_PHPNAME => array ( 304 308 'Title' => 'Harry Potter and the Order of the Phoenix', 305 309 'ISBN' => '043935806X' 306 310 ), 307 BasePeer::TYPE_STUDLYPHPNAME => array (311 ::BasePeer::TYPE_STUDLYPHPNAME => array ( 308 312 'title' => 'Harry Potter and the Order of the Phoenix', 309 313 'iSBN' => '043935806X' 310 314 ), 311 BasePeer::TYPE_COLNAME => array (315 ::BasePeer::TYPE_COLNAME => array ( 312 316 'book.TITLE' => 'Harry Potter and the Order of the Phoenix', 313 317 'book.ISBN' => '043935806X' 314 318 ), 315 BasePeer::TYPE_FIELDNAME => array (319 ::BasePeer::TYPE_FIELDNAME => array ( 316 320 'title' => 'Harry Potter and the Order of the Phoenix', 317 321 'isbn' => '043935806X' 318 322 ), 319 BasePeer::TYPE_NUM => array (323 ::BasePeer::TYPE_NUM => array ( 320 324 '1' => 'Harry Potter and the Order of the Phoenix', 321 325 '2' => '043935806X' … … 323 327 ); 324 328 325 $book = new Book();329 $book = new PropelModel::Book(); 326 330 327 331 foreach ($types as $type) { … … 347 351 348 352 $types = array( 349 BasePeer::TYPE_PHPNAME,350 BasePeer::TYPE_STUDLYPHPNAME,351 BasePeer::TYPE_COLNAME,352 BasePeer::TYPE_FIELDNAME,353 BasePeer::TYPE_NUM354 ); 355 356 $book = new Book();353 ::BasePeer::TYPE_PHPNAME, 354 ::BasePeer::TYPE_STUDLYPHPNAME, 355 ::BasePeer::TYPE_COLNAME, 356 ::BasePeer::TYPE_FIELDNAME, 357 ::BasePeer::TYPE_NUM 358 ); 359 360 $book = new PropelModel::Book(); 357 361 $book->fromArray(array ( 358 362 'Title' => 'Harry Potter and the Order of the Phoenix', … … 361 365 362 366 $expecteds = array ( 363 BasePeer::TYPE_PHPNAME => array (367 ::BasePeer::TYPE_PHPNAME => array ( 364 368 'Title' => 'Harry Potter and the Order of the Phoenix', 365 369 'ISBN' => '043935806X' 366 370 ), 367 BasePeer::TYPE_STUDLYPHPNAME => array (371 ::BasePeer::TYPE_STUDLYPHPNAME => array ( 368 372 'title' => 'Harry Potter and the Order of the Phoenix', 369 373 'iSBN' => '043935806X' 370 374 ), 371 BasePeer::TYPE_COLNAME => array (375 ::BasePeer::TYPE_COLNAME => array ( 372 376 'book.TITLE' => 'Harry Potter and the Order of the Phoenix', 373 377 'book.ISBN' => '043935806X' 374 378 ), 375 BasePeer::TYPE_FIELDNAME => array (379 ::BasePeer::TYPE_FIELDNAME => array ( 376 380 'title' => 'Harry Potter and the Order of the Phoenix', 377 381 'isbn' => '043935806X' 378 382 &n
