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

Contents of /contributions/modules/tracker2/tracker2.test

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


Revision 1.1 - (show annotations) (download) (as text)
Mon Jan 12 22:09:35 2009 UTC (10 months, 2 weeks ago) by toddnienkerk
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA1, HEAD
Branch point for: DRUPAL-6--1
File MIME type: text/x-php
applied trackerport4.patch [294091]
1 <?php
2 // $Id$
3
4 class Tracker2TestCase extends DrupalWebTestCase {
5 function getInfo() {
6 return array(
7 'name' => t('Tracker 2'),
8 'description' => t('tests the tracker2 module'),
9 'group' => t('tracker2'),
10 );
11 }
12
13 function setUp() {
14 parent::setUp('tracker2');
15 }
16
17 function testTracker2TrackUser() {
18 $base = 'tracker2';
19 $user_base = 'track2';
20 if (!module_exists('tracker')) {
21 $base = 'tracker';
22 $user_base = 'track';
23 }
24
25 // call tracker2_track_user -> there is not arg(1)
26 $this->drupalGet('user');
27 tracker2_track_user();
28 $this->assertResponse(404, t('take sure that the function returns 404, if there is no arg(1)'));
29
30 // create user
31 $web_user_1 = $this->drupalCreateUser();
32 $web_user_2 = $this->drupalCreateUser();
33 $web_user_1->status = 0;
34 user_save($web_user_1);
35 $admin_user = $this->drupalCreateUser(array('administer users'));
36
37 $this->drupalLogin($web_user_2);
38 $this->drupalGet('user/'. $web_user_1->uid .'/'. $user_base);
39 $this->assertResponse(403, t('take sure that it is pot possible to look at users with status 0 for normal users'));
40
41 $this->drupalLogin($admin_user);
42 $this->drupalGet('user/'. $web_user_1->uid .'/'. $user_base);
43 $this->assertTitle(check_plain($web_user_1->name), t('take sure that the title is set right'));
44 }
45 }

  ViewVC Help
Powered by ViewVC 1.1.2