Skip to content

Commit

Permalink
August 16, 2009. Commit #251804 by webchick at 12:37
Browse files Browse the repository at this point in the history
  • Loading branch information
bangpound committed Aug 16, 2009
1 parent 8bf1425 commit ff6d0d0
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 52 deletions.
12 changes: 8 additions & 4 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ DirectoryIndex index.php index.html index.htm
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
<Files index.php>
# Caching headers for dynamically generated pages are set from PHP.
<FilesMatch \.php$>
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
</Files>
</FilesMatch>
</IfModule>
# Various rewrite rules.
Expand Down Expand Up @@ -91,4 +95,4 @@ DirectoryIndex index.php index.html index.htm
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id: .htaccess,v 1.103 2009/06/21 10:48:06 dries Exp $
# $Id: .htaccess,v 1.104 2009/08/16 12:10:36 dries Exp $
2 changes: 1 addition & 1 deletion CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ D/profiles////
D/scripts////
D/sites////
D/themes////
/.htaccess/1.103/Sun Jun 21 18:46:09 2009//
/COPYRIGHT.txt/1.4/Fri Jun 12 07:15:24 2009//
/INSTALL.mysql.txt/1.11/Fri Jun 12 07:15:24 2009//
/INSTALL.pgsql.txt/1.8/Fri Aug 7 05:58:20 2009//
Expand All @@ -21,3 +20,4 @@ D/themes////
/UPGRADE.txt/1.15/Fri Aug 14 05:08:40 2009//
/install.php/1.192/Fri Aug 14 05:08:40 2009//
/update.php/1.296/Fri Aug 14 05:08:40 2009//
/.htaccess/1.104/Sun Aug 16 17:51:57 2009//
2 changes: 1 addition & 1 deletion includes/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ D/filetransfer////
/module.inc/1.152/Fri Aug 14 05:08:40 2009//
/pager.inc/1.69/Fri Aug 14 05:08:40 2009//
/theme.inc/1.504/Fri Aug 14 05:08:40 2009//
/common.inc/1.961/Sat Aug 15 19:29:13 2009//
/common.inc/1.961/Sat Aug 15 19:33:18 2009//
2 changes: 1 addition & 1 deletion modules/block/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
/block.tpl.php/1.3/Sat Jun 13 03:10:31 2009//
/block.admin.inc/1.48/Fri Aug 14 05:08:40 2009//
/block.api.php/1.5/Fri Aug 14 05:08:40 2009//
/block.module/1.359/Sat Aug 15 19:29:14 2009//
/block.module/1.359/Sat Aug 15 19:33:18 2009//
D
6 changes: 3 additions & 3 deletions modules/filter/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/filter.install/1.16/Sat Jun 13 03:11:08 2009//
/filter.pages.inc/1.7/Fri Jun 12 07:15:25 2009//
/filter.api.php/1.9/Fri Aug 14 05:08:40 2009//
/filter.admin.inc/1.32/Sat Aug 15 19:29:14 2009//
/filter.module/1.269/Sat Aug 15 19:29:14 2009//
/filter.test/1.30/Sat Aug 15 19:29:14 2009//
/filter.admin.inc/1.32/Sat Aug 15 19:33:19 2009//
/filter.module/1.269/Sat Aug 15 19:33:19 2009//
/filter.test/1.30/Sat Aug 15 19:33:19 2009//
D
2 changes: 1 addition & 1 deletion modules/help/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/help.api.php/1.5/Fri Aug 7 05:58:21 2009//
/help.css/1.2/Fri Jun 12 07:15:25 2009//
/help.info/1.8/Sat Jun 13 03:11:11 2009//
/help.test/1.11/Fri Aug 7 05:58:21 2009//
/help.module/1.87/Fri Aug 14 05:08:40 2009//
/help.test/1.12/Sun Aug 16 17:51:57 2009//
D
49 changes: 26 additions & 23 deletions modules/help/help.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: help.test,v 1.11 2009/07/31 19:59:20 dries Exp $
// $Id: help.test,v 1.12 2009/08/15 20:07:24 webchick Exp $

