Author: jwage
Date: 2008-07-03 18:10:44 +0100 (Thu, 03 Jul 2008)
New Revision: 4627
Modified:
branches/0.11/tests/Ticket/1205TestCase.php
Log:
Changed how testing for functionality.
Modified: branches/0.11/tests/Ticket/1205TestCase.php
===================================================================
--- branches/0.11/tests/Ticket/1205TestCase.php 2008-07-03 17:05:42 UTC (rev 4626)
+++ branches/0.11/tests/Ticket/1205TestCase.php 2008-07-03 17:10:44 UTC (rev 4627)
@@ -25,11 +25,16 @@
public function testTicket()
{
- // Each Address has 1 User
- $q = new Doctrine_Query();
- $addresses = $q->from('Ticket1205TestAddress a')->innerjoin('a.User u')->execute(array(), Doctrine::FETCH_ARRAY);
-
- $this->assertEqual($addresses[0]['User']['full_name'], 'Slick Rick');
+ try {
+ // Each Address has 1 User
+ $q = Doctrine_Query::create()
+ ->from('Ticket1205TestAddress a')
+ ->innerjoin('a.User u')
+ ->execute(array(), Doctrine::FETCH_ARRAY);
+ $this->fail();
+ } catch (Exception $e) {
+ $this->pass();
+ }
}
}
@@ -37,9 +42,7 @@
{
public function postHydrate(Doctrine_Event $event)
{
- $data = $event->data;
- $data['full_name'] = $data['first_name'] . ' ' . $data['last_name'];
- $event->data = $data;
+ throw new Exception('This is called so we are successfull!');
}
}
@@ -55,8 +58,8 @@
public function setUp()
{
$this->addListener(new Ticket1205HydrationListener());
- $this->hasMany('Ticket1205TestAddress as Addresses', array('local' => 'id',
- 'foreign' => 'user_id'));
+ $this->hasMany('Ticket1205TestAddress as Addresses', array('local' => 'id',
+ 'foreign' => 'user_id'));
}
}
@@ -71,7 +74,7 @@
public function setUp()
{
- $this->hasOne('Ticket1205TestUser as User', array('local' => 'user_id',
- 'foreign' => 'id'));
+ $this->hasOne('Ticket1205TestUser as User', array('local' => 'user_id',
+ 'foreign' => 'id'));
}
}
\ No newline at end of file