/[drupal]/contributions/sandbox/deekayen/modules/dpistudy/tests/admin.test
ViewVC logotype

Contents of /contributions/sandbox/deekayen/modules/dpistudy/tests/admin.test

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


Revision 1.3 - (show annotations) (download) (as text)
Wed Apr 16 05:42:50 2008 UTC (19 months, 1 week ago) by deekayen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +15 -6 lines
File MIME type: text/x-php
fixed missing countdown titles on instruction pages, figured out why hook_install() wasn't setting the results page text during install, moved the javascript timer around in the code, updated concat coder formatting to match new D7 standards, moved csv output to a new report screen, updated simpletests to match changes, customized an image I didn't end up getting copyright permission to reprint, and I think it might be ready to launch
1 <?php
2 // $Id$
3
4 class DPIStudyAdminTest extends DrupalTestCase {
5 function get_info() {
6 return array(
7 'name' => t('Administration'),
8 'desc' => t('Test the administrative stuff.'),
9 'group' => 'DPI Study'
10 );
11 }
12
13 function setUp() {
14 parent::setUp();
15
16 $this->drupalModuleEnable('dpistudy');
17
18 $permissions = array(
19 'access administration pages',
20 'administer site configuration'
21 );
22 $admin_user = $this->drupalCreateUserRolePerm($permissions);
23 $this->drupalLoginUser($admin_user);
24 }
25
26 function tearDown() {
27 parent::tearDown();
28 }
29
30 function testSettings() {
31
32 $url = url('admin/settings', array('absolute' => TRUE));
33 $this->get($url);
34 $this->assertText('Toggle features of the DPI questionnaire.');
35
36 $this->clickLink('DPI Study');
37
38 // should now be on the settings page
39 $this->assertLink('Settings');
40 $this->assertLink('Invite Keys');
41 $this->assertLink('Questionnaire');
42
43 $this->clickLink('Invite Keys');
44
45 $edit = array();
46 $edit['dpistudy_new_invite_key'] = 'simpletest';
47 $edit['dpistudy_new_invite_key_notes'] = 'This is a key created by the Simpletest module.';
48 $this->drupalPost('admin/settings/dpistudy/keys', $edit, t('Add key'));
49 $this->assertText('simpletest');
50 $this->assertText('This is a key created by the Simpletest module.');
51
52 $this->get(url('admin/settings/dpistudy/keys/delete/simpletest', array('absolute' => TRUE)));
53 $this->assertText(t('@key deleted.', array('@key' => 'simpletest')));
54
55 $this->clickLink('Questionnaire');
56 $this->clickLink('List questions');
57 $this->clickLink('Add question');
58
59 $this->get(url('admin/reports/status', array('absolute' => TRUE)));
60 $this->assertText('DPI Study responses');
61
62 $this->get(url('admin/reports/dpistudy', array('absolute' => TRUE)));
63 $this->assertLink('Visits');
64 $this->assertLink('Export');
65 $this->assertText('Invite Key');
66 $this->assertText('Visits');
67 $this->assertText('Invite link');
68
69 $this->get(url('admin/reports/dpistudy/export', array('absolute' => TRUE)));
70 $this->assertMime(array('application/vnd.ms-excel; charset=utf-8'));
71 $this->assertText('sessid,invite_key,key_notes,agent,referer,irb_php,irb_http,irb_js,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,q11,q12,q13,q14,q15,q16,q17,q18,q19,q20,q21,q22,q23,q24,q25,q26,q27,q28,q29,q30,q31,q32,q33,q34,q35,q36,q37,q38,q39,q40,q41,q42,q43,q44,q45,q46,dpi_php,dpi_http,dpi_js,q100,php_q100,http_q100,js_q100,q101,php_q101,http_q101,js_q101,q102,php_q102,http_q102,js_q102,q103,php_q103,http_q103,js_q103,q104,php_q104,http_q104,js_q104,q105,php_q105,http_q105,js_q105');
72
73 $this->get(url('logout', array('absolute' => TRUE)));
74 }
75 }

  ViewVC Help
Powered by ViewVC 1.1.2