class HelpTestCase extends DrupalWebTestCase {
protected $big_user;
Expand All @@ -17,15 +17,12 @@ class HelpTestCase extends DrupalWebTestCase {
* Enable modules and create users with specific permissions.
*/
function setUp() {
parent::setUp();
parent::setUp('blog', 'poll');

// Loading these (and other?) modules will result in failures?
// $this->drupalModuleEnable('blog');
// $this->drupalModuleEnable('poll');
$this->getModuleList();

// Create users.
$this->big_user = $this->drupalCreateUser(array('access administration pages')); // 'administer blocks', 'administer site configuration',
$this->big_user = $this->drupalCreateUser(array('access administration pages'));
$this->any_user = $this->drupalCreateUser(array());
}

Expand All @@ -40,6 +37,22 @@ class HelpTestCase extends DrupalWebTestCase {
// Login the regular user.
$this->drupalLogin($this->any_user);
$this->verifyHelp(403);

// Check for css on admin/help.
$this->drupalLogin($this->big_user);
$this->drupalGet('admin/help');
$this->assertRaw(drupal_get_path('module', 'help') . '/help.css', t('The help.css file is present in the HTML.'));

// Verify that introductory help text exists, goes for 100% module coverage.
$this->assertRaw(t('For more information, please refer to the specific topics listed in the next section, or the <a href="@drupal">online Drupal handbooks</a>.', array('@drupal' => 'http://drupal.org/handbooks')), 'Help intro text correctly appears.');

// Verify that help topics text appears.
$this->assertRaw('<h2>' . t('Help topics') . '</h2><p>' . t('Help is available on the following items:') . '</p>', t('Help topics text correctly appears.'));

// Make sure links are properly added for modules implementing hook_help().
foreach ($this->modules as $module => $name) {
$this->assertLink($name, 0, t('Link properly added to @name (admin/help/@module)', array('@module' => $module, '@name' => $name)));
}
}

/**
Expand All @@ -48,42 +61,32 @@ class HelpTestCase extends DrupalWebTestCase {
* @param integer $response HTTP response code.
*/
private function verifyHelp($response = 200) {
$crumb = '›';

foreach ($this->modules as $module => $name) {
// View module help node.
$this->drupalGet('admin/help/' . $module);
$this->assertResponse($response);
if (drupal_function_exists($module . '_help')) {
// View module help node.
$this->drupalGet('admin/help/' . $module);
$this->assertResponse($response);
if ($response == 200) {
// NOTE: The asserts fail on blog and poll because the get returns the 'admin/help' node instead of the indicated node???
// if ($module == 'blog' || $module == 'poll') {
// continue;
// }
$this->assertTitle($name . ' | Drupal', t('[' . $module . '] Title was displayed'));
}
}
if ($response == 200) {
$this->assertTitle($name . ' | Drupal', t('[' . $module . '] Title was displayed'));
$this->assertRaw('<h1 class="page-title">' . t($name) . '</h1>', t('[' . $module . '] Heading was displayed'));
}
}
}

/**
* Get list of enabled modules.
* Get list of enabled modules that implement hook_help().
*
* @return array Enabled modules.
*/
private function getModuleList() {
$this->modules = array();
$result = db_query("SELECT name, filename, info FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC");
foreach ($result as $module) {
if (file_exists($module->filename)) {
if (file_exists($module->filename) && drupal_function_exists($module->name . '_help')) {
$fullname = unserialize($module->info);
$this->modules[$module->name] = $fullname['name'];
}
}
}
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion modules/node/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ D/tests////
/node.test/1.38/Tue Jul 28 19:18:06 2009//
/node.tpl.php/1.19/Thu Aug 6 05:05:59 2009//
/node.module/1.1099/Fri Aug 14 17:52:22 2009//
/node.pages.inc/1.73/Fri Aug 14 17:56:49 2009//
/node.pages.inc/1.73/Sun Aug 16 17:50:50 2009//
2 changes: 1 addition & 1 deletion modules/path/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
/path.info/1.8/Sat Jun 13 03:11:24 2009//
/path.js/1.2/Fri Jun 12 07:15:26 2009//
/path.test/1.17/Fri Aug 14 05:08:40 2009//
/path.module/1.164/Sat Aug 15 19:29:15 2009//
/path.module/1.164/Sat Aug 15 19:33:19 2009//
D
8 changes: 4 additions & 4 deletions modules/simpletest/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ D/tests////
/simpletest.info/1.7/Fri Jul 3 03:59:26 2009//
/simpletest.install/1.25/Fri Aug 7 05:58:21 2009//
/simpletest.js/1.11/Fri Jun 12 07:15:26 2009//
/drupal_web_test_case.php/1.136/Sat Aug 15 19:29:15 2009//
/simpletest.module/1.66/Sat Aug 15 19:29:15 2009//
/simpletest.pages.inc/1.14/Sat Aug 15 19:29:16 2009//
/simpletest.test/1.29/Sat Aug 15 19:29:16 2009//
/drupal_web_test_case.php/1.136/Sat Aug 15 19:33:20 2009//
/simpletest.module/1.66/Sat Aug 15 19:33:20 2009//
/simpletest.pages.inc/1.14/Sat Aug 15 19:33:20 2009//
/simpletest.test/1.29/Sat Aug 15 19:33:20 2009//
6 changes: 3 additions & 3 deletions modules/simpletest/tests/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/xmlrpc_test.module/1.4/Sat Jun 13 03:11:42 2009//
/field_test.module/1.14/Fri Aug 14 05:08:40 2009//
/theme.test/1.5/Fri Aug 14 05:08:40 2009//
/common.test/1.61/Sat Aug 15 19:29:16 2009//
/error.test/1.5/Sat Aug 15 19:29:16 2009//
/error_test.module/1.4/Sat Aug 15 19:29:16 2009//
/common.test/1.63/Sun Aug 16 17:51:57 2009//
/error.test/1.5/Sat Aug 15 19:33:20 2009//
/error_test.module/1.4/Sat Aug 15 19:33:20 2009//
D
36 changes: 35 additions & 1 deletion modules/simpletest/tests/common.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: common.test,v 1.61 2009/08/15 06:30:38 webchick Exp $
// $Id: common.test,v 1.63 2009/08/16 17:37:06 webchick Exp $

/**
* Tests for the l() function.
Expand Down Expand Up @@ -34,6 +34,40 @@ class CommonLUnitTest extends DrupalUnitTestCase {
$this->assertEqual(drupal_query_string_encode(array('a' => '1', 'b' => '2', 'c' => '3'), array('b')), 'a=1&c=3', t('Value was properly excluded.'));
$this->assertEqual(drupal_query_string_encode(array('a' => array('b' => '2', 'c' => '3')), array('b', 'a[c]')), 'a[b]=2', t('Nested array was properly encoded.'));
}

/**
* Test url() with/without query, with/without fragment, absolute on/off and
* assert all that works when clean URLs are on and off.
*/
function testUrl() {
global $base_url;

foreach (array(FALSE, TRUE) as $absolute) {
// Get the expected start of the path string.
$base = $absolute ? $base_url . '/' : base_path();
$absolute_string = $absolute ? 'absolute' : NULL;

// Run tests with clean urls disabled.
$GLOBALS['conf']['clean_url'] = 0;
$clean_urls = 'disabled';

$this->assertTrue(url('node', array('absolute' => $absolute)) == $base . '?q=node', t('Creation of @absolute internal url with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
$this->assertTrue(url('node', array('fragment' => 'foo', 'absolute' => $absolute)) == $base . '?q=node#foo', t('Creation of @absolute internal url with fragment option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
$this->assertTrue(url('node', array('query' => 'foo', 'absolute' => $absolute)) == $base . '?q=node&foo', t('Creation of @absolute internal url with query option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
$this->assertTrue(url('node', array('query' => 'foo', 'fragment' => 'bar', 'absolute' => $absolute)) == $base . '?q=node&foo#bar', t('Creation of @absolute internal url with query and fragment option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
$this->assertTrue(url('<front>', array('absolute' => $absolute)) == $base, t('Creation of @absolute internal url using front with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));

// Run tests again with clean urls enabled.
$GLOBALS['conf']['clean_url'] = 1;
$clean_urls = 'enabled';

$this->assertTrue(url('node', array('absolute' => $absolute)) == $base . 'node', t('Creation of @absolute internal url with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
$this->assertTrue(url('node', array('fragment' => 'foo', 'absolute' => $absolute)) == $base . 'node#foo', t('Creation of @absolute internal url with fragment option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
$this->assertTrue(url('node', array('query' => 'foo', 'absolute' => $absolute)) == $base . 'node?foo', t('Creation of @absolute internal url with query option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
$this->assertTrue(url('node', array('query' => 'foo', 'fragment' => 'bar', 'absolute' => $absolute)) == $base . 'node?foo#bar', t('Creation of @absolute internal url with query and fragment option with clean urls @clean_urls.', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
$this->assertTrue(url('<front>', array('absolute' => $absolute)) == $base, t('Creation of @absolute internal url using front with clean urls @clean_urls', array('@absolute' => $absolute_string, '@clean_urls' => $clean_urls)));
}
}
}

class CommonSizeTestCase extends DrupalUnitTestCase {
Expand Down
4 changes: 2 additions & 2 deletions modules/system/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/system.install/1.367/Fri Aug 14 05:08:40 2009//
/system.js/1.30/Fri Aug 14 05:08:40 2009//
/system.test/1.63/Fri Aug 14 05:08:40 2009//
/system.admin.inc/1.176/Sat Aug 15 19:29:16 2009//
/system.module/1.748/Sat Aug 15 19:29:17 2009//
/system.admin.inc/1.177/Sun Aug 16 17:51:57 2009//
/system.module/1.748/Sat Aug 15 19:33:21 2009//
D
5 changes: 1 addition & 4 deletions modules/system/system.admin.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: system.admin.inc,v 1.176 2009/08/15 06:27:49 webchick Exp $
// $Id: system.admin.inc,v 1.177 2009/08/16 11:31:27 dries Exp $

/**
* @file
Expand Down Expand Up @@ -1940,9 +1940,6 @@ function theme_admin_block($block) {
$block[title]
</h3>
<div class="body">
<p class="description">
$block[description]
</p>
$block[content]
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions modules/taxonomy/CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
/taxonomy.js/1.6/Fri Jun 12 07:15:26 2009//
/taxonomy.test/1.43/Fri Aug 7 05:58:22 2009//
/vocabulary.js/1.1/Fri Jun 12 19:29:04 2009//
/taxonomy.module/1.495/Fri Aug 14 17:56:49 2009//
/taxonomy.pages.inc/1.31/Fri Aug 14 17:56:49 2009//
/taxonomy.module/1.495/Sun Aug 16 17:50:50 2009//
/taxonomy.pages.inc/1.31/Sun Aug 16 17:50:50 2009//
D

0 comments on commit ff6d0d0

Please sign in to comment.