Changeset 4029

Show
Ignore:
Timestamp:
03/19/08 01:29:12 (16 months ago)
Author:
jwage
Message:

Updated tests. Cleaned up some stuff. Uncommented tests and added failing test cases to fix.

Location:
branches/0.10/tests
Files:
4 removed
12 modified
2 moved

Legend:

Unmodified
Added
Removed
  • branches/0.10/tests/BatchIteratorTestCase.php

    r3884 r4029  
    3333class Doctrine_BatchIterator_TestCase extends Doctrine_UnitTestCase { 
    3434    public function prepareTables() { 
    35         $this->tables = array("Entity", "User", "Group", "Address", "Email", "Phonenumber"); 
     35        $this->tables = array("EntityAddress", "Entity", "User", "Group", "Address", "Email", "Phonenumber"); 
    3636        parent::prepareTables(); 
    3737    } 
     
    6969        $user->save(); 
    7070         
    71         $user = $user->getTable()->find($user->obtainIdentifier()); 
     71        $user = $user->getTable()->find($user->id); 
    7272        $this->assertEqual($user->name, "tester"); 
    7373        $this->assertEqual($user->Address[0]->address, "street 1"); 
    7474        $this->assertEqual($user->Address[1]->address, "street 2"); 
    7575         
    76         $user = $user->getTable()->find($user->obtainIdentifier()); 
     76        $user = $user->getTable()->find($user->id); 
    7777        $a = array(); 
    7878        foreach($user->Address as $address) { 
     
    8484        $user = $graph->query("FROM User"); 
    8585    } 
    86  
    8786} 
  • branches/0.10/tests/Cache/QuerySqliteTestCase.php

    r2359 r4029  
    11<?php 
    2 require_once("UnitTestCase.php"); 
    3  
    42class Doctrine_Cache_Query_SqliteTestCase extends Doctrine_UnitTestCase { 
    53    public function setUp() { 
  • branches/0.10/tests/CollectionTestCase.php

    r3884 r4029  
    3333class Doctrine_Collection_TestCase extends Doctrine_UnitTestCase  
    3434{ 
    35     /** 
    3635    public function testLoadRelatedForAssociation()  
    3736    { 
     
    7069        $this->assertEqual($coll->count(), 8); 
    7170 
    72         $count = $this->dbh->count(); 
     71        $count = $this->connection->count(); 
    7372 
    7473        $coll->loadRelated('Group'); 
    75         $this->assertEqual(($count + 1), $this->dbh->count()); 
     74        $this->assertEqual(($count + 1), $this->connection->count()); 
    7675        $this->assertEqual($coll[0]->Group->count(), 2); 
    77         $this->assertEqual(($count + 1), $this->dbh->count()); 
     76        $this->assertEqual(($count + 1), $this->connection->count()); 
    7877        $this->assertEqual($coll[1]->Group->count(), 1); 
    7978 
    80         $this->assertEqual(($count + 1), $this->dbh->count()); 
     79        $this->assertEqual(($count + 1), $this->connection->count()); 
    8180 
    8281        $this->assertEqual($coll[2]->Group->count(), 3); 
    8382 
    84         $this->assertEqual(($count + 1), $this->dbh->count()); 
     83        $this->assertEqual(($count + 1), $this->connection->count()); 
    8584        $this->assertEqual($coll[5]->Group->count(), 3); 
    8685 
    87         $this->assertEqual(($count + 1), $this->dbh->count()); 
     86        $this->assertEqual(($count + 1), $this->connection->count()); 
    8887 
    8988        $this->connection->clear(); 
     
    117116        $resources = $this->connection->query('FROM Resource'); 
    118117 
    119         $count = $this->dbh->count(); 
     118        $count = $this->connection->count(); 
    120119        $resources->loadRelated('Type'); 
    121120 
    122         $this->assertEqual(($count + 1), $this->dbh->count()); 
     121        $this->assertEqual(($count + 1), $this->connection->count()); 
    123122        $this->assertEqual($resources[0]->name, 'resource 1'); 
    124123        $this->assertEqual($resource[0]->Type[0]->type, 'type 1'); 
    125124        $this->assertEqual($resource[0]->Type[1]->type, 'type 2'); 
    126         $this->assertEqual(($count + 1), $this->dbh->count()); 
     125        $this->assertEqual(($count + 1), $this->connection->count()); 
    127126 
    128127        $this->assertEqual($resource[1]->name, 'resource 2'); 
    129128        $this->assertEqual($resource[1]->Type[0]->type, 'type 3'); 
    130129        $this->assertEqual($resource[1]->Type[1]->type, 'type 4'); 
    131         $this->assertEqual(($count + 1), $this->dbh->count()); 
    132     } 
    133          */ 
     130        $this->assertEqual(($count + 1), $this->connection->count()); 
     131    } 
     132     
    134133    public function testAdd()  
    135134    { 
     
    148147    } 
    149148 
    150  
    151149    public function testLoadRelated()  
    152150    { 
    153         $coll = $this->connection->query('FROM User(id)'); 
     151        $coll = $this->connection->query('FROM User u'); 
    154152 
    155153        $q = $coll->loadRelated(); 
     
    157155        $this->assertTrue($q instanceof Doctrine_Query); 
    158156         
    159         $q->addFrom('User.Group'); 
     157        $q->addFrom('User.Group g'); 
    160158 
    161159        $coll2 = $q->execute($coll->getPrimaryKeys()); 
    162160        $this->assertEqual($coll2->count(), $coll->count()); 
    163161 
    164         $count = $this->dbh->count(); 
     162        $count = $this->connection->count(); 
    165163        $coll[0]->Group[0]; 
    166         $this->assertEqual($count, $this->dbh->count()); 
     164        $this->assertEqual($count, $this->connection->count()); 
    167165    } 
    168166    public function testLoadRelatedForLocalKeyRelation()  
     
    172170        $this->assertEqual($coll->count(), 8); 
    173171         
    174         $count = $this->dbh->count(); 
     172        $count = $this->connection->count(); 
    175173        $coll->loadRelated('Email'); 
    176174 
    177         $this->assertEqual(($count + 1), $this->dbh->count()); 
     175        $this->assertEqual(($count + 1), $this->connection->count()); 
    178176 
    179177        $this->assertEqual($coll[0]->Email->address, 'zYne@example.com'); 
    180178 
    181         $this->assertEqual(($count + 1), $this->dbh->count()); 
     179        $this->assertEqual(($count + 1), $this->connection->count()); 
    182180 
    183181        $this->assertEqual($coll[2]->Email->address, 'caine@example.com'); 
     
    187185        $this->assertEqual($coll[4]->Email->address, 'stallone@example.com'); 
    188186 
    189         $this->assertEqual(($count + 1), $this->dbh->count()); 
     187        $this->assertEqual(($count + 1), $this->connection->count()); 
    190188 
    191189        $this->connection->clear(); 
     
    196194        $this->assertEqual($coll->count(), 8); 
    197195         
    198         $count = $this->dbh->count(); 
     196        $count = $this->connection->count(); 
    199197        $coll->loadRelated("Phonenumber"); 
    200198 
    201         $this->assertEqual(($count + 1), $this->dbh->count()); 
     199        $this->assertEqual(($count + 1), $this->connection->count()); 
    202200 
    203201        $this->assertEqual($coll[0]->Phonenumber[0]->phonenumber, "123 123"); 
    204202 
    205         $this->assertEqual(($count + 1), $this->dbh->count()); 
     203        $this->assertEqual(($count + 1), $this->connection->count()); 
    206204 
    207205        $coll[0]->Phonenumber[1]->phonenumber; 
    208206 
    209         $this->assertEqual(($count + 1), $this->dbh->count()); 
     207        $this->assertEqual(($count + 1), $this->connection->count()); 
    210208 
    211209        $this->assertEqual($coll[4]->Phonenumber[0]->phonenumber, "111 555 333"); 
     
    220218        $this->assertEqual($coll[6]["Phonenumber"][2]->phonenumber, "123 456"); 
    221219         
    222         $this->assertEqual(($count + 1), $this->dbh->count()); 
     220        $this->assertEqual(($count + 1), $this->connection->count()); 
    223221         
    224222        $this->connection->clear(); 
     
    233231    public function testExpand()  
    234232    { 
    235         $users = $this->connection->query("FROM User.Phonenumber WHERE User.Phonenumber.phonenumber LIKE '%123%'"); 
    236  
    237         $this->assertTrue($users instanceof Doctrine_Collection_Batch); 
     233        $users = $this->connection->query("FROM User.Phonenumber WHERE User.Phonenumber.phonenumber"); 
     234         
     235        $this->assertTrue($users instanceof Doctrine_Collection); 
    238236        $this->assertTrue($users[1] instanceof User); 
    239         $this->assertTrue($users[1]->Phonenumber instanceof Doctrine_Collection_Lazy); 
     237        $this->assertTrue($users[1]->Phonenumber instanceof Doctrine_Collection); 
    240238        $data = $users[1]->Phonenumber->getData(); 
    241239         
    242240        $coll = $users[1]->Phonenumber; 
    243241 
    244         $this->assertEqual(count($data), 1); 
     242        $this->assertEqual(count($data), 3); 
    245243 
    246244        foreach($coll as $record) { 
     
    253251 
    254252        $this->assertEqual($coll[2]->state(), Doctrine_Record::STATE_PROXY); 
    255  
    256  
    257253 
    258254        $coll->setKeyColumn('id'); 
  • branches/0.10/tests/ConfigurableTestCase.php

    r2388 r4029  
    11<?php 
    2 require_once("UnitTestCase.php"); 
    3  
    42class Doctrine_Configurable_TestCase extends Doctrine_UnitTestCase { 
    53    public function prepareTables() { } 
     
    1513    } 
    1614    public function testSetIndexNameFormatAttribute() { 
     15        $original = $this->manager->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT); 
    1716        $this->manager->setAttribute(Doctrine::ATTR_IDXNAME_FORMAT, '%_index'); 
    1817 
    1918        $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT), '%_index'); 
     19        $this->manager->setAttribute(Doctrine::ATTR_IDXNAME_FORMAT, $original); 
    2020    } 
    2121    public function testSetSequenceNameFormatAttribute() { 
     22        $original = $this->manager->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT); 
    2223        $this->manager->setAttribute(Doctrine::ATTR_SEQNAME_FORMAT, '%_sequence'); 
    2324 
    2425        $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT), '%_sequence'); 
     26        $this->manager->setAttribute(Doctrine::ATTR_SEQNAME_FORMAT, $original); 
    2527    } 
    2628    public function testExceptionIsThrownWhenSettingIndexNameFormatAttributeAtTableLevel() { 
     
    4143    } 
    4244    public function testSettingFieldCaseIsSuccesfulWithZero() { 
     45        $original = $this->connection->getAttribute(Doctrine::ATTR_FIELD_CASE); 
    4346        try { 
    4447            $this->connection->setAttribute(Doctrine::ATTR_FIELD_CASE, 0); 
     
    4750            $this->fail(); 
    4851        } 
     52        $this->connection->setAttribute(Doctrine::ATTR_FIELD_CASE, $original); 
    4953    } 
    5054    public function testSettingFieldCaseIsSuccesfulWithCaseConstants() { 
     55        $original = $this->connection->getAttribute(Doctrine::ATTR_FIELD_CASE); 
    5156        try { 
    5257            $this->connection->setAttribute(Doctrine::ATTR_FIELD_CASE, CASE_LOWER); 
     
    5560            $this->fail(); 
    5661        } 
     62        $this->connection->setAttribute(Doctrine::ATTR_FIELD_CASE, $original); 
    5763    } 
    5864    public function testSettingFieldCaseIsSuccesfulWithCaseConstants2() { 
     65        $original = $this->connection->getAttribute(Doctrine::ATTR_FIELD_CASE); 
    5966        try { 
    6067            $this->connection->setAttribute(Doctrine::ATTR_FIELD_CASE, CASE_UPPER); 
     
    6370            $this->fail(); 
    6471        } 
     72        $this->connection->setAttribute(Doctrine::ATTR_FIELD_CASE, $original); 
    6573    } 
    6674    public function testExceptionIsThrownWhenSettingFieldCaseToNotZeroOneOrTwo() { 
     
    8795 
    8896        $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER), true); 
    89                 $this->manager->setAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER, false); 
     97        $this->manager->setAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER, false); 
    9098    } 
    9199    public function testDefaultSequenceColumnNameAttributeValueIsId() { 
     
    93101    } 
    94102    public function testSequenceColumnNameAttributeAcceptsStrings() { 
     103        $original = $this->manager->getAttribute(Doctrine::ATTR_SEQCOL_NAME); 
    95104        $this->manager->setAttribute(Doctrine::ATTR_SEQCOL_NAME, 'sequence'); 
    96105 
    97106        $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_SEQCOL_NAME), 'sequence'); 
     107        $this->manager->setAttribute(Doctrine::ATTR_SEQCOL_NAME, $original); 
    98108    } 
    99109    public function testValidatorAttributeAcceptsBooleans() { 
    100         $this->manager->setAttribute(Doctrine::ATTR_VLD, true); 
     110        $this->manager->setAttribute(Doctrine::ATTR_VALIDATE, true); 
    101111         
    102         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_VLD), true); 
    103     } 
    104     public function testAutoLengthValidationAttributeAcceptsBooleans() { 
    105         $this->manager->setAttribute(Doctrine::ATTR_AUTO_LENGTH_VLD, true); 
    106          
    107         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_AUTO_LENGTH_VLD), true); 
    108     } 
    109     public function testAutoTypeValidationAttributeAcceptsBooleans() { 
    110         $this->manager->setAttribute(Doctrine::ATTR_AUTO_TYPE_VLD, true); 
    111          
    112         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_AUTO_TYPE_VLD), true); 
     112        $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_VALIDATE), true); 
     113        $this->manager->setAttribute(Doctrine::ATTR_VALIDATE, false); 
    113114    } 
    114115    public function testDefaultPortabilityAttributeValueIsAll() { 
     
    120121        $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_PORTABILITY),  
    121122                           Doctrine::PORTABILITY_RTRIM | Doctrine::PORTABILITY_FIX_CASE); 
     123        $this->manager->setAttribute(Doctrine::ATTR_PORTABILITY, Doctrine::PORTABILITY_ALL); 
    122124    } 
    123125    public function testDefaultListenerIsDoctrineEventListener() { 
     
    125127    } 
    126128    public function testListenerAttributeAcceptsEventListenerObjects() { 
    127         $this->manager->setAttribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_Debugger()); 
     129        $original = $this->manager->getAttribute(Doctrine::ATTR_LISTENER); 
     130        $this->manager->setAttribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener()); 
    128131 
    129         $this->assertTrue($this->manager->getAttribute(Doctrine::ATTR_LISTENER) instanceof Doctrine_EventListener_Debugger); 
     132        $this->assertTrue($this->manager->getAttribute(Doctrine::ATTR_LISTENER) instanceof Doctrine_EventListener); 
     133        $this->manager->setAttribute(Doctrine::ATTR_LISTENER, $original); 
    130134    } 
    131135    public function testCollectionKeyAttributeAcceptsValidColumnName() { 
     136        $original = $this->connection->getTable('User')->getAttribute(Doctrine::ATTR_COLL_KEY); 
    132137        try { 
    133138            $this->connection->getTable('User')->setAttribute(Doctrine::ATTR_COLL_KEY, 'name'); 
     
    137142            $this->fail(); 
    138143        } 
     144        $this->connection->getTable('User')->setAttribute(Doctrine::ATTR_COLL_KEY, $original); 
    139145    } 
    140146    public function testSettingInvalidColumnNameToCollectionKeyAttributeThrowsException() { 
     
    156162        } 
    157163    } 
    158     public function testSetAttribute() { 
    159         $table = $this->connection->getTable("User"); 
    160         /** 
    161         $this->manager->setAttribute(Doctrine::ATTR_CACHE_TTL,100); 
    162         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_CACHE_TTL),100); 
    163  
    164         $this->manager->setAttribute(Doctrine::ATTR_CACHE_SIZE,1); 
    165         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_CACHE_SIZE),1); 
    166  
    167         $this->manager->setAttribute(Doctrine::ATTR_CACHE_DIR,"%ROOT%".DIRECTORY_SEPARATOR."cache"); 
    168         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_CACHE_DIR),$this->manager->getRoot().DIRECTORY_SEPARATOR."cache"); 
    169         */ 
    170         $this->manager->setAttribute(Doctrine::ATTR_FETCHMODE,Doctrine::FETCH_LAZY); 
    171         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_FETCHMODE),Doctrine::FETCH_LAZY); 
    172  
    173         $this->manager->setAttribute(Doctrine::ATTR_BATCH_SIZE, 5); 
    174         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_BATCH_SIZE),5); 
    175  
    176         $this->manager->setAttribute(Doctrine::ATTR_LOCKMODE, Doctrine::LOCK_PESSIMISTIC); 
    177         $this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_LOCKMODE), Doctrine::LOCK_PESSIMISTIC); 
    178  
    179         // test invalid arguments 
    180         /** 
    181         try { 
    182             $this->manager->setAttribute(Doctrine::ATTR_CACHE_TTL,-12); 
    183         } catch(Exception $e) { 
    184             $this->assertTrue($e instanceof Exception); 
    185         } 
    186         try { 
    187             $this->manager->setAttribute(Doctrine::ATTR_CACHE_SIZE,-12); 
    188         } catch(Exception $e) { 
    189             $this->assertTrue($e instanceof Exception); 
    190         } 
    191         try { 
    192             $this->manager->setAttribute(Doctrine::ATTR_BATCH_SIZE,-12); 
    193         } catch(Exception $e) { 
    194             $this->assertTrue($e instanceof Exception); 
    195         } 
    196         */ 
    197         try { 
    198             $this->connection->beginTransaction(); 
    199             $this->manager->setAttribute(Doctrine::ATTR_LOCKMODE, Doctrine::LOCK_OPTIMISTIC); 
    200         } catch(Exception $e) { 
    201             $this->assertTrue($e instanceof Exception); 
    202             $this->connection->commit(); 
    203         } 
    204  
    205         try { 
    206             $this->connection->beginTransaction(); 
    207             $this->connection->setAttribute(Doctrine::ATTR_LOCKMODE, Doctrine::LOCK_PESSIMISTIC); 
    208         } catch(Exception $e) { 
    209             $this->assertTrue($e instanceof Exception); 
    210             $this->connection->commit(); 
    211         } 
    212  
    213     } 
    214164    public function testGetAttributes() { 
    215165        $this->assertTrue(is_array($this->manager->getAttributes())); 
  • branches/0.10/tests/ImportTestCase.php

    r3884 r4029  
    4646        $this->conn = Doctrine_Manager::connection($this->dbh); 
    4747 
    48         $this->conn->import->import('Import/_files'); 
     48        $this->conn->import->importSchema('Import/_files'); 
    4949         
    5050        $this->assertTrue(file_exists('Import/_files/ImportTestUser.php')); 
     51        $this->assertTrue(file_exists('Import/_files/generated/BaseImportTestUser.php')); 
    5152    } 
    5253} 
  • branches/0.10/tests/PessimisticLockingTestCase.php

    r3884 r4029  
    4747        $entry1->topic  = 'I love donuts!'; 
    4848        $entry1->save(); 
     49    } 
     50     
     51    public function prepareTables() 
     52    { 
     53        $this->tables = array('Forum_Entry', 'Entity', 'Phonenumber', 'Email', 'Groupuser'); 
     54        parent::prepareTables(); 
    4955    } 
    5056 
  • branches/0.10/tests/PluginTestCase.php

    r4010 r4029  
    9898    public function setUp() 
    9999    { 
    100           $options = array('fields' => array('title', 'content')); 
     100        $options = array('fields' => array('title', 'content')); 
    101101        $auditLog = new Doctrine_Template_Versionable($options); 
    102102        $search = new Doctrine_Template_Searchable($options); 
    103           $slug = new Doctrine_Template_Sluggable($options); 
     103        $slug = new Doctrine_Template_Sluggable($options); 
    104104        $i18n = new Doctrine_Template_I18n($options); 
    105  
    106105 
    107106        $i18n->addChild($auditLog) 
  • branches/0.10/tests/Record/CascadingDeleteTestCase.php

    r3884 r4029  
    3131 * @version     $Revision$ 
    3232 */ 
    33 class Doctrine_CascadingDelete_TestCase extends Doctrine_UnitTestCase  
     33class Doctrine_Record_CascadingDelete_TestCase extends Doctrine_UnitTestCase  
    3434{ 
    3535    public function prepareData() 
    3636    { } 
    3737    public function prepareTables() 
    38     { } 
     38    { 
     39      $this->tables = array('ForeignKeyTest'); 
     40      parent::prepareTables(); 
     41    } 
    3942    public function testCascadingDeleteEmulation() 
    4043    { 
  • branches/0.10/tests/Record/SaveBlankRecordTestCase.php

    r3884 r4029  
    4545    public function testSaveBlankRecord() 
    4646    { 
    47         $user = new User(); 
     47        $user = new MyUser(); 
    4848        $user->state('TDIRTY'); 
    4949        $user->save(); 
    5050         
    51         $this->assertTrue(isset($user['id'])); 
     51        $this->assertTrue(isset($user['id']) && $user['id']); 
    5252    } 
    5353     
    5454    public function testSaveBlankRecord2() 
    5555    { 
    56         $myUserGroup = new MyUserGroup(); 
    57         $myUserGroup->state('TDIRTY'); 
    58         $myUserGroup->save(); 
     56        $group = new MyUserGroup(); 
     57        $group->state('TDIRTY'); 
     58        $group->save(); 
    5959         
    60         $this->assertTrue(isset($user['id'])); 
     60        $this->assertTrue(isset($group['id']) && $group['id']); 
    6161    } 
    6262} 
  • branches/0.10/tests/Relation/AccessTestCase.php

    r2388 r4029  
    7171 
    7272    public function prepareTables() { 
    73         $this->tables += array("MyUser", 
     73        $this->tables = array("Data_File", "File_Owner","MyUser", 
    7474            "MyOneThing", 
    7575            "MyUserOneThing", 
     
    161161        } 
    162162 
    163         $query = "FROM MyUser, 
    164             MyUser.MyOneThing, 
    165             MyUser.MyOneThing.MyUserOneThing, 
    166             MyUser.MyOtherThing, 
    167             MyUser.MyOtherThing.MyUserOtherThing"; 
     163        $query = "FROM MyUser a1, 
     164            a1.MyOneThing a2, 
     165            a2.MyUserOneThing a3, 
     166            a1.MyOtherThing a4, 
     167            a4.MyUserOtherThing a5"; 
    168168        $users = $this->connection->query($query); 
    169169        foreach($users as $u) { 
     
    187187        } 
    188188 
    189         $query = "FROM MyUser, 
    190             MyUser.MyOtherThing, 
    191             MyUser.MyOtherThing.MyUserOtherThing, 
    192             MyUser.MyOneThing, 
    193             MyUser.MyOneThing.MyUserOneThing"; 
     189        $query = "FROM MyUser a1, 
     190            a1.MyOtherThing a2, 
     191            a2.MyUserOtherThing a3, 
     192            a1.MyOneThing a4, 
     193            a4.MyUserOneThing a5"; 
    194194        $users = $this->connection->query($query); 
    195195        foreach($users as $u) { 
  • branches/0.10/tests/Relation/ManyToManyTestCase.php

    r2359 r4029  
    44    public function prepareData() { } 
    55    public function prepareTables() { 
     6        $this->tables = array('JC1', 'JC2', 'JC3', 'RTC1', 'RTC2', 'M2MTest', 'M2MTest2'); 
    67        parent::prepareTables(); 
    78    } 
     
    3334        try { 
    3435            $rel = $component->getTable()->getRelation('M2MTest2'); 
    35             $this->pass(); 
    36         } catch(Doctrine_Exception $e) { 
    37             $this->fail(); 
    38         } 
    39         $this->assertEqual($rel->getForeign(), 'oid'); 
    40         try { 
    41             $rel = $component->getTable()->getRelation('RTC4'); 
    4236            $this->pass(); 
    4337        } catch(Doctrine_Exception $e) { 
     
    125119        $component->name = '2'; 
    126120         
    127         $count = $this->dbh->count(); 
    128  
    129         $component->save(); 
    130  
    131         $this->assertEqual($this->dbh->count(), ($count + 5)); 
     121        $count = $this->connection->count(); 
     122 
     123        $component->save(); 
     124 
     125        $this->assertEqual($this->connection->count(), ($count + 5)); 
    132126         
    133127        $this->assertEqual($component->RTC1->count(), 2); 
     
    142136        $component->RTC2[1]->name = '2'; 
    143137 
    144         $count = $this->dbh->count(); 
    145  
    146         $component->save(); 
    147  
    148         $this->assertEqual($this->dbh->count(), ($count + 4)); 
     138        $count = $this->connection->count(); 
     139 
     140        $component->save(); 
     141 
     142        $this->assertEqual($this->connection->count(), ($count + 4)); 
    149143 
    150144        $this->assertEqual($component->RTC2->count(), 2); 
     
    163157        $component->name = '2'; 
    164158         
    165         $count = $this->dbh->count(); 
    166  
    167         $component->save(); 
    168  
    169         $this->assertEqual($this->dbh->count(), ($count + 5)); 
     159        $count = $this->connection->count(); 
     160 
     161        $component->save(); 
     162 
     163        $this->assertEqual($this->connection->count(), ($count + 5)); 
    170164         
    171165        $this->assertEqual($component->RTC2->count(), 2); 
     
    180174        $component->RTC1[1]->name = '2'; 
    181175 
    182         $count = $this->dbh->count(); 
    183  
    184         $component->save(); 
    185  
    186         $this->assertEqual($this->dbh->count(), ($count + 4)); 
     176        $count = $this->connection->count(); 
     177 
     178        $component->save(); 
     179 
     180        $this->assertEqual($this->connection->count(), ($count + 3)); 
    187181         
    188182        $this->assertEqual($component->RTC1->count(), 2); 
  • branches/0.10/tests/run.php

    r4006 r4029  
    22error_reporting(E_ALL | E_STRICT); 
    33ini_set('max_execution_time', 900); 
    4 ini_set("date.timezone", "GMT+0"); 
     4ini_set('date.timezone', 'GMT+0'); 
    55 
    66require_once(dirname(__FILE__) . '/DoctrineTest.php'); 
     
    1010 
    1111$test = new DoctrineTest(); 
    12 //TICKET test cases 
    13 $tickets = new GroupTest('Tickets tests', 'tickets'); 
     12 
     13// Ticket Tests 
     14// If you write a ticket testcase add it to the bottom of the list, with the ticket number in it 
     15$tickets = new GroupTest('Tickets Tests', 'tickets'); 
    1416$tickets->addTestCase(new Doctrine_Ticket_Njero_TestCase()); 
     17$tickets->addTestCase(new Doctrine_Ticket_381_TestCase()); 
     18$tickets->addTestCase(new Doctrine_Ticket_424B_TestCase()); 
     19$tickets->addTestCase(new Doctrine_Ticket_424C_TestCase()); 
    1520$tickets->addTestCase(new Doctrine_Ticket_428_TestCase()); 
     21$tickets->addTestCase(new Doctrine_Ticket_438_TestCase()); 
    1622$tickets->addTestCase(new Doctrine_Ticket_480_TestCase()); 
    1723$tickets->addTestCase(new Doctrine_Ticket_486_TestCase()); 
    18 $tickets->addTestCase(new Doctrine_Ticket_587_TestCase()); 
     24$tickets->addTestCase(new Doctrine_Ticket_565_TestCase()); 
    1925$tickets->addTestCase(new Doctrine_Ticket_576_TestCase()); 
    2026$tickets->addTestCase(new Doctrine_Ticket_583_TestCase()); 
     27$tickets->addTestCase(new Doctrine_Ticket_587_TestCase()); 
    2128$tickets->addTestCase(new Doctrine_Ticket_626B_TestCase()); 
    2229$tickets->addTestCase(new Doctrine_Ticket_626C_TestCase()); 
     30$tickets->addTestCase(new Doctrine_Ticket_626D_TestCase()); 
     31$tickets->addTestCase(new Doctrine_Ticket_638_TestCase()); 
    2332$tickets->addTestCase(new Doctrine_Ticket_642_TestCase()); 
    24 //If you write a ticket testcase add it here like shown above! 
    2533$tickets->addTestCase(new Doctrine_Ticket_438_TestCase()); 
    26 $tickets->addTestCase(new Doctrine_Ticket_638_TestCase()); 
    2734$tickets->addTestCase(new Doctrine_Ticket_673_TestCase()); 
    28 $tickets->addTestCase(new Doctrine_Ticket_626D_TestCase()); 
    2935$tickets->addTestCase(new Doctrine_Ticket_697_TestCase()); 
     36 
    3037// Only uncomment the following ticket if you want to check free() performance! 
    3138//$tickets->addTestCase(new Doctrine_Ticket_710_TestCase()); 
     39 
    3240$tickets->addTestCase(new Doctrine_Ticket_736_TestCase()); 
     41$tickets->addTestCase(new Doctrine_Ticket_741_TestCase()); 
     42$tickets->addTestCase(new Doctrine_Ticket_749_TestCase()); 
    3343$tickets->addTestCase(new Doctrine_Ticket_786_TestCase()); 
    3444$tickets->addTestCase(new Doctrine_Ticket_876_TestCase()); 
    3545$test->addTestCase($tickets); 
    3646 
    37 // Connection drivers (not yet fully tested) 
    38 $driver = new GroupTest("Driver tests", 'driver'); 
     47// Connection Tests (not yet fully tested) 
     48$driver = new GroupTest('Driver Tests', 'driver'); 
    3949$driver->addTestCase(new Doctrine_Connection_Pgsql_TestCase()); 
    4050$driver->addTestCase(new Doctrine_Connection_Oracle_TestCase()); 
     
    4656$test->addTestCase($driver); 
    4757 
    48 // Transaction module (FULLY TESTED) 
    49 $transaction = new GroupTest("Transaction tests", 'transaction'); 
     58// Transaction Tests (FULLY TESTED) 
     59$transaction = new GroupTest('Transaction Tests', 'transaction'); 
    5060$transaction->addTestCase(new Doctrine_Transaction_TestCase()); 
    5161$transaction->addTestCase(new Doctrine_Transaction_Firebird_TestCase()); 
     
    5868$test->addTestCase($transaction); 
    5969 
    60 // DataDict module (FULLY TESTED) 
    61 $data_dict = new GroupTest('DataDict tests', 'data_dict'); 
     70// DataDict Tests (FULLY TESTED) 
     71$data_dict = new GroupTest('DataDict Tests', 'data_dict'); 
    6272$data_dict->addTestCase(new Doctrine_DataDict_TestCase()); 
    6373$data_dict->addTestCase(new Doctrine_DataDict_Firebird_TestCase()); 
     
    7080$test->addTestCase($data_dict); 
    7181 
    72 // Sequence module (not yet fully tested) 
    73 $sequence = new GroupTest('Sequence tests','sequence'); 
     82// Sequence Tests (not yet fully tested) 
     83$sequence = new GroupTest('Sequence Tests', 'sequence'); 
    7484$sequence->addTestCase(new Doctrine_Sequence_TestCase()); 
    7585$sequence->addTestCase(new Doctrine_Sequence_Firebird_TestCase()); 
     
    8292$test->addTestCase($sequence); 
    8393 
    84 // Export module (not yet fully tested) 
    85 $export = new GroupTest('Export tests','export'); 
    86 //$export->addTestCase(new Doctrine_Export_Reporter_TestCase()); 
     94// Export Tests (not yet fully tested) 
     95$export = new GroupTest('Export Tests', 'export'); 
    8796$export->addTestCase(new Doctrine_Export_Firebird_TestCase()); 
    8897$export->addTestCase(new Doctrine_Export_Informix_TestCase()); 
     
    97106$test->addTestCase($export); 
    98107 
    99 //$test->addTestCase(new Doctrine_CascadingDelete_TestCase()); 
    100  
    101 // Import module (not yet fully tested) 
    102 $import = new GroupTest('Import tests','import'); 
    103 //$import->addTestCase(new Doctrine_Import_TestCase()); 
     108// Import Tests (not yet fully tested) 
     109$import = new GroupTest('Import Tests', 'import'); 
     110$import->addTestCase(new Doctrine_Import_TestCase()); 
    104111$import->addTestCase(new Doctrine_Import_Firebird_TestCase()); 
    105112$import->addTestCase(new Doctrine_Import_Informix_TestCase()); 
     
    113120$test->addTestCase($import); 
    114121 
    115 // Expression module (not yet fully tested) 
    116 $expression = new GroupTest('Expression tests','expression'); 
     122// Expression Tests (not yet fully tested) 
     123$expression = new GroupTest('Expression Tests', 'expression'); 
    117124$expression->addTestCase(new Doctrine_Expression_TestCase()); 
    118125$expression->addTestCase(new Doctrine_Expression_Driver_TestCase()); 
     
    126133$test->addTestCase($expression); 
    127134 
    128 // Core 
    129 $core = new GroupTest('Core tests: Access, Configurable, Manager, Connection, Table, UnitOfWork, Collection, Hydrate, Tokenizer','core'); 
     135// Core Tests 
     136$core = new GroupTest('Core Test', 'core'); 
    130137$core->addTestCase(new Doctrine_Base_TestCase()); 
    131138$core->addTestCase(new Doctrine_Access_TestCase()); 
    132 //$core->addTestCase(new Doctrine_Configurable_TestCase()); 
     139$core->addTestCase(new Doctrine_Configurable_TestCase()); 
    133140$core->addTestCase(new Doctrine_Manager_TestCase()); 
    134141$core->addTestCase(new Doctrine_Connection_TestCase()); 
    135142$core->addTestCase(new Doctrine_Table_TestCase()); 
    136143$core->addTestCase(new Doctrine_UnitOfWork_TestCase()); 
    137 //$core->addTestCase(new Doctrine_Collection_TestCase()); 
     144$core->addTestCase(new Doctrine_Collection_TestCase()); 
    138145$core->addTestCase(new Doctrine_Collection_Snapshot_TestCase()); 
    139146$core->addTestCase(new Doctrine_Hydrate_FetchMode_TestCase()); 
    140147$core->addTestCase(new Doctrine_Tokenizer_TestCase()); 
    141 //$core->addTestCase(new Doctrine_Collection_Offset_TestCase()); 
    142 //$core->addTestCase(new Doctrine_BatchIterator_TestCase()); 
     148$core->addTestCase(new Doctrine_Collection_Offset_TestCase()); 
     149$core->addTestCase(new Doctrine_BatchIterator_TestCase()); 
    143150$core->addTestCase(new Doctrine_Hydrate_TestCase()); 
    144151$test->addTestCase($core); 
    145152 
    146 // Relation handling 
    147 $relation = new GroupTest('Relation tests: includes TreeStructure','relation'); 
     153// Relation Tests 
     154$relation = new GroupTest('Relation Tests', 'relation'); 
    148155$relation->addTestCase(new Doctrine_TreeStructure_TestCase()); 
    149156$relation->addTestCase(new Doctrine_Relation_TestCase()); 
    150 //$relation->addTestCase(new Doctrine_Relation_Access_TestCase()); 
    151 //$relation->addTestCase(new Doctrine_Relation_ManyToMany_TestCase()); 
     157$relation->addTestCase(new Doctrine_Relation_Access_TestCase()); 
     158$relation->addTestCase(new Doctrine_Relation_ManyToMany_TestCase()); 
    152159$relation->addTestCase(new Doctrine_Relation_ManyToMany2_TestCase()); 
    153160$relation->addTestCase(new Doctrine_Relation_OneToMany_TestCase()); 
     
    157164$test->addTestCase($relation); 
    158165 
    159 // Datatypes 
    160 $data_types = new GroupTest('DataTypes tests: Enum and Boolean','data_types'); 
     166// Data Types Tests 
     167$data_types = new GroupTest('Data Types Tests', 'data_types'); 
    161168$data_types->addTestCase(new Doctrine_DataType_Enum_TestCase()); 
    162169$data_types->addTestCase(new Doctrine_DataType_Boolean_TestCase()); 
    163170$test->addTestCase($data_types); 
    164171 
    165 // Utility components 
    166 $plugins = new GroupTest('Plugin tests: View, Validator, Hook','plugins'); 
    167 //$utility->addTestCase(new Doctrine_PessimisticLocking_TestCase()); 
    168 //$plugins->addTestCase(new Doctrine_Plugin_TestCase()); 
    169 $plugins->addTestCase(new Doctrine_View_TestCase()); 
    170 $plugins->addTestCase(new Doctrine_AuditLog_TestCase()); 
    171 $plugins->addTestCase(new Doctrine_Validator_TestCase()); 
    172 $plugins->addTestCase(new Doctrine_Validator_Future_TestCase()); 
    173 $plugins->addTestCase(new Doctrine_Validator_Past_TestCase()); 
    174 $plugins->addTestCase(new Doctrine_Hook_TestCase()); 
    175 $plugins->addTestCase(new Doctrine_I18n_TestCase()); 
    176 $test->addTestCase($plugins); 
    177  
    178 // Db component 
    179 $db = new GroupTest('Db tests: Db and Profiler','db'); 
     172// Behaviors Testing 
     173$behaviors = new GroupTest('Behaviors Tests', 'behaviors'); 
     174//$behaviors->addTestCase(new Doctrine_Plugin_TestCase()); 
     175$behaviors->addTestCase(new Doctrine_View_TestCase()); 
     176$behaviors->addTestCase(new Doctrine_AuditLog_TestCase()); 
     177$behaviors->addTestCase(new Doctrine_Validator_TestCase()); 
     178$behaviors->addTestCase(new Doctrine_Validator_Future_TestCase()); 
     179$behaviors->addTestCase(new Doctrine_Validator_Past_TestCase()); 
     180$behaviors->addTestCase(new Doctrine_Hook_TestCase()); 
     181$behaviors->addTestCase(new Doctrine_I18n_TestCase()); 
     182$test->addTestCase($behaviors); 
     183 
     184// Db Tests 
     185$db = new GroupTest('Db Tests', 'db'); 
    180186$db->addTestCase(new Doctrine_Db_TestCase()); 
    181187$db->addTestCase(new Doctrine_Connection_Profiler_TestCase()); 
    182188$test->addTestCase($db); 
    183189 
    184 // Eventlisteners 
    185 $event_listener = new GroupTest('EventListener tests','event_listener'); 
     190// Event Listener Tests 
     191$event_listener = new GroupTest('EventListener Tests','event_listener'); 
    186192$event_listener->addTestCase(new Doctrine_EventListener_TestCase()); 
    187193$event_listener->addTestCase(new Doctrine_EventListener_Chain_TestCase()); 
    188194$test->addTestCase($event_listener); 
    189195 
    190 // Query tests 
    191 $query_tests = new GroupTest('Query tests','query_test'); 
     196// Query Tests 
     197$query_tests = new GroupTest('Query Tests','query'); 
    192198$query_tests->addTestCase(new Doctrine_Query_Condition_TestCase()); 
    193199$query_tests->addTestCase(new Doctrine_Query_MultiJoin_TestCase()); 
     
    200206$query_tests->addTestCase(new Doctrine_Query_Check_TestCase()); 
    201207$query_tests->addTestCase(new Doctrine_Query_Limit_TestCase()); 
    202 //$query_tests->addTestCase(new Doctrine_Query_IdentifierQuoting_TestCase()); 
     208$query_tests->addTestCase(new Doctrine_Query_IdentifierQuoting_TestCase()); 
    203209$query_tests->addTestCase(new Doctrine_Query_Update_TestCase()); 
    204210$query_tests->addTestCase(new Doctrine_Query_Delete_TestCase()); 
     
    208214$query_tests->addTestCase(new Doctrine_Query_Subquery_TestCase()); 
    209215$query_tests->addTestCase(new Doctrine_Query_Driver_TestCase()); 
    210 $query_tests->addTestCase(new Doctrine_Record_Hook_TestCase()); 
    211216$query_tests->addTestCase(new Doctrine_Query_AggregateValue_TestCase()); 
    212217$query_tests->addTestCase(new Doctrine_Query_Where_TestCase()); 
     
    223228$test->addTestCase($query_tests); 
    224229 
    225 // Record 
    226 $record = new GroupTest('Record tests','record'); 
     230// Record Tests 
     231$record = new GroupTest('Record Tests', 'record'); 
     232$record->addTestCase(new Doctrine_Record_Hook_TestCase()); 
     233$record->addTestCase(new Doctrine_Record_CascadingDelete_TestCase()); 
    227234$record->addTestCase(new Doctrine_Record_Filter_TestCase()); 
    228235$record->addTestCase(new Doctrine_Record_TestCase()); 
    229236$record->addTestCase(new Doctrine_Record_State_TestCase()); 
    230237$record->addTestCase(new Doctrine_Record_SerializeUnserialize_TestCase()); 
    231 // This test used to segfault php because of infinite recursion in Connection/UnitOfWork 
    232238$record->addTestCase(new Doctrine_Record_Lock_TestCase()); 
    233239$record->addTestCase(new Doctrine_Record_ZeroValues_TestCase()); 
    234 //$record->addTestCase(new Doctrine_Record_SaveBlankRecord_TestCase()); 
     240$record->addTestCase(new Doctrine_Record_SaveBlankRecord_TestCase()); 
    235241$record->addTestCase(new Doctrine_Record_Inheritance_TestCase()); 
    236242$record->addTestCase(new Doctrine_Record_Synchronize_TestCase()); 
    237243$test->addTestCase($record); 
    238244 
    239 $test->addTestCase(new Doctrine_CustomPrimaryKey_TestCase()); 
    240 $test->addTestCase(new Doctrine_CustomResultSetOrder_TestCase()); 
    241  
    242 $test->addTestCase(new Doctrine_CtiColumnAggregation_TestCase()); 
    243 $test->addTestCase(new Doctrine_ColumnAggregationInheritance_TestCase()); 
    244 $test->addTestCase(new Doctrine_ClassTableInheritance_TestCase()); 
    245 $test->addTestCase(new Doctrine_ColumnAlias_TestCase()); 
    246  
    247  
    248 $test->addTestCase(new Doctrine_RawSql_TestCase()); 
    249  
    250 $test->addTestCase(new Doctrine_NewCore_TestCase()); 
    251  
    252 $test->addTestCase(new Doctrine_Template_TestCase()); 
    253 $test->addTestCase(new Doctrine_NestedSet_SingleRoot_TestCase()); 
    254  
    255 // Search tests 
    256 $search = new GroupTest('Search tests','search'); 
     245// Inheritance Tests 
     246$inheritance = new GroupTest('Inheritance Tests', 'inheritance'); 
     247$inheritance->addTestCase(new Doctrine_CtiColumnAggregation_TestCase()); 
     248$inheritance->addTestCase(new Doctrine_ColumnAggregationInheritance_TestCase()); 
     249$inheritance->addTestCase(new Doctrine_ClassTableInheritance_TestCase()); 
     250$inheritance->addTestCase(new Doctrine_Query_ApplyInheritance_TestCase()); 
     251$test->addTestCase($inheritance); 
     252 
     253// Search Tests 
     254$search = new GroupTest('Search Tests', 'search'); 
    257255$search->addTestCase(new Doctrine_Search_TestCase()); 
    258256$search->addTestCase(new Doctrine_Search_Query_TestCase()); 
    259257$search->addTestCase(new Doctrine_Search_File_TestCase()); 
    260  
    261258$test->addTestCase($search); 
    262259 
    263 // Cache tests 
    264 $cache = new GroupTest('Cache tests','cache'); 
     260// Cache Tests 
     261$cache = new GroupTest('Cache Tests', 'cache'); 
    265262$cache->addTestCase(new Doctrine_Query_Cache_TestCase()); 
    266263$cache->addTestCase(new Doctrine_Cache_Apc_TestCase()); 
    267 //$cache->addTestCase(new Doctrine_Cache_Memcache_TestCase()); 
    268 //$cache->addTestCase(new Doctrine_Cache_Sqlite_TestCase()); 
    269 //$cache->addTestCase(new Doctrine_Cache_Query_SqliteTestCase()); 
    270 //$cache->addTestCase(new Doctrine_Cache_FileTestCase()); 
    271 //$cache->addTestCase(new Doctrine_Cache_SqliteTestCase()); 
     264$cache->addTestCase(new Doctrine_Cache_Memcache_TestCase()); 
     265$cache->addTestCase(new Doctrine_Cache_Sqlite_TestCase()); 
     266$cache->addTestCase(new Doctrine_Cache_Query_Sqlite_TestCase()); 
     267$cache->addTestCase(new Doctrine_Cache_FileTestCase()); 
     268$cache->addTestCase(new Doctrine_Cache_SqliteTestCase()); 
    272269//$cache->addTestCase(new Doctrine_Cache_TestCase()); 
    273270$test->addTestCase($cache); 
    274271 
    275272// Migration Tests 
    276 $migration = new GroupTest('Migration tests','migration'); 
     273$migration = new GroupTest('Migration Tests', 'migration'); 
    277274$migration->addTestCase(new Doctrine_Migration_TestCase()); 
    278 //$migration->addTestCase(new Doctrine_Migration_Mysql_TestCase()); 
    279275$test->addTestCase($migration); 
    280276 
    281 $test->addTestCase(new Doctrine_Query_ApplyInheritance_TestCase()); 
    282  
    283 $parser = new GroupTest('Parser tests', 'parser'); 
     277// File Parser Tests 
     278$parser = new GroupTest('Parser Tests', 'parser'); 
    284279$parser->addTestCase(new Doctrine_Parser_TestCase()); 
    285280$test->addTestCase($parser); 
    286281 
     282// Data Fixtures Tests 
    287283$data = new GroupTest('Data exporting/importing fixtures', 'data_fixtures'); 
    288284$data->addTestCase(new Doctrine_Data_Import_TestCase()); 
     
    290286$test->addTestCase($data); 
    291287 
    292 $jwage = new GroupTest('Jwage', 'jwage'); 
    293 $jwage->addTestCase(new Doctrine_Jwage_TestCase()); 
    294 $test->addTestCase($jwage); 
     288// Unsorted Tests. These need to be sorted and placed in the appropriate group 
     289$unsorted = new GroupTest('Unsorted Tests', 'unsorted'); 
     290$unsorted->addTestCase(new Doctrine_CustomPrimaryKey_TestCase()); 
     291$unsorted->addTestCase(new Doctrine_CustomResultSetOrder_TestCase()); 
     292$unsorted->addTestCase(new Doctrine_ColumnAlias_TestCase()); 
     293//$unsorted->addTestCase(new Doctrine_RawSql_TestCase()); 
     294$unsorted->addTestCase(new Doctrine_NewCore_TestCase()); 
     295$unsorted->addTestCase(new Doctrine_Template_TestCase()); 
     296$unsorted->addTestCase(new Doctrine_NestedSet_SingleRoot_TestCase()); 
     297$unsorted->addTestCase(new Doctrine_PessimisticLocking_TestCase()); 
     298$test->addTestCase($unsorted); 
    295299 
    296300$test->run(); 
    297301 
    298 echo memory_get_peak_usage() / 1024 . "\n"; 
     302echo "\nMemory Usage: " . memory_get_peak_usage() / 1024 . "\n"; 
  • branches/0.10/tests/Ticket/741TestCase.php

    r3576 r4029  
    2727 
    2828} 
    29  
    30  
    3129 
    3230class Parent741 extends Doctrine_Record 
  • branches/0.10/tests/Ticket/749TestCase.php

    r3884 r4029  
    4646    public function testSelectDataFromSubclassAsCollection() 
    4747    { 
    48         $records = Doctrine_Query::create()->query(' 
    49             FROM Record749 r ORDER BY r.title                                            
    50         ', array()); 
     48        $records = Doctrine_Query::create()->query('FROM Record749 r ORDER BY r.title', array()); 
    5149         
    5250        $this->verifyRecords($records); 
     
    5553    public function testSelectDataFromParentClassAsCollection() 
    5654    { 
    57         $records = Doctrine_Query::create()->query(' 
    58             FROM Parent749 p ORDER BY p.title                                            
    59         ', array()); 
     55        $records = Doctrine_Query::create()->query('FROM Parent749 p ORDER BY p.title', array()); 
    6056         
    6157        $this->verifyRecords($records); 
     
    7975                $this->assertEqual($record['Related']['content'], $expected['content']); 
    8076            } catch (Exception $e) { 
    81                 $this->fail('Caught exception when trying to get related content.'); 
     77                $this->fail('Caught exception when trying to get related content: ' . $e->getMessage()); 
    8278            } 
    8379        }         
     
    9995    $this->hasColumn('type', 'integer', 11, array ()); 
    10096 
    101     $this->option('subclasses', array('Record749')); 
     97    $this->setSubclasses(array('Record749' => array('type' => 1))); 
    10298  } 
    10399 
     
    120116    $this->hasOne('RelatedRecord749 as Related', array('local' => 'id', 
    121117                                                    'foreign' => 'record_id')); 
    122  
    123     $this->setInheritanceMap(array('type' => '1')); 
    124118  } 
    125119}