Changeset 4486
- Timestamp:
- 06/08/08 17:28:13 (13 months ago)
- Location:
- branches/0.11/tests
- Files:
-
- 3 modified
-
run.php (modified) (1 diff)
-
Ticket/1099TestCase.php (modified) (4 diffs)
-
Ticket/1116TestCase.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/tests/run.php
r4485 r4486 73 73 $tickets->addTestCase(new Doctrine_Ticket_1071_TestCase()); 74 74 $tickets->addTestCase(new Doctrine_Ticket_1072_TestCase()); 75 $tickets->addTestCase(new Doctrine_Ticket_1099_TestCase()); 75 76 $tickets->addTestCase(new Doctrine_Ticket_1113_TestCase()); 76 77 $tickets->addTestCase(new Doctrine_Ticket_1116_TestCase()); 77 //$tickets->addTestCase(new Doctrine_Ticket_1099_TestCase()); 78 $tickets->addTestCase(new Doctrine_Ticket_1121_TestCase()); 79 78 80 $test->addTestCase($tickets); 79 81 -
branches/0.11/tests/Ticket/1099TestCase.php
r4460 r4486 1 1 <?php 2 class Doctrine_Ticket_1099_TestCase extends Doctrine_UnitTestCase 2 class Doctrine_Ticket_1099_TestCase extends Doctrine_UnitTestCase 3 3 { 4 4 public function prepareTables() 5 5 { 6 6 $this->tables = array(); 7 $this->tables[] = 'T1099_Page';8 $this->tables[] = 'T1099_SubPage';7 $this->tables[] = 'T1099_Page'; 8 $this->tables[] = 'T1099_SubPage'; 9 9 10 parent::prepareTables();10 parent::prepareTables(); 11 11 } 12 12 … … 14 14 { 15 15 $page = new T1099_Page(); 16 $page->type = 'page';17 $tree = $page->getTable()->getTree();18 $tree->createRoot($page);16 $page->type = 'page'; 17 $tree = $page->getTable()->getTree(); 18 $tree->createRoot($page); 19 19 20 $subPage = new T1099_SubPage();21 $subPage->getNode()->insertAsLastChildOf($page);20 $subPage = new T1099_SubPage(); 21 $subPage->getNode()->insertAsLastChildOf($page); 22 22 } 23 23 … … 25 25 { 26 26 $child = Doctrine_Query::create() 27 ->from('T1099_Page p')28 ->where('p.type = \'subpage\'')29 ->fetchOne();27 ->from('T1099_Page p') 28 ->where('p.type = \'subpage\'') 29 ->fetchOne(); 30 30 31 $this->assertEqual('T1099_SubPage', get_class($child));32 $this->assertNotEqual(false, $child->getNode()->getParent());31 $this->assertEqual('T1099_SubPage', get_class($child)); 32 $this->assertNotEqual(false, $child->getNode()->getParent()); 33 33 } 34 34 } … … 39 39 { 40 40 $this->setTableName('pages'); 41 $this->hasColumn('id', 'integer', 15, array('autoincrement' => true, 'primary' => true, 'notnull' => true));42 $this->hasColumn('type', 'string', 10);41 $this->hasColumn('id', 'integer', 15, array('autoincrement' => true, 'primary' => true, 'notnull' => true)); 42 $this->hasColumn('type', 'string', 10); 43 43 } 44 44 45 45 public function setUp() 46 46 { 47 $this->actAs('Doctrine_Template_NestedSet');48 $this->setSubclasses(array(49 'T1099_SubPage' => array('type' => 'subpage')50 ));51 parent::setUp();47 $this->actAs('Doctrine_Template_NestedSet'); 48 $this->setSubclasses(array( 49 'T1099_SubPage' => array('type' => 'subpage') 50 )); 51 parent::setUp(); 52 52 } 53 53 } -
branches/0.11/tests/Ticket/1116TestCase.php
r4485 r4486 17 17 ->from('Ticket_1116_User s') 18 18 ->where('s.username = ?', array('test')); 19 20 $params = $q->getParams(); // there should be array('test',null) but we only have 'test' 21 22 $this->assertEqual(count($params),2); 23 24 19 25 20 // to see the error switch dbh to a real db, the next line will trigger the error 26 21 $test = $q->fetchOne(); //will only fail with "real" mysql … … 51 46 $this->actAs($softdelete0); 52 47 } 53 54 48 }