updated print
This commit is contained in:
@@ -2,21 +2,24 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* print module simpletest tests
|
||||
* Print module simpletest tests.
|
||||
*
|
||||
* This file includes the defined tests for the print module.
|
||||
*
|
||||
* @ingroup print
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class PrintBasicTest.
|
||||
*/
|
||||
class PrintBasicTest extends DrupalWebTestCase {
|
||||
protected $web_user;
|
||||
protected $webUser;
|
||||
protected $getq;
|
||||
|
||||
/**
|
||||
* Implementation of getInfo().
|
||||
*/
|
||||
function getInfo() {
|
||||
public function getInfo() {
|
||||
return array(
|
||||
'name' => t('Printer, email and PDF versions tests'),
|
||||
'description' => t('Unit tests for the print, print_mail and print_pdf modules.'),
|
||||
@@ -27,14 +30,16 @@ class PrintBasicTest extends DrupalWebTestCase {
|
||||
/**
|
||||
* Implementation of setUp().
|
||||
*/
|
||||
function setUp() {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// User to set up print.
|
||||
// $this->web_user = $this->drupalCreateUserRolePerm(array('administer print'));
|
||||
/*
|
||||
$this->webUser = $this->drupalCreateUserRolePerm(array('administer print'));
|
||||
|
||||
// $this->drupalGet('logout');
|
||||
// $this->drupalLoginUser($this->web_user);
|
||||
$this->drupalGet('logout');
|
||||
$this->drupalLoginUser($this->webUser);
|
||||
*/
|
||||
|
||||
$this->getq = $_GET['q'];
|
||||
$_GET['q'] = 'print/' . $_GET['q'];
|
||||
@@ -43,16 +48,20 @@ class PrintBasicTest extends DrupalWebTestCase {
|
||||
/**
|
||||
* Implementation of tearDown().
|
||||
*/
|
||||
function tearDown() {
|
||||
public function tearDown() {
|
||||
$_GET['q'] = $this->getq;
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
function testPrintRewriteUrls() {
|
||||
/**
|
||||
* Test rewrite of URLs.
|
||||
*/
|
||||
public function testPrintRewriteUrls() {
|
||||
global $base_url, $base_root, $_print_urls;
|
||||
|
||||
// Must require it, since this function gets called via Drupal's dynamic loading
|
||||
// Must require it, since this function gets called via Drupal's dynamic
|
||||
// loading.
|
||||
module_load_include('inc', 'print', 'print.pages');
|
||||
|
||||
variable_set('print_urls_anchors', 1);
|
||||
@@ -110,4 +119,5 @@ class PrintBasicTest extends DrupalWebTestCase {
|
||||
$this->assertEqual($urls[0], $abs_url[$i], t('Absolute URL (!url)', array('!url' => $abs_url[$i])));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user