Show
Ignore:
Timestamp:
09/17/08 14:11:31 (3 months ago)
Author:
tony
Message:

Refs #683: Added support for PHP 5.3 namespaces

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk

    • Property svn:ignore set to
      .project
      .cache
      .settings
  • trunk/generator/test/classes/bookstore/BookstoreDataPopulator.php

    r1068 r1082  
    11<?php 
     2use bookstore::Model as PropelModel; 
     3use bookstore::Peer as PropelPeer; 
     4 
    25/* 
    36 *  $Id$ 
     
    3841                // --------------------- 
    3942 
    40                 $scholastic = new Publisher(); 
     43                $scholastic = new PropelModel::Publisher(); 
    4144                $scholastic->setName("Scholastic"); 
    4245                // do not save, will do later to test cascade 
    4346 
    44                 $morrow = new Publisher(); 
     47                $morrow = new PropelModel::Publisher(); 
    4548                $morrow->setName("William Morrow"); 
    4649                $morrow->save(); 
    4750                $morrow_id = $morrow->getId(); 
    4851 
    49                 $penguin = new Publisher(); 
     52                $penguin = new PropelModel::Publisher(); 
    5053                $penguin->setName("Penguin"); 
    5154                $penguin->save(); 
    5255                $penguin_id = $penguin->getId(); 
    5356 
    54                 $vintage = new Publisher(); 
     57                $vintage = new PropelModel::Publisher(); 
    5558                $vintage->setName("Vintage"); 
    5659                $vintage->save(); 
    5760                $vintage_id = $vintage->getId(); 
    5861 
    59                 $rowling = new Author(); 
     62                $rowling = new PropelModel::Author(); 
    6063                $rowling->setFirstName("J.K."); 
    6164                $rowling->setLastName("Rowling"); 
    6265                // no save() 
    6366 
    64                 $stephenson = new Author(); 
     67                $stephenson = new PropelModel::Author(); 
    6568                $stephenson->setFirstName("Neal"); 
    6669                $stephenson->setLastName("Stephenson"); 
     
    6871                $stephenson_id = $stephenson->getId(); 
    6972 
    70                 $byron = new Author(); 
     73                $byron = new PropelModel::Author(); 
    7174                $byron->setFirstName("George"); 
    7275                $byron->setLastName("Byron"); 
     
    7477                $byron_id = $byron->getId(); 
    7578 
    76                 $grass = new Author(); 
     79                $grass = new PropelModel::Author(); 
    7780                $grass->setFirstName("Gunter"); 
    7881                $grass->setLastName("Grass"); 
     
    8083                $grass_id = $grass->getId(); 
    8184 
    82                 $phoenix = new Book(); 
     85                $phoenix = new PropelModel::Book(); 
    8386                $phoenix->setTitle("Harry Potter and the Order of the Phoenix"); 
    8487                $phoenix->setISBN("043935806X"); 
     
    8992                $phoenix_id = $phoenix->getId(); 
    9093 
    91                 $qs = new Book(); 
     94                $qs = new PropelModel::Book(); 
    9295                $qs->setISBN("0380977427"); 
    9396                $qs->setTitle("Quicksilver"); 
     
    98101                $qs_id = $qs->getId(); 
    99102 
    100                 $dj = new Book(); 
     103                $dj = new PropelModel::Book(); 
    101104                $dj->setISBN("0140422161"); 
    102105                $dj->setTitle("Don Juan"); 
     
    107110                $dj_id = $dj->getId(); 
    108111 
    109                 $td = new Book(); 
     112                $td = new PropelModel::Book(); 
    110113                $td->setISBN("067972575X"); 
    111114                $td->setTitle("The Tin Drum"); 
     
    116119                $td_id = $td->getId(); 
    117120 
    118                 $r1 = new Review(); 
     121                $r1 = new PropelModel::Review(); 
    119122                $r1->setBook($phoenix); 
    120123                $r1->setReviewedBy("Washington Post"); 
     
    124127                $r1_id = $r1->getId(); 
    125128 
    126                 $r2 = new Review(); 
     129                $r2 = new PropelModel::Review(); 
    127130                $r2->setBook($phoenix); 
    128131                $r2->setReviewedBy("New York Times"); 
     
    135138                $clob_path =  _LOB_SAMPLE_FILE_PATH . '/tin_drum.txt'; 
    136139 
    137                 $m1 = new Media(); 
     140                $m1 = new PropelModel::Media(); 
    138141                $m1->setBook($td); 
    139142                $m1->setCoverImage(file_get_contents($blob_path)); 
     
    145148                // (this is for many-to-many tests) 
    146149 
    147                 $blc1 = new BookClubList(); 
     150                $blc1 = new PropelModel::BookClubList(); 
    148151                $blc1->setGroupLeader("Crazyleggs"); 
    149152                $blc1->setTheme("Happiness"); 
    150153 
    151                 $brel1 = new BookListRel(); 
     154                $brel1 = new PropelModel::BookListRel(); 
    152155                $brel1->setBook($phoenix); 
    153156 
    154                 $brel2 = new BookListRel(); 
     157                $brel2 = new PropelModel::BookListRel(); 
    155158                $brel2->setBook($dj); 
    156159 
     
    158161                $blc1->addBookListRel($brel2); 
    159162 
    160                 $bemp1 = new BookstoreEmployee(); 
     163                $bemp1 = new PropelModel::BookstoreEmployee(); 
    161164                $bemp1->setName("John"); 
    162165                $bemp1->setJobTitle("Manager"); 
    163166 
    164                 $bemp2 = new BookstoreEmployee(); 
     167                $bemp2 = new PropelModel::BookstoreEmployee(); 
    165168                $bemp2->setName("Pieter"); 
    166169                $bemp2->setJobTitle("Clerk"); 
     
    168171                $bemp2->save(); 
    169172 
    170                 $role = new AcctAccessRole(); 
     173                $role = new PropelModel::AcctAccessRole(); 
    171174                $role->setName("Admin"); 
    172175 
    173                 $bempacct = new BookstoreEmployeeAccount(); 
     176                $bempacct = new PropelModel::BookstoreEmployeeAccount(); 
    174177                $bempacct->setBookstoreEmployee($bemp1); 
    175178                $bempacct->setAcctAccessRole($role); 
     
    180183                // Add bookstores 
    181184 
    182                 $store = new Bookstore(); 
     185                $store = new PropelModel::Bookstore(); 
    183186                $store->setStoreName("Amazon"); 
    184187                $store->setPopulationServed(5000000000); // world population 
     
    186189                $store->save(); 
    187190 
    188                 $store = new Bookstore(); 
     191                $store = new PropelModel::Bookstore(); 
    189192                $store->setStoreName("Local Store"); 
    190193                $store->setPopulationServed(20); 
     
    195198        public static function depopulate() 
    196199        { 
    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(); 
    216220        } 
    217221 
  • trunk/generator/test/classes/bookstore/BookstoreTestBase.php

    r1024 r1082  
    11<?php 
     2use bookstore::Peer as PropelPeer; 
     3 
    24/* 
    35 *  $Id$ 
     
    4648                BookstoreDataPopulator::depopulate(); 
    4749 
    48                 $this->assertEquals(0, count(BookPeer::doSelect(new Criteria())), "Expect book table to be empty."); 
    49                 $this->assertEquals(0, count(AuthorPeer::doSelect(new Criteria())), "Expect author table to be empty."); 
    50                 $this->assertEquals(0, count(PublisherPeer::doSelect(new Criteria())), "Expect publisher table to be empty."); 
    51                 $this->assertEquals(0, count(ReviewPeer::doSelect(new Criteria())), "Expect review table to be empty."); 
    52                 $this->assertEquals(0, count(MediaPeer::doSelect(new Criteria())), "Expect media table to be empty."); 
    53                 $this->assertEquals(0, count(BookstoreEmployeePeer::doSelect(new Criteria())), "Expect bookstore_employee table to be empty."); 
    54                 $this->assertEquals(0, count(BookstoreEmployeeAccountPeer::doSelect(new Criteria())), "Expect bookstore_employee_account table to be empty."); 
    55                 $this->assertEquals(0, count(BookstoreSalePeer::doSelect(new Criteria())), "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."); 
    5658 
    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()"); 
    5961 
    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()"); 
    6264 
    63                 PublisherPeer::clearInstancePool(); 
    64                 $this->assertEquals(0, count(PublisherPeer::$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()"); 
    6567 
    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()"); 
    6870 
    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()"); 
    7173 
    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()"); 
    7476 
    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()"); 
    7779 
    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()"); 
    8082 
    8183                parent::tearDown(); 
  • trunk/generator/test/classes/cms/CmsDataPopulator.php

    r1068 r1082  
    11<?php 
     2 
     3use bookstore::Peer as PropelPeer; 
     4 
    25/* 
    3  *  $Id: CmsDataPopulator.php 876 2007-12-19 13:16:31Z heltem
     6 *  $Id
    47 * 
    58 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
     
    2932        public static function populate() 
    3033        { 
    31                 $dbh = Propel::getConnection(PagePeer::DATABASE_NAME); 
     34                $dbh = ::Propel::getConnection(PropelPeer::PagePeer::DATABASE_NAME); 
    3235                $dbh->exec("INSERT INTO Page (ScopeId, LeftChild, RightChild, Title) VALUES (1, 1,194,'home')"); 
    3336                $dbh->exec("INSERT INTO Page (ScopeId, LeftChild, RightChild, Title) VALUES (1, 2,5,'school')"); 
     
    131134        public static function depopulate() 
    132135        { 
    133                 $dbh = Propel::getConnection(PagePeer::DATABASE_NAME); 
     136                $dbh = ::Propel::getConnection(PropelPeer::PagePeer::DATABASE_NAME); 
    134137                $dbh->exec("DELETE FROM Page"); 
    135138        } 
  • trunk/generator/test/classes/propel/CharacterEncodingTest.php

    r1068 r1082  
    11<?php 
     2 
     3use bookstore::Peer as PropelPeer; 
     4use bookstore::Model as PropelModel; 
     5 
    26/* 
    37 *  $Id: GeneratedPeerTest.php 842 2007-12-02 16:28:20Z heltem $ 
     
    5458        public function testUtf8() 
    5559        { 
    56                 $db = Propel::getDB(BookPeer::DATABASE_NAME); 
     60                $db = ::Propel::getDB(PropelPeer::BookPeer::DATABASE_NAME); 
    5761 
    5862                $title = "СЌерть Ма бруЎершафт. МлаЎеМец О черт"; 
     
    6064                //                 1         2         3 
    6165 
    62                 $a = new Author(); 
     66                $a = new PropelModel::Author(); 
    6367                $a->setFirstName("Б."); 
    6468                $a->setLastName("АКУНИН"); 
    6569 
    66                 $p = new Publisher(); 
     70                $p = new PropelModel::Publisher(); 
    6771                $p->setName("ДетектОв рПссОйскОй, ПстрПсюжетМая прПза"); 
    6872 
    69                 $b = new Book(); 
     73                $b = new PropelModel::Book(); 
    7074                $b->setTitle($title); 
    7175                $b->setISBN("B-59246"); 
     
    8387        public function testInvalidCharset() 
    8488        { 
    85                 $db = Propel::getDB(BookPeer::DATABASE_NAME); 
     89                $db = ::Propel::getDB(PropelPeer::BookPeer::DATABASE_NAME); 
    8690                if ($db instanceof DBSQLite) { 
    8791                        $this->markTestSkipped(); 
    8892                } 
    8993 
    90                 $a = new Author(); 
     94                $a = new PropelModel::Author(); 
    9195                $a->setFirstName("Б."); 
    9296                $a->setLastName("АКУНИН"); 
     
    110114                        $a->save(); 
    111115                        $a->reload(); 
    112  
     116                        print_r($a); 
    113117                        $this->assertEquals("",$a->getLastName(), "Expected last_name to be empty (after inserting invalid charset data)"); 
    114118                } 
     
    117121 
    118122} 
     123 
     124?> 
  • trunk/generator/test/classes/propel/FieldnameRelatedTest.php

    r1024 r1082  
    11<?php 
     2 
     3use bookstore::Peer as PropelPeer; 
     4use bookstore::Model as PropelModel; 
     5 
    26/* 
    37 *  $Id$ 
     
    2832 * - Base[Object]Peer::getFieldNames() 
    2933 * - Base[Object]Peer::translateFieldName() 
    30  * - BasePeer::getFieldNames() 
    31  * - BasePeer::translateFieldName() 
     34 * - ::BasePeer::getFieldNames() 
     35 * - ::BasePeer::translateFieldName() 
    3236 * - Base[Object]::getByName() 
    3337 * - Base[Object]::setByName() 
     
    4852        public function testFieldNameTypeConstants () { 
    4953 
    50                 $result = defined('BasePeer::TYPE_PHPNAME'); 
     54                $result = defined('::BasePeer::TYPE_PHPNAME'); 
    5155                $this->assertTrue($result); 
    5256        } 
     
    5862 
    5963                $types = array( 
    60                         BasePeer::TYPE_PHPNAME, 
    61                         BasePeer::TYPE_COLNAME, 
    62                         BasePeer::TYPE_FIELDNAME, 
    63                         BasePeer::TYPE_NUM 
    64                 ); 
    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( 
    6771                                0 => 'Id', 
    6872                                1 => 'Title', 
     
    7276                                5 => 'AuthorId' 
    7377                        ), 
    74                         BasePeer::TYPE_STUDLYPHPNAME => array( 
     78                        ::BasePeer::TYPE_STUDLYPHPNAME => array( 
    7579                                0 => 'id', 
    7680                                1 => 'title', 
     
    8084                                5 => 'authorId' 
    8185                        ), 
    82                         BasePeer::TYPE_COLNAME => array( 
     86                        ::BasePeer::TYPE_COLNAME => array( 
    8387                                0 => 'book.ID', 
    8488                                1 => 'book.TITLE', 
     
    8892                                5 => 'book.AUTHOR_ID' 
    8993                        ), 
    90                         BasePeer::TYPE_FIELDNAME => array( 
     94                        ::BasePeer::TYPE_FIELDNAME => array( 
    9195                                0 => 'id', 
    9296                                1 => 'title', 
     
    96100                                5 => 'author_id' 
    97101                        ), 
    98                         BasePeer::TYPE_NUM => array( 
     102                        ::BasePeer::TYPE_NUM => array( 
    99103                                0 => 0, 
    100104                                1 => 1, 
     
    107111 
    108112                foreach ($types as $type) { 
    109                         $results[$type] = BookPeer::getFieldnames($type); 
     113                        $results[$type] = PropelPeer::BookPeer::getFieldnames($type); 
    110114                        $this->assertEquals( 
    111115                                $expecteds[$type], 
     
    123127 
    124128                $types = array( 
    125                         BasePeer::TYPE_PHPNAME, 
    126                         BasePeer::TYPE_STUDLYPHPNAME, 
    127                         BasePeer::TYPE_COLNAME, 
    128                         BasePeer::TYPE_FIELDNAME, 
    129                         BasePeer::TYPE_NUM 
    130                 ); 
    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, 
    137141                ); 
    138142                foreach ($types as $fromType) { 
     
    140144                                $name = $expecteds[$fromType]; 
    141145                                $expected = $expecteds[$toType]; 
    142                                 $result = BookPeer::translateFieldName($name, $fromType, $toType); 
     146                                $result = PropelPeer::BookPeer::translateFieldName($name, $fromType, $toType); 
    143147                                $this->assertEquals($expected, $result); 
    144148                        } 
     
    147151 
    148152        /** 
    149          * Tests the BasePeer::getFieldNames() method 
     153         * Tests the ::BasePeer::getFieldNames() method 
    150154         */ 
    151155        public function testGetFieldNamesStatic () { 
    152156 
    153157                $types = array( 
    154                         BasePeer::TYPE_PHPNAME, 
    155                         BasePeer::TYPE_STUDLYPHPNAME, 
    156                         BasePeer::TYPE_COLNAME, 
    157                         BasePeer::TYPE_FIELDNAME, 
    158                         BasePeer::TYPE_NUM 
    159                 ); 
    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( 
    162166                                0 => 'Id', 
    163167                                1 => 'Title', 
     
    167171                                5 => 'AuthorId' 
    168172                        ), 
    169                         BasePeer::TYPE_STUDLYPHPNAME => array( 
     173                        ::BasePeer::TYPE_STUDLYPHPNAME => array( 
    170174                                0 => 'id', 
    171175                                1 => 'title', 
     
    175179                                5 => 'authorId' 
    176180                        ), 
    177                         BasePeer::TYPE_COLNAME => array( 
     181                        ::BasePeer::TYPE_COLNAME => array( 
    178182                                0 => 'book.ID', 
    179183                                1 => 'book.TITLE', 
     
    183187                                5 => 'book.AUTHOR_ID' 
    184188                        ), 
    185                         BasePeer::TYPE_FIELDNAME => array( 
     189                        ::BasePeer::TYPE_FIELDNAME => array( 
    186190                                0 => 'id', 
    187191                                1 => 'title', 
     
    191195                                5 => 'author_id' 
    192196                        ), 
    193                         BasePeer::TYPE_NUM => array( 
     197                        ::BasePeer::TYPE_NUM => array( 
    194198                                0 => 0, 
    195199                                1 => 1, 
     
    202206 
    203207                foreach ($types as $type) { 
    204                         $results[$type] = BasePeer::getFieldnames('Book', $type); 
     208                        $results[$type] = ::BasePeer::getFieldnames('Book', $type); 
    205209                        $this->assertEquals( 
    206210                                $expecteds[$type], 
     
    213217 
    214218        /** 
    215          * Tests the BasePeer::translateFieldName() method 
     219         * Tests the ::BasePeer::translateFieldName() method 
    216220         */ 
    217221        public function testTranslateFieldNameStatic () { 
    218222 
    219223                $types = array( 
    220                         BasePeer::TYPE_PHPNAME, 
    221                         BasePeer::TYPE_STUDLYPHPNAME, 
    222                         BasePeer::TYPE_COLNAME, 
    223                         BasePeer::TYPE_FIELDNAME, 
    224                         BasePeer::TYPE_NUM 
    225                 ); 
    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, 
    232236                ); 
    233237                foreach ($types as $fromType) { 
     
    235239                                $name = $expecteds[$fromType]; 
    236240                                $expected = $expecteds[$toType]; 
    237                                 $result = BasePeer::translateFieldName('Book', $name, $fromType, $toType); 
     241                                $result = ::BasePeer::translateFieldName('Book', $name, $fromType, $toType); 
    238242                                $this->assertEquals($expected, $result); 
    239243                        } 
     
    247251 
    248252                $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 => 1 
    254                 ); 
    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(); 
    257261                $book->setTitle('Harry Potter and the Order of the Phoenix'); 
    258262 
     
    269273        public function testSetByName() { 
    270274 
    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 => 1 
     275                $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 
    278282                ); 
    279283 
     
    294298 
    295299                $types = array( 
    296                         BasePeer::TYPE_PHPNAME, 
    297                         BasePeer::TYPE_STUDLYPHPNAME, 
    298                         BasePeer::TYPE_COLNAME, 
    299                         BasePeer::TYPE_FIELDNAME, 
    300                         BasePeer::TYPE_NUM 
    301                 ); 
    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 ( 
    304308                                'Title' => 'Harry Potter and the Order of the Phoenix', 
    305309                                'ISBN' => '043935806X' 
    306310                        ), 
    307                         BasePeer::TYPE_STUDLYPHPNAME => array ( 
     311                        ::BasePeer::TYPE_STUDLYPHPNAME => array ( 
    308312                                'title' => 'Harry Potter and the Order of the Phoenix', 
    309313                                'iSBN' => '043935806X' 
    310314                        ), 
    311                         BasePeer::TYPE_COLNAME => array ( 
     315                        ::BasePeer::TYPE_COLNAME => array ( 
    312316                                'book.TITLE' => 'Harry Potter and the Order of the Phoenix', 
    313317                                'book.ISBN' => '043935806X' 
    314318                        ), 
    315                         BasePeer::TYPE_FIELDNAME => array ( 
     319                        ::BasePeer::TYPE_FIELDNAME => array ( 
    316320                                'title' => 'Harry Potter and the Order of the Phoenix', 
    317321                                'isbn' => '043935806X' 
    318322                        ), 
    319                         BasePeer::TYPE_NUM => array ( 
     323                        ::BasePeer::TYPE_NUM => array ( 
    320324                                '1' => 'Harry Potter and the Order of the Phoenix', 
    321325                                '2' => '043935806X' 
     
    323327                ); 
    324328 
    325                 $book = new Book(); 
     329                $book = new PropelModel::Book(); 
    326330 
    327331                foreach ($types as $type) { 
     
    347351 
    348352                $types = array( 
    349                         BasePeer::TYPE_PHPNAME, 
    350                         BasePeer::TYPE_STUDLYPHPNAME, 
    351                         BasePeer::TYPE_COLNAME, 
    352                         BasePeer::TYPE_FIELDNAME, 
    353                         BasePeer::TYPE_NUM 
    354                 ); 
    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(); 
    357361                $book->fromArray(array ( 
    358362                        'Title' => 'Harry Potter and the Order of the Phoenix', 
     
    361365 
    362366                $expecteds = array ( 
    363                         BasePeer::TYPE_PHPNAME => array ( 
     367                        ::BasePeer::TYPE_PHPNAME => array ( 
    364368                                'Title' => 'Harry Potter and the Order of the Phoenix', 
    365369                                'ISBN' => '043935806X' 
    366370                        ), 
    367                         BasePeer::TYPE_STUDLYPHPNAME => array ( 
     371                        ::BasePeer::TYPE_STUDLYPHPNAME => array ( 
    368372                                'title' => 'Harry Potter and the Order of the Phoenix', 
    369373                                'iSBN' => '043935806X' 
    370374                        ), 
    371                         BasePeer::TYPE_COLNAME => array ( 
     375                        ::BasePeer::TYPE_COLNAME => array ( 
    372376                                'book.TITLE' => 'Harry Potter and the Order of the Phoenix', 
    373377                                'book.ISBN' => '043935806X' 
    374378                        ), 
    375                         BasePeer::TYPE_FIELDNAME => array ( 
     379                        ::BasePeer::TYPE_FIELDNAME => array ( 
    376380                                'title' => 'Harry Potter and the Order of the Phoenix', 
    377381                                'isbn' => '043935806X' 
    378382  &n