/[drupal]/contributions/modules/shoutbox/tests/shoutbox_user_access.test
ViewVC logotype

Diff of /contributions/modules/shoutbox/tests/shoutbox_user_access.test

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.2, Tue Jul 15 07:55:29 2008 UTC revision 1.1.4.3, Tue Jul 15 08:11:18 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2    
3  // $Id: shoutbox_user_access.test,v 1.1.2.1 2008/07/13 09:45:57 disterics Exp $  // $Id: shoutbox_user_access.test,v 1.1.4.2 2008/07/15 07:55:29 disterics Exp $
4    
5  /**  /**
6   * @file   * @file
# Line 108  class ShoutboxUserAccessTest extends Dru Line 108  class ShoutboxUserAccessTest extends Dru
108      // edit the shout      // edit the shout
109      $edited_shout = array();      $edited_shout = array();
110      $edited_shout['shout']  = $this->randomName(10, 'shout');      $edited_shout['shout']  = $this->randomName(10, 'shout');
111      $url = 'shoutbox/' . $sid . '/edit';      $url = 'shoutbox/'. $sid .'/edit';
112      $this->drupalPost($url, $edited_shout, 'Update');      $this->drupalPost($url, $edited_shout, 'Update');
113      $this->assertWantedRaw(t('Your shout has been saved.'));      $this->assertWantedRaw(t('Your shout has been saved.'));
114      $this->assertWantedRaw(t($edited_shout['shout']));      $this->assertWantedRaw(t($edited_shout['shout']));
115    
116      // delete the shout      // delete the shout
117      $url = 'shoutbox/' . $sid . '/delete';      $url = 'shoutbox/'. $sid .'/delete';
118      $this->drupalPost($url, NULL, 'Confirm');      $this->drupalPost($url, NULL, 'Confirm');
119      $this->assertWantedRaw(t('Your shout was deleted.'));      $this->assertWantedRaw(t('Your shout was deleted.'));
120      $this->assertNoText(t($edited_shout['shout']));      $this->assertNoText(t($edited_shout['shout']));
# Line 140  class ShoutboxUserAccessTest extends Dru Line 140  class ShoutboxUserAccessTest extends Dru
140      // edit the shout      // edit the shout
141      $edited_shout = array();      $edited_shout = array();
142      $edited_shout['shout']  = $this->randomName(10, 'shout');      $edited_shout['shout']  = $this->randomName(10, 'shout');
143      $url = 'shoutbox/' . $sid . '/edit';      $url = 'shoutbox/'. $sid .'/edit';
144      $this->drupalPost($url, $edited_shout, 'Update');      $this->drupalPost($url, $edited_shout, 'Update');
145      $this->assertWantedRaw(t('Your shout has been saved.'));      $this->assertWantedRaw(t('Your shout has been saved.'));
146      $this->assertWantedRaw(t($edited_shout['shout']));      $this->assertWantedRaw(t($edited_shout['shout']));
147    
148      // delete the shout      // delete the shout
149      $url = 'shoutbox/' . $sid . '/delete';      $url = 'shoutbox/'. $sid .'/delete';
150      $this->drupalPost($url, NULL, 'Confirm');      $this->drupalPost($url, NULL, 'Confirm');
151      $this->assertWantedRaw(t('Your shout was deleted.'));      $this->assertWantedRaw(t('Your shout was deleted.'));
152      $this->assertNoText(t($edited_shout['shout']));      $this->assertNoText(t($edited_shout['shout']));
# Line 173  class ShoutboxUserAccessTest extends Dru Line 173  class ShoutboxUserAccessTest extends Dru
173      // get the shout id      // get the shout id
174      $sid = $this->_get_shout_id($shout);      $sid = $this->_get_shout_id($shout);
175      // Try to moderate  it      // Try to moderate  it
176      $path = 'shoutbox/' . $sid . '/publish';      $path = 'shoutbox/'. $sid .'/publish';
177      $url = url($path, array('absolute' => TRUE));      $url = url($path, array('absolute' => TRUE));
178      $this->get($url);      $this->get($url);
179      $this->assertResponse(403);      $this->assertResponse(403);
# Line 184  class ShoutboxUserAccessTest extends Dru Line 184  class ShoutboxUserAccessTest extends Dru
184      // login as moderator      // login as moderator
185      $this->drupalLoginUser($this->moderator);      $this->drupalLoginUser($this->moderator);
186      // moderate content      // moderate content
187      $path = 'shoutbox/' . $sid . '/publish';      $path = 'shoutbox/'. $sid .'/publish';
188      $url = url($path, array('absolute' => TRUE));      $url = url($path, array('absolute' => TRUE));
189      // verify confirmation page      // verify confirmation page
190      $this->get($url);      $this->get($url);
# Line 193  class ShoutboxUserAccessTest extends Dru Line 193  class ShoutboxUserAccessTest extends Dru
193      $this->assertText(t('The shout was published.'));      $this->assertText(t('The shout was published.'));
194    
195      // now unpublish it      // now unpublish it
196      $path = 'shoutbox/' . $sid . '/unpublish';      $path = 'shoutbox/'. $sid .'/unpublish';
197      $url = url($path, array('absolute' => TRUE));      $url = url($path, array('absolute' => TRUE));
198      // verify confirmation page      // verify confirmation page
199      $this->get($url);      $this->get($url);
# Line 202  class ShoutboxUserAccessTest extends Dru Line 202  class ShoutboxUserAccessTest extends Dru
202      $this->assertText(t('The shout was unpublished.'));      $this->assertText(t('The shout was unpublished.'));
203    
204      // try and edit it      // try and edit it
205      $path = 'shoutbox/' . $sid . '/edit';      $path = 'shoutbox/'. $sid .'/edit';
206      $url = url($path, array('absolute' => TRUE));      $url = url($path, array('absolute' => TRUE));
207      $this->get($url);      $this->get($url);
208      $this->assertResponse(403);      $this->assertResponse(403);
209    
210      // try and delete it      // try and delete it
211      $path = 'shoutbox/' . $sid . '/delete';      $path = 'shoutbox/'. $sid .'/delete';
212      $url = url($path, array('absolute' => TRUE));      $url = url($path, array('absolute' => TRUE));
213      $this->get($url);      $this->get($url);
214      $this->assertResponse(403);      $this->assertResponse(403);

Legend:
Removed from v.1.1.4.2  
changed lines
  Added in v.1.1.4.3

  ViewVC Help
Powered by ViewVC 1.1.2