/[drupal]/contributions/modules/subuser/subuser.test
ViewVC logotype

Contents of /contributions/modules/subuser/subuser.test

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


Revision 1.1 - (show annotations) (download) (as text)
Wed Oct 14 03:17:09 2009 UTC (6 weeks, 1 day ago) by boombatower
Branch: MAIN
CVS Tags: DRUPAL-6--1-2, HEAD
Branch point for: DRUPAL-6--1
File MIME type: text/x-php
#572038: Create 'administer subusers' permission.
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Provide test of functionality.
7 *
8 * Copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218)
9 */
10
11 class SubuserTestCase extends DrupalWebTestCase {
12
13 /**
14 * Implementation of getInfo().
15 */
16 public static function getInfo() {
17 return array(
18 'name' => t('Subuser'),
19 'description' => t('...'),
20 'group' => t('Subuser'),
21 );
22 }
23
24 /**
25 * Implementation of setUp().
26 */
27 public function setUp() {
28 parent::setUp('views', 'subuser');
29 }
30
31 /**
32 * Confirm the various client management interfaces function properly.
33 */
34 public function testSubuser() {
35 // Create user that has the necessary PIFR permissions.
36 $user = $this->drupalCreateUser(array('pifr add project client', 'pifr add test client', 'pifr manage own client'));
37 $this->drupalLogin($user);
38
39 // Create a test client.
40 $client_id = $this->createClient($user->uid, PIFR_SERVER_CLIENT_TYPE_TEST);
41
42 // Attempt to set the test client URL to an invalid value.
43 $edit = array(
44 'url' => 'fail',
45 'type' => PIFR_SERVER_CLIENT_TYPE_PROJECT
46 );
47 $this->drupalPost("user/$user->uid/pifr/edit/$client_id", $edit, t('Save'));
48 $this->assertText(t('Client URL must end with a slash.'));
49
50 // Change the test client to a project client.
51 unset($edit['url']);
52 $this->drupalPost("user/$user->uid/pifr/edit/$client_id", $edit, t('Save'));
53 $this->assertText(t('Changes saved successfully.'));
54 }
55 }

  ViewVC Help
Powered by ViewVC 1.1.2