Revision 76bdcd04
Added by Assos Assos almost 6 years ago
drupal7/sites/all/modules/print/tests/print_basic.test | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* print module simpletest tests
|
|
5 |
* Print module simpletest tests.
|
|
6 | 6 |
* |
7 | 7 |
* This file includes the defined tests for the print module. |
8 | 8 |
* |
9 | 9 |
* @ingroup print |
10 | 10 |
*/ |
11 | 11 |
|
12 |
/** |
|
13 |
* Class PrintBasicTest. |
|
14 |
*/ |
|
12 | 15 |
class PrintBasicTest extends DrupalWebTestCase { |
13 |
protected $web_user;
|
|
16 |
protected $webUser;
|
|
14 | 17 |
protected $getq; |
15 | 18 |
|
16 | 19 |
/** |
17 | 20 |
* Implementation of getInfo(). |
18 | 21 |
*/ |
19 |
function getInfo() { |
|
22 |
public function getInfo() {
|
|
20 | 23 |
return array( |
21 | 24 |
'name' => t('Printer, email and PDF versions tests'), |
22 | 25 |
'description' => t('Unit tests for the print, print_mail and print_pdf modules.'), |
... | ... | |
27 | 30 |
/** |
28 | 31 |
* Implementation of setUp(). |
29 | 32 |
*/ |
30 |
function setUp() { |
|
33 |
public function setUp() {
|
|
31 | 34 |
parent::setUp(); |
32 | 35 |
|
33 | 36 |
// User to set up print. |
34 |
// $this->web_user = $this->drupalCreateUserRolePerm(array('administer print')); |
|
37 |
/* |
|
38 |
$this->webUser = $this->drupalCreateUserRolePerm(array('administer print')); |
|
35 | 39 |
|
36 |
// $this->drupalGet('logout'); |
|
37 |
// $this->drupalLoginUser($this->web_user); |
|
40 |
$this->drupalGet('logout'); |
|
41 |
$this->drupalLoginUser($this->webUser); |
|
42 |
*/ |
|
38 | 43 |
|
39 | 44 |
$this->getq = $_GET['q']; |
40 | 45 |
$_GET['q'] = 'print/' . $_GET['q']; |
... | ... | |
43 | 48 |
/** |
44 | 49 |
* Implementation of tearDown(). |
45 | 50 |
*/ |
46 |
function tearDown() { |
|
51 |
public function tearDown() {
|
|
47 | 52 |
$_GET['q'] = $this->getq; |
48 | 53 |
|
49 | 54 |
parent::tearDown(); |
50 | 55 |
} |
51 | 56 |
|
52 |
function testPrintRewriteUrls() { |
|
57 |
/** |
|
58 |
* Test rewrite of URLs. |
|
59 |
*/ |
|
60 |
public function testPrintRewriteUrls() { |
|
53 | 61 |
global $base_url, $base_root, $_print_urls; |
54 | 62 |
|
55 |
// Must require it, since this function gets called via Drupal's dynamic loading |
|
56 |
require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'print') . '/print.pages.inc'); |
|
63 |
// Must require it, since this function gets called via Drupal's dynamic |
|
64 |
// loading. |
|
65 |
module_load_include('inc', 'print', 'print.pages'); |
|
57 | 66 |
|
58 | 67 |
variable_set('print_urls_anchors', 1); |
59 | 68 |
|
... | ... | |
110 | 119 |
$this->assertEqual($urls[0], $abs_url[$i], t('Absolute URL (!url)', array('!url' => $abs_url[$i]))); |
111 | 120 |
} |
112 | 121 |
} |
122 |
|
|
113 | 123 |
} |
Also available in: Unified diff
Weekly update of contrib modules