Development

Changeset 19825

You must first sign up to be able to contribute.

Changeset 19825

Show
Ignore:
Timestamp:
07/02/09 16:29:35 (9 months ago)
Author:
garak
Message:

enhanced event module (with some tests); fixed some message module bugs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfSocialPlugin/trunk/config/schema.yml

    r15069 r19825  
    9393    user_from: { type: integer, required: true, foreignTable: sf_guard_user, foreignReference: id, onDelete: cascade, onUpdate: cascade } 
    9494    subject: { type: varchar, size: 255, required: true } 
    95     text: { type: longvarchar
     95    text: { type: longvarchar, required: true
    9696    created_at: ~ 
    9797 
  • plugins/sfSocialPlugin/trunk/data/fixtures/01_users.yml

    r19815 r19825  
    3636    username:  tommy 
    3737    password:  dummy 
     38  mickey: 
     39    username:  mickey 
     40    password:  mouse 
     41  goofy: 
     42    username:  goofy 
     43    password:  boofy 
  • plugins/sfSocialPlugin/trunk/data/fixtures/03_messages.yml

    r19815 r19825  
    2525    text: who's afraid of big bad wolf, big bad wolf, big bad wolf. 
    2626    created_at: 2009-01-14 18:13:14 
     27  from_goofy: 
     28    user_from: goofy 
     29    subject: yup 
     30    text: I don't know what to say, but I say it. 
     31    created_at: 2009-07-02 13:22:04 
    2732 
    2833sfSocialMessageRcpt: 
     
    5055    msg_id: from_danny 
    5156    user_to: max 
     57  goofy_to_max: 
     58    msg_id: from_goofy 
     59    user_to: max 
  • plugins/sfSocialPlugin/trunk/data/fixtures/05_events.yml

    r15225 r19825  
    1616    location: Naples, Italy 
    1717    created_at: 2009-01-15 15:31:22 
     18  nerdconvention: 
     19    user_admin: max 
     20    title: Looking for geeks 
     21    description: A convention for every geek on the earth 
     22    start: 2009-09-09 10:00:00 
     23    end: 2009-09-10 22:00:00 
     24    location: Paris, France 
     25    created_at: 2009-07-02 13:17:21 
     26  endofworld: 
     27    user_admin: max 
     28    title: End of the world 
     29    description: It is the end of the world and we know it 
     30    start: 2012-12-21 00:00:01 
     31    end: 2012-12-21 22:00:02 
     32    location: Earth, Milky Way 
     33    created_at: 2009-07-02 13:19:43 
    1834 
    1935sfSocialEventInvite: 
  • plugins/sfSocialPlugin/trunk/lib/form/sfSocialEventInviteForm.class.php

    r14756 r19825  
    2828    $this->setValidator('event_id', new sfValidatorChoice(array('choices' => array($eid)))); 
    2929 
     30    // restrict users to invite to user's friends 
     31    $c = new Criteria; 
     32    $c->add(sfSocialContactPeer::USER_FROM, $uid)-> 
     33      setLimit(50)-> 
     34      addAscendingOrderByColumn(sfGuardUserPeer::USERNAME); 
     35    $this->widgetSchema['user_id']->setOption('model', 'sfSocialContact'); 
     36    $this->widgetSchema['user_id']->addOption('multiple', true); 
     37    $this->widgetSchema['user_id']->addOption('peer_method', 'doSelectJoinsfGuardUserRelatedByUserTo'); 
     38    $this->widgetSchema['user_id']->addOption('criteria', $c); 
     39    $this->widgetSchema['user_id']->addOption('key_method', 'getUserId'); 
     40    $this->validatorSchema['user_id']->addOption('multiple', true); 
     41    $this->validatorSchema->setPostValidator( 
     42      new sfValidatorCallback(array('callback'  => array($this, 'unique_check'))) 
     43    ); 
     44  } 
     45 
     46  /** 
     47   * callback to clean possible duplicate values on user_id (if multiple submitted), 
     48   * without invalidating the entire form 
     49   * @param  sfValidatorCallback $validator 
     50   * @param  array               $values    form's values 
     51   * @param  array               $arguments unused in this case 
     52   * @return array 
     53   */ 
     54  public function unique_check($validator, $values, $arguments) 
     55  { 
     56    if (is_array($values['user_id'])) 
     57    { 
     58      foreach ($values['user_id'] as $k => $user_id) 
     59      { 
     60        $c = new Criteria; 
     61        $c->add(sfSocialEventInvitePeer::EVENT_ID, $values['event_id']); 
     62        $c->add(sfSocialEventInvitePeer::USER_FROM, $values['user_from']); 
     63        $c->add(sfSocialEventInvitePeer::USER_ID, $user_id); 
     64        $invite = sfSocialEventInvitePeer::doSelectOne($c); 
     65        if (null !== $invite) 
     66        { 
     67          unset($values['user_id'][$k]); 
     68        } 
     69      } 
     70      return $values; 
     71    } 
     72    else 
     73    { 
     74      $validator = new sfValidatorPropelUnique(array('model' => 'sfSocialEventInvite', 'column' => array('event_id', 'user_id', 'user_from'))); 
     75      return $validator->clean($values); 
     76    } 
     77  } 
     78 
     79  /** 
     80   * ovveride to save many invites instead of just one 
     81   * @param PropelPDO $con 
     82   */ 
     83  public function doSave($con = null) 
     84  { 
     85    if (is_null($con)) 
     86    { 
     87      $con = $this->getConnection(); 
     88    } 
     89    $this->updateObject(); 
     90    $values = $this->getValues(); 
     91    if (is_array($values['user_id'])) 
     92    { 
     93      foreach ($values['user_id'] as $user_id) 
     94      { 
     95        $obj = clone $this->getObject(); 
     96        $obj->setUserId($user_id); 
     97        $obj->save(); 
     98      } 
     99    } 
     100    else 
     101    { 
     102      parent::doSave($con); 
     103    } 
    30104  } 
    31105 
  • plugins/sfSocialPlugin/trunk/lib/form/sfSocialEventUserForm.class.php

    r14756 r19825  
    1111{ 
    1212 
    13   // choices for confirm 
    14   private static $choices = array(1 => 'maybe', 2 => 'yes', 3 => 'no'); 
    15  
    1613  public function configure() 
    1714  { 
     
    2118    // make confirm a choice 
    2219    $this->widgetSchema['confirm'] = new sfWidgetFormChoice(array( 
    23       'choices'  => self::$choices, 
     20      'choices'  => sfSocialEventUser::$choices, 
    2421      'expanded' => true, 
    2522    )); 
     
    3734    $this->setValidator('event_id', new sfValidatorChoice(array('choices' => array($eid)))); 
    3835  } 
    39    
     36 
    4037} 
  • plugins/sfSocialPlugin/trunk/lib/form/sfSocialMessageForm.class.php

    r19815 r19825  
    3636                                                                 ); 
    3737    $this->setValidator('to', 
    38                         new sfValidatorPropelChoiceMany(array('model' => 'sfGuardUser', 
    39                                                               'column' => 'id'))); 
     38                        new sfValidatorPropelChoiceMany(array('model'    => 'sfGuardUser', 
     39                                                              'column'   => 'id', 
     40                                                              'required' => true))); 
     41 
    4042  } 
    4143} 
  • plugins/sfSocialPlugin/trunk/lib/model/sfSocialContactRequestPeer.php

    r14765 r19825  
    1111   * @return sfPropelPager 
    1212   */ 
    13   public static function getReceiveRequests(sfGuardUser $user, $page = 1, $n = 10) 
     13  public static function getReceivedRequests(sfGuardUser $user, $page = 1, $n = 10) 
    1414  { 
    1515    $c = new Criteria(); 
  • plugins/sfSocialPlugin/trunk/lib/model/sfSocialEventInvite.php

    r14545 r19825  
    33class sfSocialEventInvite extends BasesfSocialEventInvite 
    44{ 
     5 
     6  /** 
     7   * get user's reply to event invite 
     8   * @return string 
     9   */ 
     10  public function getReply() 
     11  { 
     12    $event = $this->getsfSocialEvent(); 
     13    $user = $this->getsfGuardUserRelatedByUserId(); 
     14    $event_user = sfSocialEventUserPeer::retrieveByPK($event->getId(), $user->getId()); 
     15    if (null === $event_user) 
     16    { 
     17      return null; 
     18    } 
     19    return sfSocialEventUser::$choices[$event_user->getConfirm()]; 
     20  } 
     21 
    522} 
  • plugins/sfSocialPlugin/trunk/lib/model/sfSocialEventUser.php

    r14545 r19825  
    33class sfSocialEventUser extends BasesfSocialEventUser 
    44{ 
     5 
     6  // possible replies to invite 
     7  public static $choices = array(1 => 'maybe', 2 => 'yes', 3 => 'no'); 
     8 
     9 
    510} 
  • plugins/sfSocialPlugin/trunk/lib/user/sfSocialSecurityUser.class.php

    r15550 r19825  
    1919  /** 
    2020   * Check is user is friend 
    21    *  
     21   * 
    2222   * @param  sfGuardUser $user 
    23    * @return boolean  
     23   * @return boolean 
    2424   * @access public 
    2525   */ 
     
    2828    return $this->getGuardUser() ? $this->getGuardUser()->hasContact($user) : false; 
    2929  } 
    30    
     30 
    3131  /** 
    32    * Get array with list of contacts  
    33    *  
     32   * Get array with list of contacts 
     33   * 
    3434   * @param  int $limit 
    35    * @return array  
     35   * @return array 
    3636   * @access public 
    3737   */ 
     
    4343  /** 
    4444   * Adding a contact 
    45    *  
     45   * 
    4646   * @param  sfGuardUser $user 
    47    * @return booelan  
     47   * @return booelan 
    4848   * @access public 
    4949   */ 
    5050  public function addContact($user) 
    5151  { 
     52#var_dump($user); 
     53#var_dump(($this->getGuardUser()));die; 
    5254    return $this->getGuardUser()->addContact($user); 
    5355  } 
    54    
     56 
    5557  /** 
    5658   * Accept request from a contact 
    57    *  
     59   * 
    5860   * @param  sfGuardUser $user 
    5961   * @param  string $message 
    60    * @return booelan  
     62   * @return booelan 
    6163   * @access public 
    6264   */ 
     
    6567    return $this->getGuardUser()->sendRequestContact($user, $message); 
    6668  } 
    67    
     69 
    6870  /** 
    6971   * Accept request from a contact 
    70    *  
     72   * 
    7173   * @param  user $user 
    72    * @return booelan  
     74   * @return booelan 
    7375   * @access public 
    7476   */ 
     
    8082  /** 
    8183   * Deny request from a contact 
    82    *  
     84   * 
    8385   * @param  user $user 
    84    * @return booelan  
     86   * @return booelan 
    8587   * @access public 
    8688   */ 
     
    8991    return $this->getGuardUser()->denyRequestContact($user); 
    9092  } 
    91    
     93 
    9294  /** 
    9395   * Remove contact 
    94    *  
     96   * 
    9597   * @param  user $user 
    96    * @return boolean  
     98   * @return boolean 
    9799   * @access public 
    98100   */ 
     
    101103    return $this->getGuardUser()->removeContact($user); 
    102104  } 
    103    
     105 
    104106  /** 
    105107   * Adding a contact from username 
    106    *  
     108   * 
    107109   * @param  string $username 
    108    * @return booelan  
     110   * @return booelan 
    109111   * @access public 
    110112   */ 
     
    113115    return $this->getGuardUser()->addContactByUsername($username); 
    114116  } 
    115    
     117 
    116118  /** 
    117119   * Remove contact from username 
    118    *  
     120   * 
    119121   * @param  string $username 
    120    * @return boolean  
     122   * @return boolean 
    121123   * @access public 
    122124   */ 
     
    125127    return $this->getGuardUser()->removeContactByUsername($username); 
    126128  } 
    127    
     129 
    128130  /** 
    129131   * Remove all contatcs from username 
    130    *  
     132   * 
    131133   * @param  null 
    132    * @return boolean  
     134   * @return boolean 
    133135   * @access public 
    134136   */ 
  • plugins/sfSocialPlugin/trunk/modules/sfSocialContact/lib/BasesfSocialContactActions.class.php

    r15649 r19825  
    1717  public function executeList(sfWebRequest $request) 
    1818  { 
    19     //myUser::addContact(); 
    2019    $page = $request->getParameter('page'); 
    2120    $this->pager = sfSocialContactPeer::getContacts($this->getUser()->getGuardUser(), $page); 
     
    4342  { 
    4443    $page = $request->getParameter('page'); 
    45     $this->pager = sfSocialContactRequestPeer::getReceiveRequests($this->getUser()->getGuardUser(), $page); 
     44    $this->pager = sfSocialContactRequestPeer::getReceivedRequests($this->getUser()->getGuardUser(), $page); 
    4645  } 
    4746 
  • plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/lib/BasesfSocialEventActions.class.php

    r15069 r19825  
    5151    $this->event = sfSocialEventPeer::retrieveByPK($id); 
    5252    $this->forward404Unless($this->event, 'event not found'); 
    53  
    5453    // confirm form 
    5554    $this->getContext()->set('Event', $this->event); 
     
    6059      $this->form->bindAndSave($request->getParameter($this->form->getName())); 
    6160    } 
    62  
    6361    // invite form 
    6462    $this->isAdmin = $this->event->getSfGuardUser()->getId() == $this->getUser()->getGuardUser()->getId(); 
     
    130128    $this->form = new sfSocialEventInviteForm(); 
    131129    $this->forward404If($this->event->getUserAdmin() != $values['user_from'], 'access denied'); 
    132     $this->form->bindAndSave($values); 
     130    if ($this->form->bindAndSave($values)) 
     131    { 
     132      $this->getUser()->setFlash('notice', count($this->form->getValue('user_id')) . ' users invited.'); 
     133    } 
     134    $this->redirect('@sf_social_event?id=' . $this->event->getId()); 
    133135  } 
    134136 
  • plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/templates/listSuccess.php

    r15225 r19825  
    33<?php else: ?> 
    44<h2><?php echo __('Events') ?></h2> 
    5 <ul
     5<ul id="list"
    66<?php foreach ($pager->getResults() as $event): ?> 
    7   <li
     7  <li class="<?php $bRow = empty($bRow) ? print('a') : false ?>"
    88    <?php echo link_to($event->getTitle(), '@sf_social_event?id=' . $event->getId()) ?> 
    99    <?php echo $event->getWhen() ?> 
  • plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/templates/viewSuccess.php

    r15225 r19825  
    11<h2><?php echo __('Event') ?> &quot;<?php echo $event->getTitle() ?>&quot;</h2> 
     2 
     3<?php if ($sf_user->getFlash('notice')): ?> 
     4<div class="notice"> 
     5  <?php echo $sf_user->getFlash('notice') ?> 
     6</div> 
     7<?php endif ?> 
    28 
    39<h3><?php echo __('When') ?>: <?php echo $event->getWhen() ?></h3> 
     
    713</div> 
    814 
     15<?php if ($isAdmin): ?> 
     16<div id="event_edit"> 
     17  <?php echo link_to(__('Edit event'), '@sf_social_event_edit?id=' . $event->getId()) ?> 
     18</div> 
     19<?php endif ?> 
     20 
    921<div id="event_confirm"> 
    1022<form action="<?php echo url_for('@sf_social_event?id=' . $event->getId()) ?>" method="post"> 
    11   <table
     23  <ul id="form"
    1224    <?php echo $form ?> 
    13     <tr> 
    14       <td colspan="2"> 
    15         <input type="submit" /> 
    16       </td> 
    17     </tr> 
    18   </table> 
     25    <li class="buttons"> 
     26      <input type="submit" value="<?php echo __('confirm') ?>" /> 
     27    </li> 
     28  </ul> 
    1929</form> 
    2030</div> 
    2131 
    2232<?php if ($isAdmin): ?> 
    23 <?php echo link_to(__('Edit event'), '@sf_social_event_edit?id=' . $event->getId()) ?> 
    2433<h3><?php echo __('Invite:') ?></h3> 
    2534<div id="event_invite"> 
    2635<form action="<?php echo url_for('@sf_social_event_invite?id=' . $event->getId()) ?>" method="post"> 
    27   <table
     36  <ul id="form"
    2837    <?php echo $form2 ?> 
    29     <tr> 
    30       <td colspan="2"> 
    31         <input type="submit" /> 
    32       </td> 
    33     </tr> 
    34   </table> 
     38    <li class="buttons"> 
     39        <input type="submit" value="<?php echo __('invite') ?>" /> 
     40    </li> 
     41  </ul> 
    3542</form> 
    3643</div> 
     44<?php endif ?> 
     45 
     46<h3><?php echo __('Invited users:') ?></h3> 
     47<?php if (null === $invited = $event->getsfSocialEventInvitesJoinsfGuardUserRelatedByUserId()): ?> 
     48<?php echo __('No invited users') ?> 
     49<?php else: ?> 
     50<ul id="invited"> 
     51<?php foreach ($event->getsfSocialEventInvitesJoinsfGuardUserRelatedByUserId() as $invite): ?> 
     52  <li> 
     53    <?php echo link_to($invite->getsfGuardUserRelatedByUserId(), '@sf_social_user?username=' . $invite->getsfGuardUserRelatedByUserId()) ?>: 
     54    <?php echo $invite->getReplied() ? __($invite->getReply()) : __('awaiting reply') ?> 
     55  </li> 
     56<?php endforeach ?> 
     57</ul> 
    3758<?php endif ?> 
    3859 
  • plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/lib/BasesfSocialMessageActions.class.php

    r15649 r19825  
    8585    { 
    8686      $values = $request->getParameter('sf_social_message'); 
    87       $sent = $this->form->bindAndSave($values); 
    88       $msg = $this->form->getObject(); 
    89       $msg->send($values['to']); 
    90       if ($sent) 
     87      if ($this->form->bindAndSave($values)) 
    9188      { 
     89        $msg = $this->form->getObject(); 
     90        $msg->send($values['to']); 
    9291        $this->dispatcher->notify(new sfEvent($msg, 'social.write_message')); 
    9392        $this->forward('sfSocialMessage', 'sent'); 
  • plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/templates/composeSuccess.php

    r19815 r19825  
    66<?php use_javascript('http://yui.yahooapis.com/2.7.0/build/autocomplete/autocomplete-min.js') ?> 
    77<?php use_javascript(url_for('@sf_social_message_js')) ?> 
     8<h2><?php echo __('Compose a new message') ?></h2> 
    89<form id="compose_message" action="<?php echo url_for('@sf_social_message_new') ?>" method="post"> 
    910  <ul id="form"> 
  • plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/templates/composejsSuccess.js.php

    r19815 r19825  
    2525    sfsmsg.toname = to.getAttribute('name'); 
    2626    // get possible selected values of field 
    27     var selected = to.options.selectedIndex > 0 ? to.options[to.options.selectedIndex] : null; 
     27    var selected = to.options.selectedIndex > -1 ? to.options[to.options.selectedIndex] : null; 
    2828    // create a container for autocomplete 
    2929    var div = document.createElement('div'); 
  • plugins/sfSocialPlugin/trunk/test/bootstrap/functional.php

    r19815 r19825  
    1717new sfDatabaseManager(ProjectConfiguration::getApplicationConfiguration('frontend', 'test', true)); 
    1818 
    19 $tables = array('contact', 'contact_group', 'contact_group_contact', 'event', 
     19$tables = array('sf_social' => array('contact', 'contact_group', 'contact_group_contact', 'event', 
    2020                'event_invite', 'event_user', 'group', 'group_invite', 'group_user', 
    21                 'message', 'message_rcpt', 'notify'); 
     21                'message', 'message_rcpt', 'notify'), 
     22                'sf_guard' => array('group', 'group_permission', 'permission', 
     23                'user', 'user_group', 'user_permission')); 
    2224$con = Propel::getConnection(); 
    23 foreach ($tables as $table) 
     25foreach ($tables as $plugin => $table) 
    2426{ 
    25   $stmt = $con->prepare('TRUNCATE TABLE sf_social_' . $table); 
    26   $stmt->execute(); 
     27  foreach ($table as $model) 
     28  { 
     29    $stmt = $con->prepare('TRUNCATE TABLE ' . $plugin . '_' . $model); 
     30    $stmt->execute(); 
     31  } 
    2732} 
    2833 
  • plugins/sfSocialPlugin/trunk/test/functional/sfSocialEventActionsTest.php

    r14577 r19825  
    22 
    33include dirname(__FILE__).'/../bootstrap/functional.php'; 
     4 
     5$browser = new loggedTest(new sfBrowser()); 
     6 
     7$browser-> 
     8 
     9  doLogin()-> 
     10 
     11  info('index (list)')-> 
     12  get('/events/')-> 
     13  with('request')->begin()-> 
     14    isParameter('module', 'sfSocialEvent')-> 
     15    isParameter('action', 'list')-> 
     16  end()-> 
     17  with('response')->begin()-> 
     18    isStatusCode(200)-> 
     19    checkElement('body h2', '/Events/')-> 
     20    // XXX this will work until 2012-12-21 :-) 
     21    checkElement('ul#list li', time() > strtotime('2009-09-09 10:00:00') ? 1 : 2)-> 
     22  end()-> 
     23 
     24  info('single event')-> 
     25  click('End of the world')-> 
     26    with('request')->begin()-> 
     27    isParameter('module', 'sfSocialEvent')-> 
     28    isParameter('action', 'view')-> 
     29  end()-> 
     30    with('response')->begin()-> 
     31    checkElement('body h2', '/Event "End of the world"/')-> 
     32  end()-> 
     33 
     34  info('confirm event')-> 
     35  click('confirm', array('sf_social_event_user' => array( 
     36    'confirm' => '2', 
     37  )))-> 
     38  with('form')->begin()->hasErrors(false)-> 
     39  end() 
     40; 
     41 
     42$browser->test()->is($browser->getResponseDom()->getElementById('sf_social_event_user_confirm_2')->getAttribute('checked'), 'checked', '"yes" is now checked'); 
     43 
     44$browser-> 
     45 
     46  info('invite friend')-> 
     47  click('invite', array('sf_social_event_invite' => array( 
     48    'user_id' => '5', 
     49  )))-> 
     50  with('form')->begin()->hasErrors(false)-> 
     51  end()-> 
     52    followRedirect()-> 
     53    with('response')->begin()-> 
     54    checkElement('ul#invited li', true)-> 
     55  end() 
     56 
     57; 
  • plugins/sfSocialPlugin/trunk/test/functional/sfSocialMessageActionsTest.php

    r19815 r19825  
    1111  info('index (list)')-> 
    1212  get('/messages/')-> 
    13  
    1413  with('request')->begin()-> 
    1514    isParameter('module', 'sfSocialMessage')-> 
    1615    isParameter('action', 'list')-> 
    1716  end()-> 
    18  
    1917  with('response')->begin()-> 
    2018    isStatusCode(200)-> 
    2119    checkElement('body h2', '/Messages received/')-> 
    22     checkElement('body ul li', 7)-> 
     20    checkElement('ul#list li', 5)-> 
     21    #checkElement('ul#list li[class*="unread"]', true, array('position' => 2))-> 
     22  end(); 
     23 
     24$browser->test()->is($browser->getResponseDom()->getElementsByTagName('li')->item(3)->getAttribute('class'), ' unread', 'message is unread'); 
     25 
     26$browser-> 
     27 
     28  info('click on a message')-> 
     29  click('hello pal')-> 
     30  with('request')->begin()-> 
     31    isParameter('module', 'sfSocialMessage')-> 
     32    isParameter('action', 'read')-> 
     33  end()-> 
     34  with('response')->begin()-> 
     35    checkElement('body h2', '/hello pal/')-> 
     36  end()-> 
     37  click('Back to list') 
     38
     39 
     40$browser->test()->is($browser->getResponseDom()->getElementsByTagName('li')->item(3)->getAttribute('class'), ' read', 'message is now read'); 
     41 
     42$browser-> 
     43 
     44  info('compose a new message')-> 
     45  click('Compose a new message')-> 
     46  with('request')->begin()-> 
     47    isParameter('module', 'sfSocialMessage')-> 
     48    isParameter('action', 'compose')-> 
     49  end()-> 
     50  with('response')->begin()-> 
     51    checkElement('body h2', '/Compose a new message/')-> 
     52  end()-> 
     53  click('send', array('sf_social_message' => array( 
     54    'subject' => '', 
     55    'text'    => '', 
     56    'to'      => array(), 
     57  )))-> 
     58  with('form')->begin()->hasErrors(3)-> 
     59    isError('subject', 'required')-> 
     60    isError('text', 'required')-> 
     61    isError('to', 'required')-> 
     62  end()-> 
     63  click('send', array('sf_social_message' => array( 
     64    'subject' => 'a message from functional test', 
     65    'text'    => 'TDD rulez! I found a lot of bugs doing these nice tests.', 
     66    'to'      => array(4, 10), 
     67  )))-> 
     68  # TODO! 
     69  #with('form')->begin()->hasErrors(false)-> 
     70  #with('form')->debug()-> 
     71 
     72  info('sent messages')-> 
     73  get('/messages/sent')-> 
     74  with('request')->begin()-> 
     75    isParameter('module', 'sfSocialMessage')-> 
     76    isParameter('action', 'sentlist')-> 
     77 
    2378  end() 
    2479; 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.