Google Groups Home
Help | Sign in
r4627 - branches/0.11/tests/Ticket
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
no-re...@phpdoctrine.org  
View profile
 More options 3 Jul, 18:10
From: no-re...@phpdoctrine.org
Date: Thu, 03 Jul 2008 18:10:45 +0100
Local: Thurs 3 Jul 2008 18:10
Subject: r4627 - branches/0.11/tests/Ticket
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google