Changeset 19825
- Timestamp:
- 07/02/09 16:29:35 (9 months ago)
- Files:
-
- plugins/sfSocialPlugin/trunk/config/schema.yml (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/data/fixtures/01_users.yml (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/data/fixtures/03_messages.yml (modified) (2 diffs)
- plugins/sfSocialPlugin/trunk/data/fixtures/05_events.yml (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/lib/form/sfSocialEventInviteForm.class.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/lib/form/sfSocialEventUserForm.class.php (modified) (3 diffs)
- plugins/sfSocialPlugin/trunk/lib/form/sfSocialMessageForm.class.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/lib/model/sfGuardUser.php (deleted)
- plugins/sfSocialPlugin/trunk/lib/model/sfSocialContactRequestPeer.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/lib/model/sfSocialEventInvite.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/lib/model/sfSocialEventUser.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/lib/model/sfSocialGuardUser.php (added)
- plugins/sfSocialPlugin/trunk/lib/user/sfSocialSecurityUser.class.php (modified) (9 diffs)
- plugins/sfSocialPlugin/trunk/modules/sfSocialContact/lib/BasesfSocialContactActions.class.php (modified) (2 diffs)
- plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/lib/BasesfSocialEventActions.class.php (modified) (3 diffs)
- plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/templates/listSuccess.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/templates/viewSuccess.php (modified) (2 diffs)
- plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/lib/BasesfSocialMessageActions.class.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/templates/composeSuccess.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/templates/composejsSuccess.js.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/test/bootstrap/functional.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/test/functional/sfSocialEventActionsTest.php (modified) (1 diff)
- plugins/sfSocialPlugin/trunk/test/functional/sfSocialMessageActionsTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfSocialPlugin/trunk/config/schema.yml
r15069 r19825 93 93 user_from: { type: integer, required: true, foreignTable: sf_guard_user, foreignReference: id, onDelete: cascade, onUpdate: cascade } 94 94 subject: { type: varchar, size: 255, required: true } 95 text: { type: longvarchar }95 text: { type: longvarchar, required: true } 96 96 created_at: ~ 97 97 plugins/sfSocialPlugin/trunk/data/fixtures/01_users.yml
r19815 r19825 36 36 username: tommy 37 37 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 25 25 text: who's afraid of big bad wolf, big bad wolf, big bad wolf. 26 26 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 27 32 28 33 sfSocialMessageRcpt: … … 50 55 msg_id: from_danny 51 56 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 16 16 location: Naples, Italy 17 17 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 18 34 19 35 sfSocialEventInvite: plugins/sfSocialPlugin/trunk/lib/form/sfSocialEventInviteForm.class.php
r14756 r19825 28 28 $this->setValidator('event_id', new sfValidatorChoice(array('choices' => array($eid)))); 29 29 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 } 30 104 } 31 105 plugins/sfSocialPlugin/trunk/lib/form/sfSocialEventUserForm.class.php
r14756 r19825 11 11 { 12 12 13 // choices for confirm14 private static $choices = array(1 => 'maybe', 2 => 'yes', 3 => 'no');15 16 13 public function configure() 17 14 { … … 21 18 // make confirm a choice 22 19 $this->widgetSchema['confirm'] = new sfWidgetFormChoice(array( 23 'choices' => s elf::$choices,20 'choices' => sfSocialEventUser::$choices, 24 21 'expanded' => true, 25 22 )); … … 37 34 $this->setValidator('event_id', new sfValidatorChoice(array('choices' => array($eid)))); 38 35 } 39 36 40 37 } plugins/sfSocialPlugin/trunk/lib/form/sfSocialMessageForm.class.php
r19815 r19825 36 36 ); 37 37 $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 40 42 } 41 43 } plugins/sfSocialPlugin/trunk/lib/model/sfSocialContactRequestPeer.php
r14765 r19825 11 11 * @return sfPropelPager 12 12 */ 13 public static function getReceive Requests(sfGuardUser $user, $page = 1, $n = 10)13 public static function getReceivedRequests(sfGuardUser $user, $page = 1, $n = 10) 14 14 { 15 15 $c = new Criteria(); plugins/sfSocialPlugin/trunk/lib/model/sfSocialEventInvite.php
r14545 r19825 3 3 class sfSocialEventInvite extends BasesfSocialEventInvite 4 4 { 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 5 22 } plugins/sfSocialPlugin/trunk/lib/model/sfSocialEventUser.php
r14545 r19825 3 3 class sfSocialEventUser extends BasesfSocialEventUser 4 4 { 5 6 // possible replies to invite 7 public static $choices = array(1 => 'maybe', 2 => 'yes', 3 => 'no'); 8 9 5 10 } plugins/sfSocialPlugin/trunk/lib/user/sfSocialSecurityUser.class.php
r15550 r19825 19 19 /** 20 20 * Check is user is friend 21 * 21 * 22 22 * @param sfGuardUser $user 23 * @return boolean 23 * @return boolean 24 24 * @access public 25 25 */ … … 28 28 return $this->getGuardUser() ? $this->getGuardUser()->hasContact($user) : false; 29 29 } 30 30 31 31 /** 32 * Get array with list of contacts 33 * 32 * Get array with list of contacts 33 * 34 34 * @param int $limit 35 * @return array 35 * @return array 36 36 * @access public 37 37 */ … … 43 43 /** 44 44 * Adding a contact 45 * 45 * 46 46 * @param sfGuardUser $user 47 * @return booelan 47 * @return booelan 48 48 * @access public 49 49 */ 50 50 public function addContact($user) 51 51 { 52 #var_dump($user); 53 #var_dump(($this->getGuardUser()));die; 52 54 return $this->getGuardUser()->addContact($user); 53 55 } 54 56 55 57 /** 56 58 * Accept request from a contact 57 * 59 * 58 60 * @param sfGuardUser $user 59 61 * @param string $message 60 * @return booelan 62 * @return booelan 61 63 * @access public 62 64 */ … … 65 67 return $this->getGuardUser()->sendRequestContact($user, $message); 66 68 } 67 69 68 70 /** 69 71 * Accept request from a contact 70 * 72 * 71 73 * @param user $user 72 * @return booelan 74 * @return booelan 73 75 * @access public 74 76 */ … … 80 82 /** 81 83 * Deny request from a contact 82 * 84 * 83 85 * @param user $user 84 * @return booelan 86 * @return booelan 85 87 * @access public 86 88 */ … … 89 91 return $this->getGuardUser()->denyRequestContact($user); 90 92 } 91 93 92 94 /** 93 95 * Remove contact 94 * 96 * 95 97 * @param user $user 96 * @return boolean 98 * @return boolean 97 99 * @access public 98 100 */ … … 101 103 return $this->getGuardUser()->removeContact($user); 102 104 } 103 105 104 106 /** 105 107 * Adding a contact from username 106 * 108 * 107 109 * @param string $username 108 * @return booelan 110 * @return booelan 109 111 * @access public 110 112 */ … … 113 115 return $this->getGuardUser()->addContactByUsername($username); 114 116 } 115 117 116 118 /** 117 119 * Remove contact from username 118 * 120 * 119 121 * @param string $username 120 * @return boolean 122 * @return boolean 121 123 * @access public 122 124 */ … … 125 127 return $this->getGuardUser()->removeContactByUsername($username); 126 128 } 127 129 128 130 /** 129 131 * Remove all contatcs from username 130 * 132 * 131 133 * @param null 132 * @return boolean 134 * @return boolean 133 135 * @access public 134 136 */ plugins/sfSocialPlugin/trunk/modules/sfSocialContact/lib/BasesfSocialContactActions.class.php
r15649 r19825 17 17 public function executeList(sfWebRequest $request) 18 18 { 19 //myUser::addContact();20 19 $page = $request->getParameter('page'); 21 20 $this->pager = sfSocialContactPeer::getContacts($this->getUser()->getGuardUser(), $page); … … 43 42 { 44 43 $page = $request->getParameter('page'); 45 $this->pager = sfSocialContactRequestPeer::getReceive Requests($this->getUser()->getGuardUser(), $page);44 $this->pager = sfSocialContactRequestPeer::getReceivedRequests($this->getUser()->getGuardUser(), $page); 46 45 } 47 46 plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/lib/BasesfSocialEventActions.class.php
r15069 r19825 51 51 $this->event = sfSocialEventPeer::retrieveByPK($id); 52 52 $this->forward404Unless($this->event, 'event not found'); 53 54 53 // confirm form 55 54 $this->getContext()->set('Event', $this->event); … … 60 59 $this->form->bindAndSave($request->getParameter($this->form->getName())); 61 60 } 62 63 61 // invite form 64 62 $this->isAdmin = $this->event->getSfGuardUser()->getId() == $this->getUser()->getGuardUser()->getId(); … … 130 128 $this->form = new sfSocialEventInviteForm(); 131 129 $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()); 133 135 } 134 136 plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/templates/listSuccess.php
r15225 r19825 3 3 <?php else: ?> 4 4 <h2><?php echo __('Events') ?></h2> 5 <ul >5 <ul id="list"> 6 6 <?php foreach ($pager->getResults() as $event): ?> 7 <li >7 <li class="<?php $bRow = empty($bRow) ? print('a') : false ?>"> 8 8 <?php echo link_to($event->getTitle(), '@sf_social_event?id=' . $event->getId()) ?> 9 9 <?php echo $event->getWhen() ?> plugins/sfSocialPlugin/trunk/modules/sfSocialEvent/templates/viewSuccess.php
r15225 r19825 1 1 <h2><?php echo __('Event') ?> "<?php echo $event->getTitle() ?>"</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 ?> 2 8 3 9 <h3><?php echo __('When') ?>: <?php echo $event->getWhen() ?></h3> … … 7 13 </div> 8 14 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 9 21 <div id="event_confirm"> 10 22 <form action="<?php echo url_for('@sf_social_event?id=' . $event->getId()) ?>" method="post"> 11 < table>23 <ul id="form"> 12 24 <?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> 19 29 </form> 20 30 </div> 21 31 22 32 <?php if ($isAdmin): ?> 23 <?php echo link_to(__('Edit event'), '@sf_social_event_edit?id=' . $event->getId()) ?>24 33 <h3><?php echo __('Invite:') ?></h3> 25 34 <div id="event_invite"> 26 35 <form action="<?php echo url_for('@sf_social_event_invite?id=' . $event->getId()) ?>" method="post"> 27 < table>36 <ul id="form"> 28 37 <?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> 35 42 </form> 36 43 </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> 37 58 <?php endif ?> 38 59 plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/lib/BasesfSocialMessageActions.class.php
r15649 r19825 85 85 { 86 86 $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)) 91 88 { 89 $msg = $this->form->getObject(); 90 $msg->send($values['to']); 92 91 $this->dispatcher->notify(new sfEvent($msg, 'social.write_message')); 93 92 $this->forward('sfSocialMessage', 'sent'); plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/templates/composeSuccess.php
r19815 r19825 6 6 <?php use_javascript('http://yui.yahooapis.com/2.7.0/build/autocomplete/autocomplete-min.js') ?> 7 7 <?php use_javascript(url_for('@sf_social_message_js')) ?> 8 <h2><?php echo __('Compose a new message') ?></h2> 8 9 <form id="compose_message" action="<?php echo url_for('@sf_social_message_new') ?>" method="post"> 9 10 <ul id="form"> plugins/sfSocialPlugin/trunk/modules/sfSocialMessage/templates/composejsSuccess.js.php
r19815 r19825 25 25 sfsmsg.toname = to.getAttribute('name'); 26 26 // 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; 28 28 // create a container for autocomplete 29 29 var div = document.createElement('div'); plugins/sfSocialPlugin/trunk/test/bootstrap/functional.php
r19815 r19825 17 17 new sfDatabaseManager(ProjectConfiguration::getApplicationConfiguration('frontend', 'test', true)); 18 18 19 $tables = array(' contact', 'contact_group', 'contact_group_contact', 'event',19 $tables = array('sf_social' => array('contact', 'contact_group', 'contact_group_contact', 'event', 20 20 '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')); 22 24 $con = Propel::getConnection(); 23 foreach ($tables as $ table)25 foreach ($tables as $plugin => $table) 24 26 { 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 } 27 32 } 28 33 plugins/sfSocialPlugin/trunk/test/functional/sfSocialEventActionsTest.php
r14577 r19825 2 2 3 3 include 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 11 11 info('index (list)')-> 12 12 get('/messages/')-> 13 14 13 with('request')->begin()-> 15 14 isParameter('module', 'sfSocialMessage')-> 16 15 isParameter('action', 'list')-> 17 16 end()-> 18 19 17 with('response')->begin()-> 20 18 isStatusCode(200)-> 21 19 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 23 78 end() 24 79 ;

