update to drupal 7.23

This commit is contained in:
Bachir Soussi Chiadmi
2013-09-24 09:05:59 +02:00
parent db5f70501a
commit e539e701f8
247 changed files with 4921 additions and 4058 deletions

View File

@@ -55,8 +55,8 @@ files[] = tests/upgrade/update.trigger.test
files[] = tests/upgrade/update.field.test
files[] = tests/upgrade/update.user.test
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -63,7 +63,7 @@ function simpletest_requirements($phase) {
// Check the current memory limit. If it is set too low, SimpleTest will fail
// to load all tests and throw a fatal error.
$memory_limit = ini_get('memory_limit');
if ($memory_limit && $memory_limit != -1 && parse_size($memory_limit) < parse_size(SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT)) {
if (!drupal_check_memory_limit(SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, $memory_limit)) {
$requirements['php_memory_limit']['severity'] = REQUIREMENT_ERROR;
$requirements['php_memory_limit']['description'] = $t('The testing framework requires the PHP memory limit to be at least %memory_minimum_limit. The current value is %memory_limit. <a href="@url">Follow these steps to continue</a>.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/node/207036'));
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -524,7 +524,7 @@ class AJAXElementValidation extends AJAXTestCase {
// Post with 'drivertext' as the triggering element.
$post_result = $this->drupalPostAJAX('ajax_validation_test', $edit, 'drivertext');
// Look for a validation failure in the resultant JSON.
$this->assertNoText(t('Error message'), t("No error message in resultant JSON"));
$this->assertText('ajax_forms_test_validation_form_callback invoked', t('The correct callback was invoked'));
$this->assertNoText(t('Error message'), "No error message in resultant JSON");
$this->assertText('ajax_forms_test_validation_form_callback invoked', 'The correct callback was invoked');
}
}

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -42,14 +42,14 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase {
// Test the normal IP address.
$this->assertTrue(
ip_address() == $this->remote_ip,
t('Got remote IP address.')
'Got remote IP address.'
);
// Proxy forwarding on but no proxy addresses defined.
variable_set('reverse_proxy', 1);
$this->assertTrue(
ip_address() == $this->remote_ip,
t('Proxy forwarding without trusted proxies got remote IP address.')
'Proxy forwarding without trusted proxies got remote IP address.'
);
// Proxy forwarding on and proxy address not trusted.
@@ -58,7 +58,7 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase {
$_SERVER['REMOTE_ADDR'] = $this->untrusted_ip;
$this->assertTrue(
ip_address() == $this->untrusted_ip,
t('Proxy forwarding with untrusted proxy got remote IP address.')
'Proxy forwarding with untrusted proxy got remote IP address.'
);
// Proxy forwarding on and proxy address trusted.
@@ -67,7 +67,7 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase {
drupal_static_reset('ip_address');
$this->assertTrue(
ip_address() == $this->forwarded_ip,
t('Proxy forwarding with trusted proxy got forwarded IP address.')
'Proxy forwarding with trusted proxy got forwarded IP address.'
);
// Multi-tier architecture with comma separated values in header.
@@ -76,7 +76,7 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase {
drupal_static_reset('ip_address');
$this->assertTrue(
ip_address() == $this->forwarded_ip,
t('Proxy forwarding with trusted 2-tier proxy got forwarded IP address.')
'Proxy forwarding with trusted 2-tier proxy got forwarded IP address.'
);
// Custom client-IP header.
@@ -85,16 +85,16 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase {
drupal_static_reset('ip_address');
$this->assertTrue(
ip_address() == $this->cluster_ip,
t('Cluster environment got cluster client IP.')
'Cluster environment got cluster client IP.'
);
// Verifies that drupal_valid_http_host() prevents invalid characters.
$this->assertFalse(drupal_valid_http_host('security/.drupal.org:80'), t('HTTP_HOST with / is invalid'));
$this->assertFalse(drupal_valid_http_host('security\\.drupal.org:80'), t('HTTP_HOST with \\ is invalid'));
$this->assertFalse(drupal_valid_http_host('security<.drupal.org:80'), t('HTTP_HOST with &lt; is invalid'));
$this->assertFalse(drupal_valid_http_host('security..drupal.org:80'), t('HTTP_HOST with .. is invalid'));
$this->assertFalse(drupal_valid_http_host('security/.drupal.org:80'), 'HTTP_HOST with / is invalid');
$this->assertFalse(drupal_valid_http_host('security\\.drupal.org:80'), 'HTTP_HOST with \\ is invalid');
$this->assertFalse(drupal_valid_http_host('security<.drupal.org:80'), 'HTTP_HOST with &lt; is invalid');
$this->assertFalse(drupal_valid_http_host('security..drupal.org:80'), 'HTTP_HOST with .. is invalid');
// IPv6 loopback address
$this->assertTrue(drupal_valid_http_host('[::1]:80'), t('HTTP_HOST containing IPv6 loopback is valid'));
$this->assertTrue(drupal_valid_http_host('[::1]:80'), 'HTTP_HOST containing IPv6 loopback is valid');
}
}
@@ -122,32 +122,32 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
$this->drupalGet('');
$this->drupalHead('');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$etag = $this->drupalGetHeader('ETag');
$last_modified = $this->drupalGetHeader('Last-Modified');
$this->drupalGet('', array(), array('If-Modified-Since: ' . $last_modified, 'If-None-Match: ' . $etag));
$this->assertResponse(304, t('Conditional request returned 304 Not Modified.'));
$this->assertResponse(304, 'Conditional request returned 304 Not Modified.');
$this->drupalGet('', array(), array('If-Modified-Since: ' . gmdate(DATE_RFC822, strtotime($last_modified)), 'If-None-Match: ' . $etag));
$this->assertResponse(304, t('Conditional request with obsolete If-Modified-Since date returned 304 Not Modified.'));
$this->assertResponse(304, 'Conditional request with obsolete If-Modified-Since date returned 304 Not Modified.');
$this->drupalGet('', array(), array('If-Modified-Since: ' . gmdate(DATE_RFC850, strtotime($last_modified)), 'If-None-Match: ' . $etag));
$this->assertResponse(304, t('Conditional request with obsolete If-Modified-Since date returned 304 Not Modified.'));
$this->assertResponse(304, 'Conditional request with obsolete If-Modified-Since date returned 304 Not Modified.');
$this->drupalGet('', array(), array('If-Modified-Since: ' . $last_modified));
$this->assertResponse(200, t('Conditional request without If-None-Match returned 200 OK.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
$this->assertResponse(200, 'Conditional request without If-None-Match returned 200 OK.');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->drupalGet('', array(), array('If-Modified-Since: ' . gmdate(DATE_RFC1123, strtotime($last_modified) + 1), 'If-None-Match: ' . $etag));
$this->assertResponse(200, t('Conditional request with new a If-Modified-Since date newer than Last-Modified returned 200 OK.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
$this->assertResponse(200, 'Conditional request with new a If-Modified-Since date newer than Last-Modified returned 200 OK.');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$user = $this->drupalCreateUser();
$this->drupalLogin($user);
$this->drupalGet('', array(), array('If-Modified-Since: ' . $last_modified, 'If-None-Match: ' . $etag));
$this->assertResponse(200, t('Conditional request returned 200 OK for authenticated user.'));
$this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), t('Absense of Page was not cached.'));
$this->assertResponse(200, 'Conditional request returned 200 OK for authenticated user.');
$this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), 'Absense of Page was not cached.');
}
/**
@@ -158,35 +158,35 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
// Fill the cache.
$this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar')));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', t('Page was not cached.'));
$this->assertEqual($this->drupalGetHeader('Vary'), 'Cookie,Accept-Encoding', t('Vary header was sent.'));
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'public, max-age=0', t('Cache-Control header was sent.'));
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', t('Expires header was sent.'));
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', t('Custom header was sent.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.');
$this->assertEqual($this->drupalGetHeader('Vary'), 'Cookie,Accept-Encoding', 'Vary header was sent.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'public, max-age=0', 'Cache-Control header was sent.');
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.');
// Check cache.
$this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar')));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
$this->assertEqual($this->drupalGetHeader('Vary'), 'Cookie,Accept-Encoding', t('Vary: Cookie header was sent.'));
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'public, max-age=0', t('Cache-Control header was sent.'));
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', t('Expires header was sent.'));
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', t('Custom header was sent.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertEqual($this->drupalGetHeader('Vary'), 'Cookie,Accept-Encoding', 'Vary: Cookie header was sent.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'public, max-age=0', 'Cache-Control header was sent.');
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.');
// Check replacing default headers.
$this->drupalGet('system-test/set-header', array('query' => array('name' => 'Expires', 'value' => 'Fri, 19 Nov 2008 05:00:00 GMT')));
$this->assertEqual($this->drupalGetHeader('Expires'), 'Fri, 19 Nov 2008 05:00:00 GMT', t('Default header was replaced.'));
$this->assertEqual($this->drupalGetHeader('Expires'), 'Fri, 19 Nov 2008 05:00:00 GMT', 'Default header was replaced.');
$this->drupalGet('system-test/set-header', array('query' => array('name' => 'Vary', 'value' => 'User-Agent')));
$this->assertEqual($this->drupalGetHeader('Vary'), 'User-Agent,Accept-Encoding', t('Default header was replaced.'));
$this->assertEqual($this->drupalGetHeader('Vary'), 'User-Agent,Accept-Encoding', 'Default header was replaced.');
// Check that authenticated users bypass the cache.
$user = $this->drupalCreateUser();
$this->drupalLogin($user);
$this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar')));
$this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), t('Caching was bypassed.'));
$this->assertTrue(strpos($this->drupalGetHeader('Vary'), 'Cookie') === FALSE, t('Vary: Cookie header was not sent.'));
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'no-cache, must-revalidate, post-check=0, pre-check=0', t('Cache-Control header was sent.'));
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', t('Expires header was sent.'));
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', t('Custom header was sent.'));
$this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), 'Caching was bypassed.');
$this->assertTrue(strpos($this->drupalGetHeader('Vary'), 'Cookie') === FALSE, 'Vary: Cookie header was not sent.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'no-cache, must-revalidate, post-check=0, pre-check=0', 'Cache-Control header was sent.');
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.');
}
@@ -202,23 +202,23 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
// Fill the cache and verify that output is compressed.
$this->drupalGet('', array(), array('Accept-Encoding: gzip,deflate'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', t('Page was not cached.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.');
$this->drupalSetContent(gzinflate(substr($this->drupalGetContent(), 10, -8)));
$this->assertRaw('</html>', t('Page was gzip compressed.'));
$this->assertRaw('</html>', 'Page was gzip compressed.');
// Verify that cached output is compressed.
$this->drupalGet('', array(), array('Accept-Encoding: gzip,deflate'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
$this->assertEqual($this->drupalGetHeader('Content-Encoding'), 'gzip', t('A Content-Encoding header was sent.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertEqual($this->drupalGetHeader('Content-Encoding'), 'gzip', 'A Content-Encoding header was sent.');
$this->drupalSetContent(gzinflate(substr($this->drupalGetContent(), 10, -8)));
$this->assertRaw('</html>', t('Page was gzip compressed.'));
$this->assertRaw('</html>', 'Page was gzip compressed.');
// Verify that a client without compression support gets an uncompressed page.
$this->drupalGet('');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
$this->assertFalse($this->drupalGetHeader('Content-Encoding'), t('A Content-Encoding header was not sent.'));
$this->assertTitle(t('Welcome to @site-name | @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), t('Site title matches.'));
$this->assertRaw('</html>', t('Page was not compressed.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertFalse($this->drupalGetHeader('Content-Encoding'), 'A Content-Encoding header was not sent.');
$this->assertTitle(t('Welcome to @site-name | @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), 'Site title matches.');
$this->assertRaw('</html>', 'Page was not compressed.');
}
}
@@ -243,17 +243,17 @@ class BootstrapVariableTestCase extends DrupalWebTestCase {
// Setting and retrieving values.
$variable = $this->randomName();
variable_set('simpletest_bootstrap_variable_test', $variable);
$this->assertIdentical($variable, variable_get('simpletest_bootstrap_variable_test'), t('Setting and retrieving values'));
$this->assertIdentical($variable, variable_get('simpletest_bootstrap_variable_test'), 'Setting and retrieving values');
// Make sure the variable persists across multiple requests.
$this->drupalGet('system-test/variable-get');
$this->assertText($variable, t('Variable persists across multiple requests'));
$this->assertText($variable, 'Variable persists across multiple requests');
// Deleting variables.
$default_value = $this->randomName();
variable_del('simpletest_bootstrap_variable_test');
$variable = variable_get('simpletest_bootstrap_variable_test', $default_value);
$this->assertIdentical($variable, $default_value, t('Deleting variables'));
$this->assertIdentical($variable, $default_value, 'Deleting variables');
}
/**
@@ -261,10 +261,10 @@ class BootstrapVariableTestCase extends DrupalWebTestCase {
*/
function testVariableDefaults() {
// Tests passing nothing through to the default.
$this->assertIdentical(NULL, variable_get('simpletest_bootstrap_variable_test'), t('Variables are correctly defaulting to NULL.'));
$this->assertIdentical(NULL, variable_get('simpletest_bootstrap_variable_test'), 'Variables are correctly defaulting to NULL.');
// Tests passing 5 to the default parameter.
$this->assertIdentical(5, variable_get('simpletest_bootstrap_variable_test', 5), t('The default variable parameter is passed through correctly.'));
$this->assertIdentical(5, variable_get('simpletest_bootstrap_variable_test', 5), 'The default variable parameter is passed through correctly.');
}
}
@@ -383,17 +383,17 @@ class BootstrapTimerTestCase extends DrupalUnitTestCase {
function testTimer() {
timer_start('test');
sleep(1);
$this->assertTrue(timer_read('test') >= 1000, t('Timer measured 1 second of sleeping while running.'));
$this->assertTrue(timer_read('test') >= 1000, 'Timer measured 1 second of sleeping while running.');
sleep(1);
timer_stop('test');
$this->assertTrue(timer_read('test') >= 2000, t('Timer measured 2 seconds of sleeping after being stopped.'));
$this->assertTrue(timer_read('test') >= 2000, 'Timer measured 2 seconds of sleeping after being stopped.');
timer_start('test');
sleep(1);
$this->assertTrue(timer_read('test') >= 3000, t('Timer measured 3 seconds of sleeping after being restarted.'));
$this->assertTrue(timer_read('test') >= 3000, 'Timer measured 3 seconds of sleeping after being restarted.');
sleep(1);
$timer = timer_stop('test');
$this->assertTrue(timer_read('test') >= 4000, t('Timer measured 4 seconds of sleeping after being stopped for a second time.'));
$this->assertEqual($timer['count'], 2, t('Timer counted 2 instances of being started.'));
$this->assertTrue(timer_read('test') >= 4000, 'Timer measured 4 seconds of sleeping after being stopped for a second time.');
$this->assertEqual($timer['count'], 2, 'Timer counted 2 instances of being started.');
}
}
@@ -417,22 +417,22 @@ class BootstrapResettableStaticTestCase extends DrupalUnitTestCase {
function testDrupalStatic() {
$name = __CLASS__ . '_' . __METHOD__;
$var = &drupal_static($name, 'foo');
$this->assertEqual($var, 'foo', t('Variable returned by drupal_static() was set to its default.'));
$this->assertEqual($var, 'foo', 'Variable returned by drupal_static() was set to its default.');
// Call the specific reset and the global reset each twice to ensure that
// multiple resets can be issued without odd side effects.
$var = 'bar';
drupal_static_reset($name);
$this->assertEqual($var, 'foo', t('Variable was reset after first invocation of name-specific reset.'));
$this->assertEqual($var, 'foo', 'Variable was reset after first invocation of name-specific reset.');
$var = 'bar';
drupal_static_reset($name);
$this->assertEqual($var, 'foo', t('Variable was reset after second invocation of name-specific reset.'));
$this->assertEqual($var, 'foo', 'Variable was reset after second invocation of name-specific reset.');
$var = 'bar';
drupal_static_reset();
$this->assertEqual($var, 'foo', t('Variable was reset after first invocation of global reset.'));
$this->assertEqual($var, 'foo', 'Variable was reset after first invocation of global reset.');
$var = 'bar';
drupal_static_reset();
$this->assertEqual($var, 'foo', t('Variable was reset after second invocation of global reset.'));
$this->assertEqual($var, 'foo', 'Variable was reset after second invocation of global reset.');
}
}
@@ -457,7 +457,30 @@ class BootstrapMiscTestCase extends DrupalUnitTestCase {
$link_options_1 = array('fragment' => 'x', 'attributes' => array('title' => 'X', 'class' => array('a', 'b')), 'language' => 'en');
$link_options_2 = array('fragment' => 'y', 'attributes' => array('title' => 'Y', 'class' => array('c', 'd')), 'html' => TRUE);
$expected = array('fragment' => 'y', 'attributes' => array('title' => 'Y', 'class' => array('a', 'b', 'c', 'd')), 'language' => 'en', 'html' => TRUE);
$this->assertIdentical(drupal_array_merge_deep($link_options_1, $link_options_2), $expected, t('drupal_array_merge_deep() returned a properly merged array.'));
$this->assertIdentical(drupal_array_merge_deep($link_options_1, $link_options_2), $expected, 'drupal_array_merge_deep() returned a properly merged array.');
}
/**
* Tests that the drupal_check_memory_limit() function works as expected.
*/
function testCheckMemoryLimit() {
$memory_limit = ini_get('memory_limit');
// Test that a very reasonable amount of memory is available.
$this->assertTrue(drupal_check_memory_limit('30MB'), '30MB of memory tested available.');
// Get the available memory and multiply it by two to make it unreasonably
// high.
$twice_avail_memory = ($memory_limit * 2) . 'MB';
// The function should always return true if the memory limit is set to -1.
$this->assertTrue(drupal_check_memory_limit($twice_avail_memory, -1), 'drupal_check_memory_limit() returns TRUE when a limit of -1 (none) is supplied');
// Test that even though we have 30MB of memory available - the function
// returns FALSE when given an upper limit for how much memory can be used.
$this->assertFalse(drupal_check_memory_limit('30MB', '16MB'), 'drupal_check_memory_limit() returns FALSE with a 16MB upper limit on a 30MB requirement.');
// Test that an equal amount of memory to the amount requested returns TRUE.
$this->assertTrue(drupal_check_memory_limit('30MB', '30MB'), 'drupal_check_memory_limit() returns TRUE when requesting 30MB on a 30MB requirement.');
}
}
@@ -506,4 +529,3 @@ class BootstrapOverrideServerVariablesTestCase extends DrupalUnitTestCase {
}
}
}

View File

@@ -148,7 +148,7 @@ class CacheSavingCase extends CacheTestCase {
cache_set('test_object', $test_object, 'cache');
$cache = cache_get('test_object', 'cache');
$this->assertTrue(isset($cache->data) && $cache->data == $test_object, t('Object is saved and restored properly.'));
$this->assertTrue(isset($cache->data) && $cache->data == $test_object, 'Object is saved and restored properly.');
}
/**
@@ -157,7 +157,7 @@ class CacheSavingCase extends CacheTestCase {
function checkVariable($var) {
cache_set('test_var', $var, 'cache');
$cache = cache_get('test_var', 'cache');
$this->assertTrue(isset($cache->data) && $cache->data === $var, t('@type is saved and restored properly.', array('@type' => ucfirst(gettype($var)))));
$this->assertTrue(isset($cache->data) && $cache->data === $var, format_string('@type is saved and restored properly.', array('@type' => ucfirst(gettype($var)))));
}
/**
@@ -165,7 +165,7 @@ class CacheSavingCase extends CacheTestCase {
*/
function testNoEmptyCids() {
$this->drupalGet('user/register');
$this->assertFalse(cache_get(''), t('No cache entry is written with an empty cid.'));
$this->assertFalse(cache_get(''), 'No cache entry is written with an empty cid.');
}
}
@@ -195,14 +195,14 @@ class CacheGetMultipleUnitTest extends CacheTestCase {
$item2 = $this->randomName(10);
cache_set('item1', $item1, $this->default_bin);
cache_set('item2', $item2, $this->default_bin);
$this->assertTrue($this->checkCacheExists('item1', $item1), t('Item 1 is cached.'));
$this->assertTrue($this->checkCacheExists('item2', $item2), t('Item 2 is cached.'));
$this->assertTrue($this->checkCacheExists('item1', $item1), 'Item 1 is cached.');
$this->assertTrue($this->checkCacheExists('item2', $item2), 'Item 2 is cached.');
// Fetch both records from the database with cache_get_multiple().
$item_ids = array('item1', 'item2');
$items = cache_get_multiple($item_ids, $this->default_bin);
$this->assertEqual($items['item1']->data, $item1, t('Item was returned from cache successfully.'));
$this->assertEqual($items['item2']->data, $item2, t('Item was returned from cache successfully.'));
$this->assertEqual($items['item1']->data, $item1, 'Item was returned from cache successfully.');
$this->assertEqual($items['item2']->data, $item2, 'Item was returned from cache successfully.');
// Remove one item from the cache.
cache_clear_all('item2', $this->default_bin);
@@ -210,9 +210,9 @@ class CacheGetMultipleUnitTest extends CacheTestCase {
// Confirm that only one item is returned by cache_get_multiple().
$item_ids = array('item1', 'item2');
$items = cache_get_multiple($item_ids, $this->default_bin);
$this->assertEqual($items['item1']->data, $item1, t('Item was returned from cache successfully.'));
$this->assertFalse(isset($items['item2']), t('Item was not returned from the cache.'));
$this->assertTrue(count($items) == 1, t('Only valid cache entries returned.'));
$this->assertEqual($items['item1']->data, $item1, 'Item was returned from cache successfully.');
$this->assertFalse(isset($items['item2']), 'Item was not returned from the cache.');
$this->assertTrue(count($items) == 1, 'Only valid cache entries returned.');
}
}
@@ -250,11 +250,11 @@ class CacheClearCase extends CacheTestCase {
cache_set('test_cid_clear2', $this->default_value, $this->default_bin);
$this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)
&& $this->checkCacheExists('test_cid_clear2', $this->default_value),
t('Two caches were created for checking cid "*" with wildcard false.'));
'Two caches were created for checking cid "*" with wildcard false.');
cache_clear_all('*', $this->default_bin);
$this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)
&& $this->checkCacheExists('test_cid_clear2', $this->default_value),
t('Two caches still exists after clearing cid "*" with wildcard false.'));
'Two caches still exists after clearing cid "*" with wildcard false.');
}
/**
@@ -265,21 +265,21 @@ class CacheClearCase extends CacheTestCase {
cache_set('test_cid_clear2', $this->default_value, $this->default_bin);
$this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)
&& $this->checkCacheExists('test_cid_clear2', $this->default_value),
t('Two caches were created for checking cid "*" with wildcard true.'));
'Two caches were created for checking cid "*" with wildcard true.');
cache_clear_all('*', $this->default_bin, TRUE);
$this->assertFalse($this->checkCacheExists('test_cid_clear1', $this->default_value)
|| $this->checkCacheExists('test_cid_clear2', $this->default_value),
t('Two caches removed after clearing cid "*" with wildcard true.'));
'Two caches removed after clearing cid "*" with wildcard true.');
cache_set('test_cid_clear1', $this->default_value, $this->default_bin);
cache_set('test_cid_clear2', $this->default_value, $this->default_bin);
$this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)
&& $this->checkCacheExists('test_cid_clear2', $this->default_value),
t('Two caches were created for checking cid substring with wildcard true.'));
'Two caches were created for checking cid substring with wildcard true.');
cache_clear_all('test_', $this->default_bin, TRUE);
$this->assertFalse($this->checkCacheExists('test_cid_clear1', $this->default_value)
|| $this->checkCacheExists('test_cid_clear2', $this->default_value),
t('Two caches removed after clearing cid substring with wildcard true.'));
'Two caches removed after clearing cid substring with wildcard true.');
}
/**
@@ -293,16 +293,16 @@ class CacheClearCase extends CacheTestCase {
$this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)
&& $this->checkCacheExists('test_cid_clear2', $this->default_value)
&& $this->checkCacheExists('test_cid_clear3', $this->default_value),
t('Three cache entries were created.'));
'Three cache entries were created.');
// Clear two entries using an array.
cache_clear_all(array('test_cid_clear1', 'test_cid_clear2'), $this->default_bin);
$this->assertFalse($this->checkCacheExists('test_cid_clear1', $this->default_value)
|| $this->checkCacheExists('test_cid_clear2', $this->default_value),
t('Two cache entries removed after clearing with an array.'));
'Two cache entries removed after clearing with an array.');
$this->assertTrue($this->checkCacheExists('test_cid_clear3', $this->default_value),
t('Entry was not cleared from the cache'));
'Entry was not cleared from the cache');
// Set the cache clear threshold to 2 to confirm that the full bin is cleared
// when the threshold is exceeded.
@@ -311,12 +311,12 @@ class CacheClearCase extends CacheTestCase {
cache_set('test_cid_clear2', $this->default_value, $this->default_bin);
$this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)
&& $this->checkCacheExists('test_cid_clear2', $this->default_value),
t('Two cache entries were created.'));
'Two cache entries were created.');
cache_clear_all(array('test_cid_clear1', 'test_cid_clear2', 'test_cid_clear3'), $this->default_bin);
$this->assertFalse($this->checkCacheExists('test_cid_clear1', $this->default_value)
|| $this->checkCacheExists('test_cid_clear2', $this->default_value)
|| $this->checkCacheExists('test_cid_clear3', $this->default_value),
t('All cache entries removed when the array exceeded the cache clear threshold.'));
'All cache entries removed when the array exceeded the cache clear threshold.');
}
/**
@@ -336,7 +336,31 @@ class CacheClearCase extends CacheTestCase {
foreach ($bins as $id => $bin) {
$id = 'test_cid_clear' . $id;
$this->assertFalse($this->checkCacheExists($id, $this->default_value, $bin), t('All cache entries removed from @bin.', array('@bin' => $bin)));
$this->assertFalse($this->checkCacheExists($id, $this->default_value, $bin), format_string('All cache entries removed from @bin.', array('@bin' => $bin)));
}
}
/**
* Test DrupalDatabaseCache::isValidBin().
*/
function testIsValidBin() {
// Retrieve existing cache bins.
$valid_bins = array('cache', 'cache_filter', 'cache_page', 'cache_boostrap', 'cache_path');
$valid_bins = array_merge(module_invoke_all('flush_caches'), $valid_bins);
foreach ($valid_bins as $id => $bin) {
$cache = _cache_get_object($bin);
if ($cache instanceof DrupalDatabaseCache) {
$this->assertTrue($cache->isValidBin(), format_string('Cache bin @bin is valid.', array('@bin' => $bin)));
}
}
// Check for non-cache tables and invalid bins.
$invalid_bins = array('block', 'filter', 'missing_table', $this->randomName());
foreach ($invalid_bins as $id => $bin) {
$cache = _cache_get_object($bin);
if ($cache instanceof DrupalDatabaseCache) {
$this->assertFalse($cache->isValidBin(), format_string('Cache bin @bin is not valid.', array('@bin' => $bin)));
}
}
}
@@ -400,14 +424,14 @@ class CacheIsEmptyCase extends CacheTestCase {
function testIsEmpty() {
// Clear the cache bin.
cache_clear_all('*', $this->default_bin);
$this->assertTrue(cache_is_empty($this->default_bin), t('The cache bin is empty'));
$this->assertTrue(cache_is_empty($this->default_bin), 'The cache bin is empty');
// Add some data to the cache bin.
cache_set($this->default_cid, $this->default_value, $this->default_bin);
$this->assertCacheExists(t('Cache was set.'), $this->default_value, $this->default_cid);
$this->assertFalse(cache_is_empty($this->default_bin), t('The cache bin is not empty'));
$this->assertFalse(cache_is_empty($this->default_bin), 'The cache bin is not empty');
// Remove the cached data.
cache_clear_all($this->default_cid, $this->default_bin);
$this->assertCacheRemoved(t('Cache was removed.'), $this->default_cid);
$this->assertTrue(cache_is_empty($this->default_bin), t('The cache bin is empty'));
$this->assertTrue(cache_is_empty($this->default_bin), 'The cache bin is empty');
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -7,8 +7,8 @@ stylesheets[all][] = common_test.css
stylesheets[print][] = common_test.print.css
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -100,6 +100,14 @@ function common_test_destination() {
print "The destination: " . check_plain($destination['destination']);
}
/**
* Applies #printed to an element to help test #pre_render.
*/
function common_test_drupal_render_printing_pre_render($elements) {
$elements['#printed'] = TRUE;
return $elements;
}
/**
* Implements hook_TYPE_alter().
*/

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -6,8 +6,8 @@ core = 7.x
dependencies[] = entity_cache_test_dependency
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -169,7 +169,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->entityCondition('entity_id', '5');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle', 5),
), t('Test query on an entity type with a generated bundle.'));
), 'Test query on an entity type with a generated bundle.');
// Test entity_type condition.
$query = new EntityFieldQuery();
@@ -181,7 +181,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test entity entity_type condition.'));
), 'Test entity entity_type condition.');
// Test entity_id condition.
$query = new EntityFieldQuery();
@@ -190,7 +190,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->entityCondition('entity_id', '3');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 3),
), t('Test entity entity_id condition.'));
), 'Test entity entity_id condition.');
$query = new EntityFieldQuery();
$query
@@ -198,7 +198,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->propertyCondition('ftid', '3');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 3),
), t('Test entity entity_id condition and entity_id property condition.'));
), 'Test entity entity_id condition and entity_id property condition.');
// Test bundle condition.
$query = new EntityFieldQuery();
@@ -210,7 +210,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test entity bundle condition: bundle1.'));
), 'Test entity bundle condition: bundle1.');
$query = new EntityFieldQuery();
$query
@@ -219,7 +219,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test entity bundle condition: bundle2.'));
), 'Test entity bundle condition: bundle2.');
$query = new EntityFieldQuery();
$query
@@ -228,7 +228,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test entity bundle condition and bundle property condition.'));
), 'Test entity bundle condition and bundle property condition.');
// Test revision_id condition.
$query = new EntityFieldQuery();
@@ -237,7 +237,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->entityCondition('revision_id', '3');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 3),
), t('Test entity revision_id condition.'));
), 'Test entity revision_id condition.');
$query = new EntityFieldQuery();
$query
@@ -245,7 +245,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->propertyCondition('ftvid', '3');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 3),
), t('Test entity revision_id condition and revision_id property condition.'));
), 'Test entity revision_id condition and revision_id property condition.');
$query = new EntityFieldQuery();
$query
@@ -255,7 +255,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity', 100),
array('test_entity', 101),
), t('Test revision age.'));
), 'Test revision age.');
// Test that fields attached to the non-revision supporting entity
// 'test_entity_bundle_key' are reachable in FIELD_LOAD_REVISION.
@@ -274,7 +274,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 2),
array('test_entity', 3),
array('test_entity', 4),
), t('Test that fields are reachable from FIELD_LOAD_REVISION even for non-revision entities.'));
), 'Test that fields are reachable from FIELD_LOAD_REVISION even for non-revision entities.');
// Test entity sort by entity_id.
$query = new EntityFieldQuery();
@@ -288,7 +288,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test sort entity entity_id in ascending order.'), TRUE);
), 'Test sort entity entity_id in ascending order.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -301,7 +301,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test sort entity entity_id in descending order.'), TRUE);
), 'Test sort entity entity_id in descending order.', TRUE);
// Test entity sort by entity_id, with a field condition.
$query = new EntityFieldQuery();
@@ -316,7 +316,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test sort entity entity_id in ascending order, with a field condition.'), TRUE);
), 'Test sort entity entity_id in ascending order, with a field condition.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -330,7 +330,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test sort entity entity_id property in descending order, with a field condition.'), TRUE);
), 'Test sort entity entity_id property in descending order, with a field condition.', TRUE);
// Test property sort by entity id.
$query = new EntityFieldQuery();
@@ -344,7 +344,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test sort entity entity_id property in ascending order.'), TRUE);
), 'Test sort entity entity_id property in ascending order.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -357,7 +357,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test sort entity entity_id property in descending order.'), TRUE);
), 'Test sort entity entity_id property in descending order.', TRUE);
// Test property sort by entity id, with a field condition.
$query = new EntityFieldQuery();
@@ -372,7 +372,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test sort entity entity_id property in ascending order, with a field condition.'), TRUE);
), 'Test sort entity entity_id property in ascending order, with a field condition.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -386,7 +386,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test sort entity entity_id property in descending order, with a field condition.'), TRUE);
), 'Test sort entity entity_id property in descending order, with a field condition.', TRUE);
// Test entity sort by bundle.
$query = new EntityFieldQuery();
@@ -401,7 +401,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 6),
array('test_entity_bundle_key', 5),
), t('Test sort entity bundle in ascending order, property in descending order.'), TRUE);
), 'Test sort entity bundle in ascending order, property in descending order.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -415,7 +415,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test sort entity bundle in descending order, property in ascending order.'), TRUE);
), 'Test sort entity bundle in descending order, property in ascending order.', TRUE);
// Test entity sort by bundle, with a field condition.
$query = new EntityFieldQuery();
@@ -431,7 +431,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 6),
array('test_entity_bundle_key', 5),
), t('Test sort entity bundle in ascending order, property in descending order, with a field condition.'), TRUE);
), 'Test sort entity bundle in ascending order, property in descending order, with a field condition.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -446,7 +446,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test sort entity bundle in descending order, property in ascending order, with a field condition.'), TRUE);
), 'Test sort entity bundle in descending order, property in ascending order, with a field condition.', TRUE);
// Test entity sort by bundle, field.
$query = new EntityFieldQuery();
@@ -461,7 +461,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 6),
array('test_entity_bundle_key', 5),
), t('Test sort entity bundle in ascending order, field in descending order.'), TRUE);
), 'Test sort entity bundle in ascending order, field in descending order.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -475,7 +475,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test sort entity bundle in descending order, field in ascending order.'), TRUE);
), 'Test sort entity bundle in descending order, field in ascending order.', TRUE);
// Test entity sort by revision_id.
$query = new EntityFieldQuery();
@@ -487,7 +487,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 2),
array('test_entity', 3),
array('test_entity', 4),
), t('Test sort entity revision_id in ascending order.'), TRUE);
), 'Test sort entity revision_id in ascending order.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -498,7 +498,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 3),
array('test_entity', 2),
array('test_entity', 1),
), t('Test sort entity revision_id in descending order.'), TRUE);
), 'Test sort entity revision_id in descending order.', TRUE);
// Test entity sort by revision_id, with a field condition.
$query = new EntityFieldQuery();
@@ -511,7 +511,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 2),
array('test_entity', 3),
array('test_entity', 4),
), t('Test sort entity revision_id in ascending order, with a field condition.'), TRUE);
), 'Test sort entity revision_id in ascending order, with a field condition.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -523,7 +523,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 3),
array('test_entity', 2),
array('test_entity', 1),
), t('Test sort entity revision_id in descending order, with a field condition.'), TRUE);
), 'Test sort entity revision_id in descending order, with a field condition.', TRUE);
// Test property sort by revision_id.
$query = new EntityFieldQuery();
@@ -535,7 +535,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 2),
array('test_entity', 3),
array('test_entity', 4),
), t('Test sort entity revision_id property in ascending order.'), TRUE);
), 'Test sort entity revision_id property in ascending order.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -546,7 +546,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 3),
array('test_entity', 2),
array('test_entity', 1),
), t('Test sort entity revision_id property in descending order.'), TRUE);
), 'Test sort entity revision_id property in descending order.', TRUE);
// Test property sort by revision_id, with a field condition.
$query = new EntityFieldQuery();
@@ -559,7 +559,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 2),
array('test_entity', 3),
array('test_entity', 4),
), t('Test sort entity revision_id property in ascending order, with a field condition.'), TRUE);
), 'Test sort entity revision_id property in ascending order, with a field condition.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -571,7 +571,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 3),
array('test_entity', 2),
array('test_entity', 1),
), t('Test sort entity revision_id property in descending order, with a field condition.'), TRUE);
), 'Test sort entity revision_id property in descending order, with a field condition.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -584,7 +584,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test sort field in ascending order without field condition.'), TRUE);
), 'Test sort field in ascending order without field condition.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -597,7 +597,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test sort field in descending order without field condition.'), TRUE);
), 'Test sort field in descending order without field condition.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -611,7 +611,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test sort field in ascending order.'), TRUE);
), 'Test sort field in ascending order.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -625,7 +625,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test sort field in descending order.'), TRUE);
), 'Test sort field in descending order.', TRUE);
// Test "in" operation with entity entity_type condition and entity_id
// property condition.
@@ -637,7 +637,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test "in" operation with entity entity_type condition and entity_id property condition.'));
), 'Test "in" operation with entity entity_type condition and entity_id property condition.');
// Test "in" operation with entity entity_type condition and entity_id
// property condition. Sort in descending order by entity_id.
@@ -650,7 +650,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 1),
), t('Test "in" operation with entity entity_type condition and entity_id property condition. Sort entity_id in descending order.'), TRUE);
), 'Test "in" operation with entity entity_type condition and entity_id property condition. Sort entity_id in descending order.', TRUE);
// Test query count
$query = new EntityFieldQuery();
@@ -658,7 +658,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->entityCondition('entity_type', 'test_entity_bundle_key')
->count()
->execute();
$this->assertEqual($query_count, 6, t('Test query count on entity condition.'));
$this->assertEqual($query_count, 6, 'Test query count on entity condition.');
$query = new EntityFieldQuery();
$query_count = $query
@@ -666,7 +666,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->propertyCondition('ftid', '1')
->count()
->execute();
$this->assertEqual($query_count, 1, t('Test query count on entity and property condition.'));
$this->assertEqual($query_count, 1, 'Test query count on entity and property condition.');
$query = new EntityFieldQuery();
$query_count = $query
@@ -674,7 +674,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->propertyCondition('ftid', '4', '>')
->count()
->execute();
$this->assertEqual($query_count, 2, t('Test query count on entity and property condition with operator.'));
$this->assertEqual($query_count, 2, 'Test query count on entity and property condition with operator.');
$query = new EntityFieldQuery();
$query_count = $query
@@ -682,7 +682,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[0], 'value', 3, '=')
->count()
->execute();
$this->assertEqual($query_count, 1, t('Test query count on field condition.'));
$this->assertEqual($query_count, 1, 'Test query count on field condition.');
// First, test without options.
$query = new EntityFieldQuery();
@@ -696,13 +696,13 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test the "contains" operation on a property.'));
), 'Test the "contains" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[1], 'shape', 'uar', 'CONTAINS');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle', 5),
), t('Test the "contains" operation on a field.'));
), 'Test the "contains" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -710,14 +710,14 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->propertyCondition('ftid', 1, '=');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
), t('Test the "equal to" operation on a property.'));
), 'Test the "equal to" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', 3, '=');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 3),
array('test_entity', 3),
), t('Test the "equal to" operation on a field.'));
), 'Test the "equal to" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -729,7 +729,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test the "not equal to" operation on a property.'));
), 'Test the "not equal to" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', 3, '<>');
@@ -742,7 +742,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 1),
array('test_entity', 2),
array('test_entity', 4),
), t('Test the "not equal to" operation on a field.'));
), 'Test the "not equal to" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -754,7 +754,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test the "not equal to" operation on a property.'));
), 'Test the "not equal to" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', 3, '!=');
@@ -767,7 +767,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 1),
array('test_entity', 2),
array('test_entity', 4),
), t('Test the "not equal to" operation on a field.'));
), 'Test the "not equal to" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -775,14 +775,14 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->propertyCondition('ftid', 2, '<');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
), t('Test the "less than" operation on a property.'));
), 'Test the "less than" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', 2, '<');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity', 1),
), t('Test the "less than" operation on a field.'));
), 'Test the "less than" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -791,7 +791,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
), t('Test the "less than or equal to" operation on a property.'));
), 'Test the "less than or equal to" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', 2, '<=');
@@ -800,7 +800,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 2),
array('test_entity', 1),
array('test_entity', 2),
), t('Test the "less than or equal to" operation on a field.'));
), 'Test the "less than or equal to" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -809,7 +809,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test the "greater than" operation on a property.'));
), 'Test the "greater than" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', 2, '>');
@@ -820,7 +820,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 6),
array('test_entity', 3),
array('test_entity', 4),
), t('Test the "greater than" operation on a field.'));
), 'Test the "greater than" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -830,7 +830,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test the "greater than or equal to" operation on a property.'));
), 'Test the "greater than or equal to" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', 3, '>=');
@@ -841,7 +841,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 6),
array('test_entity', 3),
array('test_entity', 4),
), t('Test the "greater than or equal to" operation on a field.'));
), 'Test the "greater than or equal to" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -852,7 +852,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test the "not in" operation on a property.'));
), 'Test the "not in" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', array(3, 4, 100, 101), 'NOT IN');
@@ -863,7 +863,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 6),
array('test_entity', 1),
array('test_entity', 2),
), t('Test the "not in" operation on a field.'));
), 'Test the "not in" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -872,7 +872,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test the "in" operation on a property.'));
), 'Test the "in" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', array(2, 3), 'IN');
@@ -881,7 +881,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity', 2),
array('test_entity', 3),
), t('Test the "in" operation on a field.'));
), 'Test the "in" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -891,7 +891,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
), t('Test the "between" operation on a property.'));
), 'Test the "between" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', array(1, 3), 'BETWEEN');
@@ -902,7 +902,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 1),
array('test_entity', 2),
array('test_entity', 3),
), t('Test the "between" operation on a field.'));
), 'Test the "between" operation on a field.');
$query = new EntityFieldQuery();
$query
@@ -915,20 +915,20 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test the "starts_with" operation on a property.'));
), 'Test the "starts_with" operation on a property.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[1], 'shape', 'squ', 'STARTS_WITH');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle', 5),
), t('Test the "starts_with" operation on a field.'));
), 'Test the "starts_with" operation on a field.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', 3);
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 3),
array('test_entity', 3),
), t('Test omission of an operator with a single item.'));
), 'Test omission of an operator with a single item.');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', array(2, 3));
@@ -937,7 +937,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity', 2),
array('test_entity', 3),
), t('Test omission of an operator with multiple items.'));
), 'Test omission of an operator with multiple items.');
$query = new EntityFieldQuery();
$query
@@ -947,7 +947,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
), t('Test entity, property and field conditions.'));
), 'Test entity, property and field conditions.');
$query = new EntityFieldQuery();
$query
@@ -957,7 +957,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[0], 'value', 4);
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 4),
), t('Test entity condition with "starts_with" operation, and property and field conditions.'));
), 'Test entity condition with "starts_with" operation, and property and field conditions.');
$query = new EntityFieldQuery();
$query
@@ -967,7 +967,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
), t('Test limit on a property.'), TRUE);
), 'Test limit on a property.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -978,7 +978,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
), t('Test limit on a field.'), TRUE);
), 'Test limit on a field.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -988,7 +988,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test offset on a property.'), TRUE);
), 'Test offset on a property.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -1001,7 +1001,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test offset on a field.'), TRUE);
), 'Test offset on a field.', TRUE);
for ($i = 6; $i < 10; $i++) {
$entity = new stdClass();
@@ -1023,7 +1023,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity', 4),
array('test_entity_bundle', 8),
array('test_entity_bundle', 9),
), t('Select a field across multiple entities.'));
), 'Select a field across multiple entities.');
$query = new EntityFieldQuery();
$query
@@ -1031,13 +1031,13 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[1], 'color', 'blue');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle', 5),
), t('Test without a delta group.'));
), 'Test without a delta group.');
$query = new EntityFieldQuery();
$query
->fieldCondition($this->fields[1], 'shape', 'square', '=', 'group')
->fieldCondition($this->fields[1], 'color', 'blue', '=', 'group');
$this->assertEntityFieldQuery($query, array(), t('Test with a delta group.'));
$this->assertEntityFieldQuery($query, array(), 'Test with a delta group.');
// Test query on a deleted field.
field_attach_delete_bundle('test_entity_bundle_key', 'bundle1');
@@ -1046,12 +1046,12 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$query->fieldCondition($this->fields[0], 'value', '3');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle', 8),
), t('Test query on a field after deleting field from some entities.'));
), 'Test query on a field after deleting field from some entities.');
field_attach_delete_bundle('test_entity_bundle', 'test_entity_bundle');
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', '3');
$this->assertEntityFieldQuery($query, array(), t('Test query on a field after deleting field from all entities.'));
$this->assertEntityFieldQuery($query, array(), 'Test query on a field after deleting field from all entities.');
$query = new EntityFieldQuery();
$query
@@ -1061,7 +1061,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle', 8),
array('test_entity', 3),
), t('Test query on a deleted field with deleted option set to TRUE.'));
), 'Test query on a deleted field with deleted option set to TRUE.');
$pass = FALSE;
$query = new EntityFieldQuery();
@@ -1071,7 +1071,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
catch (EntityFieldQueryException $exception) {
$pass = ($exception->getMessage() == t('For this query an entity type must be specified.'));
}
$this->assertTrue($pass, t("Can't query the universe."));
$this->assertTrue($pass, "Can't query the universe.");
}
/**
@@ -1109,7 +1109,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->count()
->execute();
$this->assertEqual($query_count, 1, t("Count on translatable cardinality one field is correct."));
$this->assertEqual($query_count, 1, "Count on translatable cardinality one field is correct.");
}
/**
@@ -1144,7 +1144,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldDeltaCondition($this->fields[0], 0, '>');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 1),
), t('Test with a delta meta condition.'));
), 'Test with a delta meta condition.');
// Test language field meta condition.
$query = new EntityFieldQuery();
@@ -1153,7 +1153,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 1),
), t('Test with a language meta condition.'));
), 'Test with a language meta condition.');
// Test language field meta condition.
$query = new EntityFieldQuery();
@@ -1162,7 +1162,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 1),
), t('Test with a language meta condition.'));
), 'Test with a language meta condition.');
// Test delta grouping.
$query = new EntityFieldQuery();
@@ -1172,14 +1172,14 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldDeltaCondition($this->fields[0], 1, '<', 'group');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 1),
), t('Test with a grouped delta meta condition.'));
), 'Test with a grouped delta meta condition.');
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'test_entity', '=')
->fieldCondition($this->fields[0], 'value', 0, '=', 'group')
->fieldDeltaCondition($this->fields[0], 1, '>=', 'group');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta meta condition (empty result set).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta meta condition (empty result set).');
// Test language grouping.
$query = new EntityFieldQuery();
@@ -1189,7 +1189,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldLanguageCondition($this->fields[0], 'en', '<>', NULL, 'group');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 1),
), t('Test with a grouped language meta condition.'));
), 'Test with a grouped language meta condition.');
// Test language grouping.
$query = new EntityFieldQuery();
@@ -1199,21 +1199,21 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldLanguageCondition($this->fields[0], 'en', '!=', NULL, 'group');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 1),
), t('Test with a grouped language meta condition.'));
), 'Test with a grouped language meta condition.');
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'test_entity', '=')
->fieldCondition($this->fields[0], 'value', 0, '=', NULL, 'group')
->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', NULL, 'group');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped language meta condition (empty result set).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped language meta condition (empty result set).');
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'test_entity', '=')
->fieldCondition($this->fields[0], 'value', 0, '=', NULL, 'group')
->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=', NULL, 'group');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped language meta condition (empty result set).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped language meta condition (empty result set).');
// Test delta and language grouping.
$query = new EntityFieldQuery();
@@ -1224,7 +1224,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldLanguageCondition($this->fields[0], 'en', '<>', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 1),
), t('Test with a grouped delta + language meta condition.'));
), 'Test with a grouped delta + language meta condition.');
// Test delta and language grouping.
$query = new EntityFieldQuery();
@@ -1235,7 +1235,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldLanguageCondition($this->fields[0], 'en', '!=', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(
array('test_entity', 1),
), t('Test with a grouped delta + language meta condition.'));
), 'Test with a grouped delta + language meta condition.');
$query = new EntityFieldQuery();
$query
@@ -1243,7 +1243,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language')
->fieldLanguageCondition($this->fields[0], 'en', '<>', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).');
$query = new EntityFieldQuery();
$query
@@ -1251,7 +1251,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language')
->fieldLanguageCondition($this->fields[0], 'en', '!=', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).');
$query = new EntityFieldQuery();
$query
@@ -1259,7 +1259,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
->fieldDeltaCondition($this->fields[0], 1, '<', 'delta', 'language')
->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).');
$query = new EntityFieldQuery();
$query
@@ -1267,7 +1267,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
->fieldDeltaCondition($this->fields[0], 1, '<', 'delta', 'language')
->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).');
$query = new EntityFieldQuery();
$query
@@ -1275,7 +1275,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language')
->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, both conditions unsatisifed).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, both conditions unsatisifed).');
$query = new EntityFieldQuery();
$query
@@ -1283,7 +1283,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language')
->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language')
->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, both conditions unsatisifed).'));
$this->assertEntityFieldQuery($query, array(), 'Test with a grouped delta + language meta condition (empty result set, both conditions unsatisifed).');
// Test grouping with another field to ensure that grouping cache is reset
// properly.
@@ -1296,7 +1296,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
->fieldLanguageCondition($this->fields[1], LANGUAGE_NONE, '=', 'delta', 'language');
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle', 5),
), t('Test grouping cache.'));
), 'Test grouping cache.');
}
/**
@@ -1306,19 +1306,19 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
// Entity-only query.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'test_entity_bundle_key');
$this->assertIdentical($query->queryCallback(), array($query, 'propertyQuery'), t('Entity-only queries are handled by the propertyQuery handler.'));
$this->assertIdentical($query->queryCallback(), array($query, 'propertyQuery'), 'Entity-only queries are handled by the propertyQuery handler.');
// Field-only query.
$query = new EntityFieldQuery();
$query->fieldCondition($this->fields[0], 'value', '3');
$this->assertIdentical($query->queryCallback(), 'field_sql_storage_field_storage_query', t('Pure field queries are handled by the Field storage handler.'));
$this->assertIdentical($query->queryCallback(), 'field_sql_storage_field_storage_query', 'Pure field queries are handled by the Field storage handler.');
// Mixed entity and field query.
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'test_entity_bundle_key')
->fieldCondition($this->fields[0], 'value', '3');
$this->assertIdentical($query->queryCallback(), 'field_sql_storage_field_storage_query', t('Mixed queries are handled by the Field storage handler.'));
$this->assertIdentical($query->queryCallback(), 'field_sql_storage_field_storage_query', 'Mixed queries are handled by the Field storage handler.');
// Overriding with $query->executeCallback.
$query = new EntityFieldQuery();
@@ -1326,7 +1326,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$query->executeCallback = 'field_test_dummy_field_storage_query';
$this->assertEntityFieldQuery($query, array(
array('user', 1),
), t('executeCallback can override the query handler.'));
), 'executeCallback can override the query handler.');
// Overriding with $query->executeCallback via hook_entity_query_alter().
$query = new EntityFieldQuery();
@@ -1335,7 +1335,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$query->alterMyExecuteCallbackPlease = TRUE;
$this->assertEntityFieldQuery($query, array(
array('user', 1),
), t('executeCallback can override the query handler when set in a hook_entity_query_alter().'));
), 'executeCallback can override the query handler when set in a hook_entity_query_alter().');
// Mixed-storage queries.
$query = new EntityFieldQuery();
@@ -1350,7 +1350,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
catch (EntityFieldQueryException $exception) {
$pass = ($exception->getMessage() == t("Can't handle more than one field storage engine"));
}
$this->assertTrue($pass, t('Cannot query across field storage engines.'));
$this->assertTrue($pass, 'Cannot query across field storage engines.');
}
/**
@@ -1368,7 +1368,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
), t('Test pager integration in propertyQuery: page 1.'), TRUE);
), 'Test pager integration in propertyQuery: page 1.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -1379,7 +1379,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test pager integration in propertyQuery: page 2.'), TRUE);
), 'Test pager integration in propertyQuery: page 2.', TRUE);
// Test pager in field storage
$_GET['page'] = '0,1';
@@ -1392,7 +1392,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 2),
), t('Test pager integration in field storage: page 1.'), TRUE);
), 'Test pager integration in field storage: page 1.', TRUE);
$query = new EntityFieldQuery();
$query
@@ -1403,7 +1403,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->assertEntityFieldQuery($query, array(
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test pager integration in field storage: page 2.'), TRUE);
), 'Test pager integration in field storage: page 2.', TRUE);
unset($_GET['page']);
}
@@ -1451,7 +1451,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test TableSort by property: ftid ASC in propertyQuery.'), TRUE);
), 'Test TableSort by property: ftid ASC in propertyQuery.', TRUE);
$_GET['sort'] = 'desc';
$_GET['order'] = 'Id';
@@ -1466,7 +1466,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test TableSort by property: ftid DESC in propertyQuery.'), TRUE);
), 'Test TableSort by property: ftid DESC in propertyQuery.', TRUE);
$_GET['sort'] = 'asc';
$_GET['order'] = 'Type';
@@ -1481,7 +1481,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test TableSort by entity: bundle ASC in propertyQuery.'), TRUE);
), 'Test TableSort by entity: bundle ASC in propertyQuery.', TRUE);
$_GET['sort'] = 'desc';
$_GET['order'] = 'Type';
@@ -1496,7 +1496,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test TableSort by entity: bundle DESC in propertyQuery.'), TRUE);
), 'Test TableSort by entity: bundle DESC in propertyQuery.', TRUE);
// Test TableSort in field storage
$_GET['sort'] = 'asc';
@@ -1518,7 +1518,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test TableSort by property: ftid ASC in field storage.'), TRUE);
), 'Test TableSort by property: ftid ASC in field storage.', TRUE);
$_GET['sort'] = 'desc';
$_GET['order'] = 'Id';
@@ -1534,7 +1534,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test TableSort by property: ftid DESC in field storage.'), TRUE);
), 'Test TableSort by property: ftid DESC in field storage.', TRUE);
$_GET['sort'] = 'asc';
$_GET['order'] = 'Type';
@@ -1551,7 +1551,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 1),
array('test_entity_bundle_key', 6),
array('test_entity_bundle_key', 5),
), t('Test TableSort by entity: bundle ASC in field storage.'), TRUE);
), 'Test TableSort by entity: bundle ASC in field storage.', TRUE);
$_GET['sort'] = 'desc';
$_GET['order'] = 'Type';
@@ -1568,7 +1568,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 4),
), t('Test TableSort by entity: bundle DESC in field storage.'), TRUE);
), 'Test TableSort by entity: bundle DESC in field storage.', TRUE);
$_GET['sort'] = 'asc';
$_GET['order'] = 'Field';
@@ -1584,7 +1584,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 4),
array('test_entity_bundle_key', 5),
array('test_entity_bundle_key', 6),
), t('Test TableSort by field ASC.'), TRUE);
), 'Test TableSort by field ASC.', TRUE);
$_GET['sort'] = 'desc';
$_GET['order'] = 'Field';
@@ -1600,7 +1600,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
array('test_entity_bundle_key', 3),
array('test_entity_bundle_key', 2),
array('test_entity_bundle_key', 1),
), t('Test TableSort by field DESC.'), TRUE);
), 'Test TableSort by field DESC.', TRUE);
unset($_GET['sort']);
unset($_GET['order']);

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -42,7 +42,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
// Set error reporting to collect notices.
variable_set('error_level', ERROR_REPORTING_DISPLAY_ALL);
$this->drupalGet('error-test/generate-warnings');
$this->assertResponse(200, t('Received expected HTTP status code.'));
$this->assertResponse(200, 'Received expected HTTP status code.');
$this->assertErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
@@ -50,7 +50,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
// Set error reporting to not collect notices.
variable_set('error_level', ERROR_REPORTING_DISPLAY_SOME);
$this->drupalGet('error-test/generate-warnings');
$this->assertResponse(200, t('Received expected HTTP status code.'));
$this->assertResponse(200, 'Received expected HTTP status code.');
$this->assertNoErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
@@ -58,7 +58,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
// Set error reporting to not show any errors.
variable_set('error_level', ERROR_REPORTING_HIDE);
$this->drupalGet('error-test/generate-warnings');
$this->assertResponse(200, t('Received expected HTTP status code.'));
$this->assertResponse(200, 'Received expected HTTP status code.');
$this->assertNoErrorMessage($error_notice);
$this->assertNoErrorMessage($error_warning);
$this->assertNoErrorMessage($error_user_notice);
@@ -84,17 +84,17 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
);
$this->drupalGet('error-test/trigger-exception');
$this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), t('Received expected HTTP status line.'));
$this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), 'Received expected HTTP status line.');
$this->assertErrorMessage($error_exception);
$this->drupalGet('error-test/trigger-pdo-exception');
$this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), t('Received expected HTTP status line.'));
$this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), 'Received expected HTTP status line.');
// We cannot use assertErrorMessage() since the extact error reported
// varies from database to database. Check that the SQL string is displayed.
$this->assertText($error_pdo_exception['%type'], t('Found %type in error page.', $error_pdo_exception));
$this->assertText($error_pdo_exception['!message'], t('Found !message in error page.', $error_pdo_exception));
$error_details = t('in %function (line ', $error_pdo_exception);
$this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details)));
$this->assertText($error_pdo_exception['%type'], format_string('Found %type in error page.', $error_pdo_exception));
$this->assertText($error_pdo_exception['!message'], format_string('Found !message in error page.', $error_pdo_exception));
$error_details = format_string('in %function (line ', $error_pdo_exception);
$this->assertRaw($error_details, format_string("Found '!message' in error page.", array('!message' => $error_details)));
}
/**
@@ -102,7 +102,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
*/
function assertErrorMessage(array $error) {
$message = t('%type: !message in %function (line ', $error);
$this->assertRaw($message, t('Found error message: !message.', array('!message' => $message)));
$this->assertRaw($message, format_string('Found error message: !message.', array('!message' => $message)));
}
/**
@@ -110,7 +110,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
*/
function assertNoErrorMessage(array $error) {
$message = t('%type: !message in %function (line ', $error);
$this->assertNoRaw($message, t('Did not find error message: !message.', array('!message' => $message)));
$this->assertNoRaw($message, format_string('Did not find error message: !message.', array('!message' => $message)));
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

File diff suppressed because it is too large Load Diff

View File

@@ -6,8 +6,8 @@ core = 7.x
files[] = file_test.module
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -44,6 +44,8 @@ function filter_test_filter_info() {
}
/**
* Implements callback_filter_process().
*
* Process handler for filter_test_replace filter.
*
* Replaces all text with filter and text format information.

View File

@@ -230,7 +230,7 @@ class FormsTestCase extends DrupalWebTestCase {
// First, try to submit without the required checkbox.
$edit = array();
$this->drupalPost('form-test/checkbox', $edit, t('Submit'));
$this->assertRaw(t('!name field is required.', array('!name' => 'required_checkbox')), t('A required checkbox is actually mandatory'));
$this->assertRaw(t('!name field is required.', array('!name' => 'required_checkbox')), 'A required checkbox is actually mandatory');
// Now try to submit the form correctly.
$values = drupal_json_decode($this->drupalPost(NULL, array('required_checkbox' => 1), t('Submit')));
@@ -243,7 +243,7 @@ class FormsTestCase extends DrupalWebTestCase {
'zero_checkbox_off' => '',
);
foreach ($expected_values as $widget => $expected_value) {
$this->assertEqual($values[$widget], $expected_value, t('Checkbox %widget returns expected value (expected: %expected, got: %value)', array(
$this->assertEqual($values[$widget], $expected_value, format_string('Checkbox %widget returns expected value (expected: %expected, got: %value)', array(
'%widget' => var_export($widget, TRUE),
'%expected' => var_export($expected_value, TRUE),
'%value' => var_export($values[$widget], TRUE),
@@ -307,7 +307,7 @@ class FormsTestCase extends DrupalWebTestCase {
'multiple_no_default_required' => array('three' => 'three'),
);
foreach ($expected as $key => $value) {
$this->assertIdentical($values[$key], $value, t('@name: @actual is equal to @expected.', array(
$this->assertIdentical($values[$key], $value, format_string('@name: @actual is equal to @expected.', array(
'@name' => $key,
'@actual' => var_export($values[$key], TRUE),
'@expected' => var_export($value, TRUE),
@@ -358,7 +358,7 @@ class FormsTestCase extends DrupalWebTestCase {
// All the elements should be marked as disabled, including the ones below
// the disabled container.
$this->assertEqual(count($disabled_elements), 32, t('The correct elements have the disabled property in the HTML code.'));
$this->assertEqual(count($disabled_elements), 32, 'The correct elements have the disabled property in the HTML code.');
$this->drupalPost(NULL, $edit, t('Submit'));
$returned_values['hijacked'] = drupal_json_decode($this->content);
@@ -387,7 +387,7 @@ class FormsTestCase extends DrupalWebTestCase {
// Checkboxes values are not filtered out.
$values[$key] = array_filter($values[$key]);
}
$this->assertIdentical($expected_value, $values[$key], t('Default value for %type: expected %expected, returned %returned.', array('%type' => $key, '%expected' => var_export($expected_value, TRUE), '%returned' => var_export($values[$key], TRUE))));
$this->assertIdentical($expected_value, $values[$key], format_string('Default value for %type: expected %expected, returned %returned.', array('%type' => $key, '%expected' => var_export($expected_value, TRUE), '%returned' => var_export($values[$key], TRUE))));
}
// Recurse children.
@@ -438,7 +438,7 @@ class FormsTestCase extends DrupalWebTestCase {
':div-class' => $class,
':value' => isset($item['#value']) ? $item['#value'] : '',
));
$this->assertTrue(isset($element[0]), t('Disabled form element class found for #type %type.', array('%type' => $item['#type'])));
$this->assertTrue(isset($element[0]), format_string('Disabled form element class found for #type %type.', array('%type' => $item['#type'])));
}
// Verify special element #type text-format.
@@ -446,12 +446,12 @@ class FormsTestCase extends DrupalWebTestCase {
':name' => 'text_format[value]',
':div-class' => 'form-disabled',
));
$this->assertTrue(isset($element[0]), t('Disabled form element class found for #type %type.', array('%type' => 'text_format[value]')));
$this->assertTrue(isset($element[0]), format_string('Disabled form element class found for #type %type.', array('%type' => 'text_format[value]')));
$element = $this->xpath('//div[contains(@class, :div-class)]/descendant::select[@name=:name]', array(
':name' => 'text_format[format]',
':div-class' => 'form-disabled',
));
$this->assertTrue(isset($element[0]), t('Disabled form element class found for #type %type.', array('%type' => 'text_format[format]')));
$this->assertTrue(isset($element[0]), format_string('Disabled form element class found for #type %type.', array('%type' => 'text_format[format]')));
}
/**
@@ -464,7 +464,7 @@ class FormsTestCase extends DrupalWebTestCase {
$checkbox = $this->xpath('//input[@name="checkboxes[two]"]');
$checkbox[0]['value'] = 'FORGERY';
$this->drupalPost(NULL, array('checkboxes[one]' => TRUE, 'checkboxes[two]' => TRUE), t('Submit'));
$this->assertText('An illegal choice has been detected.', t('Input forgery was detected.'));
$this->assertText('An illegal choice has been detected.', 'Input forgery was detected.');
}
}
@@ -521,7 +521,7 @@ class FormElementTestCase extends DrupalWebTestCase {
':id' => 'edit-' . $type . '-foo',
':class' => 'description',
));
$this->assertTrue(count($elements), t('Custom %type option description found.', array(
$this->assertTrue(count($elements), format_string('Custom %type option description found.', array(
'%type' => $type,
)));
}
@@ -558,7 +558,7 @@ class FormAlterTestCase extends DrupalWebTestCase {
'system_form_form_test_alter_form_alter() executed.',
);
$content = preg_replace('/\s+/', ' ', filter_xss($this->content, array()));
$this->assert(strpos($content, implode(' ', $expected)) !== FALSE, t('Form alter hooks executed in the expected order.'));
$this->assert(strpos($content, implode(' ', $expected)) !== FALSE, 'Form alter hooks executed in the expected order.');
}
}
@@ -589,8 +589,8 @@ class FormValidationTestCase extends DrupalWebTestCase {
'name' => 'element_validate',
);
$this->drupalPost(NULL, $edit, 'Save');
$this->assertFieldByName('name', '#value changed by #element_validate', t('Form element #value was altered.'));
$this->assertText('Name value: value changed by form_set_value() in #element_validate', t('Form element value in $form_state was altered.'));
$this->assertFieldByName('name', '#value changed by #element_validate', 'Form element #value was altered.');
$this->assertText('Name value: value changed by form_set_value() in #element_validate', 'Form element value in $form_state was altered.');
// Verify that #validate handlers can alter the form and submitted
// form values.
@@ -598,8 +598,8 @@ class FormValidationTestCase extends DrupalWebTestCase {
'name' => 'validate',
);
$this->drupalPost(NULL, $edit, 'Save');
$this->assertFieldByName('name', '#value changed by #validate', t('Form element #value was altered.'));
$this->assertText('Name value: value changed by form_set_value() in #validate', t('Form element value in $form_state was altered.'));
$this->assertFieldByName('name', '#value changed by #validate', 'Form element #value was altered.');
$this->assertText('Name value: value changed by form_set_value() in #validate', 'Form element value in $form_state was altered.');
// Verify that #element_validate handlers can make form elements
// inaccessible, but values persist.
@@ -607,13 +607,13 @@ class FormValidationTestCase extends DrupalWebTestCase {
'name' => 'element_validate_access',
);
$this->drupalPost(NULL, $edit, 'Save');
$this->assertNoFieldByName('name', t('Form element was hidden.'));
$this->assertText('Name value: element_validate_access', t('Value for inaccessible form element exists.'));
$this->assertNoFieldByName('name', 'Form element was hidden.');
$this->assertText('Name value: element_validate_access', 'Value for inaccessible form element exists.');
// Verify that value for inaccessible form element persists.
$this->drupalPost(NULL, array(), 'Save');
$this->assertNoFieldByName('name', t('Form element was hidden.'));
$this->assertText('Name value: element_validate_access', t('Value for inaccessible form element exists.'));
$this->assertNoFieldByName('name', 'Form element was hidden.');
$this->assertText('Name value: element_validate_access', 'Value for inaccessible form element exists.');
}
/**
@@ -697,57 +697,57 @@ class FormsElementsLabelsTestCase extends DrupalWebTestCase {
// Check that the checkbox/radio processing is not interfering with
// basic placement.
$elements = $this->xpath('//input[@id="edit-form-checkboxes-test-third-checkbox"]/following-sibling::label[@for="edit-form-checkboxes-test-third-checkbox" and @class="option"]');
$this->assertTrue(isset($elements[0]), t("Label follows field and label option class correct for regular checkboxes."));
$this->assertTrue(isset($elements[0]), "Label follows field and label option class correct for regular checkboxes.");
// Make sure the label is rendered for checkboxes.
$elements = $this->xpath('//input[@id="edit-form-checkboxes-test-0"]/following-sibling::label[@for="edit-form-checkboxes-test-0" and @class="option"]');
$this->assertTrue(isset($elements[0]), t("Label 0 found checkbox."));
$this->assertTrue(isset($elements[0]), "Label 0 found checkbox.");
$elements = $this->xpath('//input[@id="edit-form-radios-test-second-radio"]/following-sibling::label[@for="edit-form-radios-test-second-radio" and @class="option"]');
$this->assertTrue(isset($elements[0]), t("Label follows field and label option class correct for regular radios."));
$this->assertTrue(isset($elements[0]), "Label follows field and label option class correct for regular radios.");
// Make sure the label is rendered for radios.
$elements = $this->xpath('//input[@id="edit-form-radios-test-0"]/following-sibling::label[@for="edit-form-radios-test-0" and @class="option"]');
$this->assertTrue(isset($elements[0]), t("Label 0 found radios."));
$this->assertTrue(isset($elements[0]), "Label 0 found radios.");
// Exercise various defaults for checkboxes and modifications to ensure
// appropriate override and correct behavior.
$elements = $this->xpath('//input[@id="edit-form-checkbox-test"]/following-sibling::label[@for="edit-form-checkbox-test" and @class="option"]');
$this->assertTrue(isset($elements[0]), t("Label follows field and label option class correct for a checkbox by default."));
$this->assertTrue(isset($elements[0]), "Label follows field and label option class correct for a checkbox by default.");
// Exercise various defaults for textboxes and modifications to ensure
// appropriate override and correct behavior.
$elements = $this->xpath('//label[@for="edit-form-textfield-test-title-and-required"]/child::span[@class="form-required"]/parent::*/following-sibling::input[@id="edit-form-textfield-test-title-and-required"]');
$this->assertTrue(isset($elements[0]), t("Label precedes textfield, with required marker inside label."));
$this->assertTrue(isset($elements[0]), "Label precedes textfield, with required marker inside label.");
$elements = $this->xpath('//input[@id="edit-form-textfield-test-no-title-required"]/preceding-sibling::label[@for="edit-form-textfield-test-no-title-required"]/span[@class="form-required"]');
$this->assertTrue(isset($elements[0]), t("Label tag with required marker precedes required textfield with no title."));
$this->assertTrue(isset($elements[0]), "Label tag with required marker precedes required textfield with no title.");
$elements = $this->xpath('//input[@id="edit-form-textfield-test-title-invisible"]/preceding-sibling::label[@for="edit-form-textfield-test-title-invisible" and @class="element-invisible"]');
$this->assertTrue(isset($elements[0]), t("Label preceding field and label class is element-invisible."));
$this->assertTrue(isset($elements[0]), "Label preceding field and label class is element-invisible.");
$elements = $this->xpath('//input[@id="edit-form-textfield-test-title"]/preceding-sibling::span[@class="form-required"]');
$this->assertFalse(isset($elements[0]), t("No required marker on non-required field."));
$this->assertFalse(isset($elements[0]), "No required marker on non-required field.");
$elements = $this->xpath('//input[@id="edit-form-textfield-test-title-after"]/following-sibling::label[@for="edit-form-textfield-test-title-after" and @class="option"]');
$this->assertTrue(isset($elements[0]), t("Label after field and label option class correct for text field."));
$this->assertTrue(isset($elements[0]), "Label after field and label option class correct for text field.");
$elements = $this->xpath('//label[@for="edit-form-textfield-test-title-no-show"]');
$this->assertFalse(isset($elements[0]), t("No label tag when title set not to display."));
$this->assertFalse(isset($elements[0]), "No label tag when title set not to display.");
// Check #field_prefix and #field_suffix placement.
$elements = $this->xpath('//span[@class="field-prefix"]/following-sibling::div[@id="edit-form-radios-test"]');
$this->assertTrue(isset($elements[0]), t("Properly placed the #field_prefix element after the label and before the field."));
$this->assertTrue(isset($elements[0]), "Properly placed the #field_prefix element after the label and before the field.");
$elements = $this->xpath('//span[@class="field-suffix"]/preceding-sibling::div[@id="edit-form-radios-test"]');
$this->assertTrue(isset($elements[0]), t("Properly places the #field_suffix element immediately after the form field."));
$this->assertTrue(isset($elements[0]), "Properly places the #field_suffix element immediately after the form field.");
// Check #prefix and #suffix placement.
$elements = $this->xpath('//div[@id="form-test-textfield-title-prefix"]/following-sibling::div[contains(@class, \'form-item-form-textfield-test-title\')]');
$this->assertTrue(isset($elements[0]), t("Properly places the #prefix element before the form item."));
$this->assertTrue(isset($elements[0]), "Properly places the #prefix element before the form item.");
$elements = $this->xpath('//div[@id="form-test-textfield-title-suffix"]/preceding-sibling::div[contains(@class, \'form-item-form-textfield-test-title\')]');
$this->assertTrue(isset($elements[0]), t("Properly places the #suffix element before the form item."));
$this->assertTrue(isset($elements[0]), "Properly places the #suffix element before the form item.");
// Check title attribute for radios and checkboxes.
$elements = $this->xpath('//div[@id="edit-form-checkboxes-title-attribute"]');
@@ -782,14 +782,14 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
$this->drupalGet('form_test/tableselect/multiple-true');
$this->assertNoText(t('Empty text.'), t('Empty text should not be displayed.'));
$this->assertNoText(t('Empty text.'), 'Empty text should not be displayed.');
// Test for the presence of the Select all rows tableheader.
$this->assertFieldByXPath('//th[@class="select-all"]', NULL, t('Presence of the "Select all" checkbox.'));
$this->assertFieldByXPath('//th[@class="select-all"]', NULL, 'Presence of the "Select all" checkbox.');
$rows = array('row1', 'row2', 'row3');
foreach ($rows as $row) {
$this->assertFieldByXPath('//input[@type="checkbox"]', $row, t('Checkbox for value @row.', array('@row' => $row)));
$this->assertFieldByXPath('//input[@type="checkbox"]', $row, format_string('Checkbox for value @row.', array('@row' => $row)));
}
}
@@ -799,14 +799,14 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
function testMultipleFalse() {
$this->drupalGet('form_test/tableselect/multiple-false');
$this->assertNoText(t('Empty text.'), t('Empty text should not be displayed.'));
$this->assertNoText(t('Empty text.'), 'Empty text should not be displayed.');
// Test for the absence of the Select all rows tableheader.
$this->assertNoFieldByXPath('//th[@class="select-all"]', '', t('Absence of the "Select all" checkbox.'));
$this->assertNoFieldByXPath('//th[@class="select-all"]', '', 'Absence of the "Select all" checkbox.');
$rows = array('row1', 'row2', 'row3');
foreach ($rows as $row) {
$this->assertFieldByXPath('//input[@type="radio"]', $row, t('Radio button for value @row.', array('@row' => $row)));
$this->assertFieldByXPath('//input[@type="radio"]', $row, format_string('Radio button for value @row.', array('@row' => $row)));
}
}
@@ -815,7 +815,7 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
*/
function testEmptyText() {
$this->drupalGet('form_test/tableselect/empty-text');
$this->assertText(t('Empty text.'), t('Empty text should be displayed.'));
$this->assertText(t('Empty text.'), 'Empty text should be displayed.');
}
/**
@@ -828,18 +828,18 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
$edit['tableselect[row1]'] = TRUE;
$this->drupalPost('form_test/tableselect/multiple-true', $edit, 'Submit');
$this->assertText(t('Submitted: row1 = row1'), t('Checked checkbox row1'));
$this->assertText(t('Submitted: row2 = 0'), t('Unchecked checkbox row2.'));
$this->assertText(t('Submitted: row3 = 0'), t('Unchecked checkbox row3.'));
$this->assertText(t('Submitted: row1 = row1'), 'Checked checkbox row1');
$this->assertText(t('Submitted: row2 = 0'), 'Unchecked checkbox row2.');
$this->assertText(t('Submitted: row3 = 0'), 'Unchecked checkbox row3.');
// Test a submission with multiple checkboxes checked.
$edit['tableselect[row1]'] = TRUE;
$edit['tableselect[row3]'] = TRUE;
$this->drupalPost('form_test/tableselect/multiple-true', $edit, 'Submit');
$this->assertText(t('Submitted: row1 = row1'), t('Checked checkbox row1.'));
$this->assertText(t('Submitted: row2 = 0'), t('Unchecked checkbox row2.'));
$this->assertText(t('Submitted: row3 = row3'), t('Checked checkbox row3.'));
$this->assertText(t('Submitted: row1 = row1'), 'Checked checkbox row1.');
$this->assertText(t('Submitted: row2 = 0'), 'Unchecked checkbox row2.');
$this->assertText(t('Submitted: row3 = row3'), 'Checked checkbox row3.');
}
@@ -849,7 +849,7 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
function testMultipleFalseSubmit() {
$edit['tableselect'] = 'row1';
$this->drupalPost('form_test/tableselect/multiple-false', $edit, 'Submit');
$this->assertText(t('Submitted: row1'), t('Selected radio button'));
$this->assertText(t('Submitted: row1'), 'Selected radio button');
}
/**
@@ -858,18 +858,18 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
function testAdvancedSelect() {
// When #multiple = TRUE a Select all checkbox should be displayed by default.
$this->drupalGet('form_test/tableselect/advanced-select/multiple-true-default');
$this->assertFieldByXPath('//th[@class="select-all"]', NULL, t('Display a "Select all" checkbox by default when #multiple is TRUE.'));
$this->assertFieldByXPath('//th[@class="select-all"]', NULL, 'Display a "Select all" checkbox by default when #multiple is TRUE.');
// When #js_select is set to FALSE, a "Select all" checkbox should not be displayed.
$this->drupalGet('form_test/tableselect/advanced-select/multiple-true-no-advanced-select');
$this->assertNoFieldByXPath('//th[@class="select-all"]', NULL, t('Do not display a "Select all" checkbox when #js_select is FALSE.'));
$this->assertNoFieldByXPath('//th[@class="select-all"]', NULL, 'Do not display a "Select all" checkbox when #js_select is FALSE.');
// A "Select all" checkbox never makes sense when #multiple = FALSE, regardless of the value of #js_select.
$this->drupalGet('form_test/tableselect/advanced-select/multiple-false-default');
$this->assertNoFieldByXPath('//th[@class="select-all"]', NULL, t('Do not display a "Select all" checkbox when #multiple is FALSE.'));
$this->assertNoFieldByXPath('//th[@class="select-all"]', NULL, 'Do not display a "Select all" checkbox when #multiple is FALSE.');
$this->drupalGet('form_test/tableselect/advanced-select/multiple-false-advanced-select');
$this->assertNoFieldByXPath('//th[@class="select-all"]', NULL, t('Do not display a "Select all" checkbox when #multiple is FALSE, even when #js_select is TRUE.'));
$this->assertNoFieldByXPath('//th[@class="select-all"]', NULL, 'Do not display a "Select all" checkbox when #multiple is FALSE, even when #js_select is TRUE.');
}
@@ -888,11 +888,11 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
// Test with a valid value.
list($processed_form, $form_state, $errors) = $this->formSubmitHelper($form, array('tableselect' => array('row1' => 'row1')));
$this->assertFalse(isset($errors['tableselect']), t('Option checker allows valid values for checkboxes.'));
$this->assertFalse(isset($errors['tableselect']), 'Option checker allows valid values for checkboxes.');
// Test with an invalid value.
list($processed_form, $form_state, $errors) = $this->formSubmitHelper($form, array('tableselect' => array('non_existing_value' => 'non_existing_value')));
$this->assertTrue(isset($errors['tableselect']), t('Option checker disallows invalid values for checkboxes.'));
$this->assertTrue(isset($errors['tableselect']), 'Option checker disallows invalid values for checkboxes.');
}
@@ -913,11 +913,11 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
// Test with a valid value.
list($processed_form, $form_state, $errors) = $this->formSubmitHelper($form, array('tableselect' => 'row1'));
$this->assertFalse(isset($errors['tableselect']), t('Option checker allows valid values for radio buttons.'));
$this->assertFalse(isset($errors['tableselect']), 'Option checker allows valid values for radio buttons.');
// Test with an invalid value.
list($processed_form, $form_state, $errors) = $this->formSubmitHelper($form, array('tableselect' => 'non_existing_value'));
$this->assertTrue(isset($errors['tableselect']), t('Option checker disallows invalid values for radio buttons.'));
$this->assertTrue(isset($errors['tableselect']), 'Option checker disallows invalid values for radio buttons.');
}
@@ -984,7 +984,7 @@ class FormsElementsVerticalTabsFunctionalTest extends DrupalWebTestCase {
$this->drupalGet('form_test/vertical-tabs');
$position1 = strpos($this->content, 'misc/vertical-tabs.js');
$position2 = strpos($this->content, 'misc/collapse.js');
$this->assertTrue($position1 !== FALSE && $position2 !== FALSE && $position1 < $position2, t('vertical-tabs.js is included before collapse.js'));
$this->assertTrue($position1 !== FALSE && $position2 !== FALSE && $position1 < $position2, 'vertical-tabs.js is included before collapse.js');
}
}
@@ -1037,7 +1037,7 @@ class FormsFormStorageTestCase extends DrupalWebTestCase {
$this->drupalPost(NULL, $edit, 'Save');
$this->assertText('Form constructions: 4');
$this->assertText('Title: new', t('The form storage has stored the values.'));
$this->assertText('Title: new', 'The form storage has stored the values.');
}
/**
@@ -1061,7 +1061,7 @@ class FormsFormStorageTestCase extends DrupalWebTestCase {
$this->drupalPost(NULL, $edit, 'Save');
$this->assertText('Form constructions: 3');
$this->assertText('Title: new', t('The form storage has stored the values.'));
$this->assertText('Title: new', 'The form storage has stored the values.');
}
/**
@@ -1069,7 +1069,7 @@ class FormsFormStorageTestCase extends DrupalWebTestCase {
*/
function testValidation() {
$this->drupalPost('form_test/form-storage', array('title' => '', 'value' => 'value_is_set'), 'Continue submit');
$this->assertPattern('/value_is_set/', t('The input values have been kept.'));
$this->assertPattern('/value_is_set/', 'The input values have been kept.');
}
/**
@@ -1159,8 +1159,8 @@ class FormsFormWrapperTestCase extends DrupalWebTestCase {
*/
function testWrapperCallback() {
$this->drupalGet('form_test/wrapper-callback');
$this->assertText('Form wrapper callback element output.', t('The form contains form wrapper elements.'));
$this->assertText('Form builder element output.', t('The form contains form builder elements.'));
$this->assertText('Form wrapper callback element output.', 'The form contains form wrapper elements.');
$this->assertText('Form builder element output.', 'The form contains form builder elements.');
}
}
@@ -1193,22 +1193,22 @@ class FormStateValuesCleanTestCase extends DrupalWebTestCase {
);
// Verify that all internal Form API elements were removed.
$this->assertFalse(isset($values['form_id']), t('%element was removed.', array('%element' => 'form_id')));
$this->assertFalse(isset($values['form_token']), t('%element was removed.', array('%element' => 'form_token')));
$this->assertFalse(isset($values['form_build_id']), t('%element was removed.', array('%element' => 'form_build_id')));
$this->assertFalse(isset($values['op']), t('%element was removed.', array('%element' => 'op')));
$this->assertFalse(isset($values['form_id']), format_string('%element was removed.', array('%element' => 'form_id')));
$this->assertFalse(isset($values['form_token']), format_string('%element was removed.', array('%element' => 'form_token')));
$this->assertFalse(isset($values['form_build_id']), format_string('%element was removed.', array('%element' => 'form_build_id')));
$this->assertFalse(isset($values['op']), format_string('%element was removed.', array('%element' => 'op')));
// Verify that all buttons were removed.
$this->assertFalse(isset($values['foo']), t('%element was removed.', array('%element' => 'foo')));
$this->assertFalse(isset($values['bar']), t('%element was removed.', array('%element' => 'bar')));
$this->assertFalse(isset($values['baz']['foo']), t('%element was removed.', array('%element' => 'foo')));
$this->assertFalse(isset($values['baz']['baz']), t('%element was removed.', array('%element' => 'baz')));
$this->assertFalse(isset($values['foo']), format_string('%element was removed.', array('%element' => 'foo')));
$this->assertFalse(isset($values['bar']), format_string('%element was removed.', array('%element' => 'bar')));
$this->assertFalse(isset($values['baz']['foo']), format_string('%element was removed.', array('%element' => 'foo')));
$this->assertFalse(isset($values['baz']['baz']), format_string('%element was removed.', array('%element' => 'baz')));
// Verify that nested form value still exists.
$this->assertTrue(isset($values['baz']['beer']), t('Nested form value still exists.'));
$this->assertTrue(isset($values['baz']['beer']), 'Nested form value still exists.');
// Verify that actual form values equal resulting form values.
$this->assertEqual($values, $result, t('Expected form values equal actual form values.'));
$this->assertEqual($values, $result, 'Expected form values equal actual form values.');
}
}
@@ -1243,7 +1243,7 @@ class FormStateValuesCleanAdvancedTestCase extends DrupalWebTestCase {
$this->image = current($image_files);
// Check if the physical file is there.
$this->assertTrue(is_file($this->image->uri), t("The image file we're going to upload exists."));
$this->assertTrue(is_file($this->image->uri), "The image file we're going to upload exists.");
// "Browse" for the desired file.
$edit = array('files[image]' => drupal_realpath($this->image->uri));
@@ -1252,8 +1252,8 @@ class FormStateValuesCleanAdvancedTestCase extends DrupalWebTestCase {
$this->drupalPost('form_test/form-state-values-clean-advanced', $edit, t('Submit'));
// Expecting a 200 HTTP code.
$this->assertResponse(200, t('Received a 200 response for posted test file.'));
$this->assertRaw(t('You WIN!'), t('Found the success message.'));
$this->assertResponse(200, 'Received a 200 response for posted test file.');
$this->assertRaw(t('You WIN!'), 'Found the success message.');
}
}
@@ -1290,14 +1290,14 @@ class FormsRebuildTestCase extends DrupalWebTestCase {
$this->drupalPost('form-test/form-rebuild-preserve-values', $edit, 'Add more');
// Verify that initial elements retained their submitted values.
$this->assertFieldChecked('edit-checkbox-1-default-off', t('A submitted checked checkbox retained its checked state during a rebuild.'));
$this->assertNoFieldChecked('edit-checkbox-1-default-on', t('A submitted unchecked checkbox retained its unchecked state during a rebuild.'));
$this->assertFieldById('edit-text-1', 'foo', t('A textfield retained its submitted value during a rebuild.'));
$this->assertFieldChecked('edit-checkbox-1-default-off', 'A submitted checked checkbox retained its checked state during a rebuild.');
$this->assertNoFieldChecked('edit-checkbox-1-default-on', 'A submitted unchecked checkbox retained its unchecked state during a rebuild.');
$this->assertFieldById('edit-text-1', 'foo', 'A textfield retained its submitted value during a rebuild.');
// Verify that newly added elements were initialized with their default values.
$this->assertFieldChecked('edit-checkbox-2-default-on', t('A newly added checkbox was initialized with a default checked state.'));
$this->assertNoFieldChecked('edit-checkbox-2-default-off', t('A newly added checkbox was initialized with a default unchecked state.'));
$this->assertFieldById('edit-text-2', 'DEFAULT 2', t('A newly added textfield was initialized with its default value.'));
$this->assertFieldChecked('edit-checkbox-2-default-on', 'A newly added checkbox was initialized with a default checked state.');
$this->assertNoFieldChecked('edit-checkbox-2-default-off', 'A newly added checkbox was initialized with a default unchecked state.');
$this->assertFieldById('edit-text-2', 'DEFAULT 2', 'A newly added textfield was initialized with its default value.');
}
/**
@@ -1331,7 +1331,7 @@ class FormsRebuildTestCase extends DrupalWebTestCase {
// field items in the field for which we just added an item.
$this->drupalGet('node/add/page');
$this->drupalPostAJAX(NULL, array(), array('field_ajax_test_add_more' => t('Add another item')), 'system/ajax', array(), array(), 'page-node-form');
$this->assert(count($this->xpath('//div[contains(@class, "field-name-field-ajax-test")]//input[@type="text"]')) == 2, t('AJAX submission succeeded.'));
$this->assert(count($this->xpath('//div[contains(@class, "field-name-field-ajax-test")]//input[@type="text"]')) == 2, 'AJAX submission succeeded.');
// Submit the form with the non-Ajax "Save" button, leaving the title field
// blank to trigger a validation error, and ensure that a validation error
@@ -1339,15 +1339,15 @@ class FormsRebuildTestCase extends DrupalWebTestCase {
// re-rendered without being re-built, which is what happens when there's
// a validation error.
$this->drupalPost(NULL, array(), t('Save'));
$this->assertText('Title field is required.', t('Non-AJAX submission correctly triggered a validation error.'));
$this->assertText('Title field is required.', 'Non-AJAX submission correctly triggered a validation error.');
// Ensure that the form contains two items in the multi-valued field, so we
// know we're testing a form that was correctly retrieved from cache.
$this->assert(count($this->xpath('//form[contains(@id, "page-node-form")]//div[contains(@class, "form-item-field-ajax-test")]//input[@type="text"]')) == 2, t('Form retained its state from cache.'));
$this->assert(count($this->xpath('//form[contains(@id, "page-node-form")]//div[contains(@class, "form-item-field-ajax-test")]//input[@type="text"]')) == 2, 'Form retained its state from cache.');
// Ensure that the form's action is correct.
$forms = $this->xpath('//form[contains(@class, "node-page-form")]');
$this->assert(count($forms) == 1 && $forms[0]['action'] == url('node/add/page'), t('Re-rendered form contains the correct action value.'));
$this->assert(count($forms) == 1 && $forms[0]['action'] == url('node/add/page'), 'Re-rendered form contains the correct action value.');
}
}
@@ -1501,7 +1501,7 @@ class FormsProgrammaticTestCase extends DrupalWebTestCase {
'%values' => print_r($values, TRUE),
'%errors' => $valid_form ? t('None') : implode(' ', $errors),
);
$this->assertTrue($valid_input == $valid_form, t('Input values: %values<br/>Validation handler errors: %errors', $args));
$this->assertTrue($valid_input == $valid_form, format_string('Input values: %values<br/>Validation handler errors: %errors', $args));
// We check submitted values only if we have a valid input.
if ($valid_input) {
@@ -1509,7 +1509,7 @@ class FormsProgrammaticTestCase extends DrupalWebTestCase {
// submission handler was properly executed.
$stored_values = $form_state['storage']['programmatic_form_submit'];
foreach ($values as $key => $value) {
$this->assertTrue(isset($stored_values[$key]) && $stored_values[$key] == $value, t('Submission handler correctly executed: %stored_key is %stored_value', array('%stored_key' => $key, '%stored_value' => print_r($value, TRUE))));
$this->assertTrue(isset($stored_values[$key]) && $stored_values[$key] == $value, format_string('Submission handler correctly executed: %stored_key is %stored_value', array('%stored_key' => $key, '%stored_value' => print_r($value, TRUE))));
}
}
}
@@ -1546,24 +1546,24 @@ class FormsTriggeringElementTestCase extends DrupalWebTestCase {
// $form_state['triggering_element'] and the form submit handler not
// running.
$this->drupalPost($path, $edit, NULL, array(), array(), $form_html_id);
$this->assertText('There is no clicked button.', t('$form_state[\'triggering_element\'] set to NULL.'));
$this->assertNoText('Submit handler for form_test_clicked_button executed.', t('Form submit handler did not execute.'));
$this->assertText('There is no clicked button.', '$form_state[\'triggering_element\'] set to NULL.');
$this->assertNoText('Submit handler for form_test_clicked_button executed.', 'Form submit handler did not execute.');
// Ensure submitting a form with one or more submit buttons results in
// $form_state['triggering_element'] being set to the first one the user has
// access to. An argument with 'r' in it indicates a restricted
// (#access=FALSE) button.
$this->drupalPost($path . '/s', $edit, NULL, array(), array(), $form_html_id);
$this->assertText('The clicked button is button1.', t('$form_state[\'triggering_element\'] set to only button.'));
$this->assertText('Submit handler for form_test_clicked_button executed.', t('Form submit handler executed.'));
$this->assertText('The clicked button is button1.', '$form_state[\'triggering_element\'] set to only button.');
$this->assertText('Submit handler for form_test_clicked_button executed.', 'Form submit handler executed.');
$this->drupalPost($path . '/s/s', $edit, NULL, array(), array(), $form_html_id);
$this->assertText('The clicked button is button1.', t('$form_state[\'triggering_element\'] set to first button.'));
$this->assertText('Submit handler for form_test_clicked_button executed.', t('Form submit handler executed.'));
$this->assertText('The clicked button is button1.', '$form_state[\'triggering_element\'] set to first button.');
$this->assertText('Submit handler for form_test_clicked_button executed.', 'Form submit handler executed.');
$this->drupalPost($path . '/rs/s', $edit, NULL, array(), array(), $form_html_id);
$this->assertText('The clicked button is button2.', t('$form_state[\'triggering_element\'] set to first available button.'));
$this->assertText('Submit handler for form_test_clicked_button executed.', t('Form submit handler executed.'));
$this->assertText('The clicked button is button2.', '$form_state[\'triggering_element\'] set to first available button.');
$this->assertText('Submit handler for form_test_clicked_button executed.', 'Form submit handler executed.');
// Ensure submitting a form with buttons of different types results in
// $form_state['triggering_element'] being set to the first button,
@@ -1571,16 +1571,16 @@ class FormsTriggeringElementTestCase extends DrupalWebTestCase {
// submit handler not executing. The types are 's'(ubmit), 'b'(utton), and
// 'i'(mage_button).
$this->drupalPost($path . '/s/b/i', $edit, NULL, array(), array(), $form_html_id);
$this->assertText('The clicked button is button1.', t('$form_state[\'triggering_element\'] set to first button.'));
$this->assertText('Submit handler for form_test_clicked_button executed.', t('Form submit handler executed.'));
$this->assertText('The clicked button is button1.', '$form_state[\'triggering_element\'] set to first button.');
$this->assertText('Submit handler for form_test_clicked_button executed.', 'Form submit handler executed.');
$this->drupalPost($path . '/b/s/i', $edit, NULL, array(), array(), $form_html_id);
$this->assertText('The clicked button is button1.', t('$form_state[\'triggering_element\'] set to first button.'));
$this->assertNoText('Submit handler for form_test_clicked_button executed.', t('Form submit handler did not execute.'));
$this->assertText('The clicked button is button1.', '$form_state[\'triggering_element\'] set to first button.');
$this->assertNoText('Submit handler for form_test_clicked_button executed.', 'Form submit handler did not execute.');
$this->drupalPost($path . '/i/s/b', $edit, NULL, array(), array(), $form_html_id);
$this->assertText('The clicked button is button1.', t('$form_state[\'triggering_element\'] set to first button.'));
$this->assertText('Submit handler for form_test_clicked_button executed.', t('Form submit handler executed.'));
$this->assertText('The clicked button is button1.', '$form_state[\'triggering_element\'] set to first button.');
$this->assertText('Submit handler for form_test_clicked_button executed.', 'Form submit handler executed.');
}
/**
@@ -1608,8 +1608,8 @@ class FormsTriggeringElementTestCase extends DrupalWebTestCase {
// because negative assertions alone can be brittle. See
// testNoButtonInfoInPost() for why the triggering element gets set to
// 'button2'.
$this->assertNoText('The clicked button is button1.', t('$form_state[\'triggering_element\'] not set to a restricted button.'));
$this->assertText('The clicked button is button2.', t('$form_state[\'triggering_element\'] not set to a restricted button.'));
$this->assertNoText('The clicked button is button1.', '$form_state[\'triggering_element\'] not set to a restricted button.');
$this->assertText('The clicked button is button2.', '$form_state[\'triggering_element\'] not set to a restricted button.');
}
}
@@ -1759,7 +1759,7 @@ class FormCheckboxTestCase extends DrupalWebTestCase {
$checked = ($default_value === '1foobar');
}
$checked_in_html = strpos($form, 'checked') !== FALSE;
$message = t('#default_value is %default_value #return_value is %return_value.', array('%default_value' => var_export($default_value, TRUE), '%return_value' => var_export($return_value, TRUE)));
$message = format_string('#default_value is %default_value #return_value is %return_value.', array('%default_value' => var_export($default_value, TRUE), '%return_value' => var_export($return_value, TRUE)));
$this->assertIdentical($checked, $checked_in_html, $message);
}
}
@@ -1767,12 +1767,12 @@ class FormCheckboxTestCase extends DrupalWebTestCase {
// Ensure that $form_state['values'] is populated correctly for a checkboxes
// group that includes a 0-indexed array of options.
$results = json_decode($this->drupalPost('form-test/checkboxes-zero', array(), 'Save'));
$this->assertIdentical($results->checkbox_off, array(0, 0, 0), t('All three in checkbox_off are zeroes: off.'));
$this->assertIdentical($results->checkbox_zero_default, array('0', 0, 0), t('The first choice is on in checkbox_zero_default'));
$this->assertIdentical($results->checkbox_string_zero_default, array('0', 0, 0), t('The first choice is on in checkbox_string_zero_default'));
$this->assertIdentical($results->checkbox_off, array(0, 0, 0), 'All three in checkbox_off are zeroes: off.');
$this->assertIdentical($results->checkbox_zero_default, array('0', 0, 0), 'The first choice is on in checkbox_zero_default');
$this->assertIdentical($results->checkbox_string_zero_default, array('0', 0, 0), 'The first choice is on in checkbox_string_zero_default');
$edit = array('checkbox_off[0]' => '0');
$results = json_decode($this->drupalPost('form-test/checkboxes-zero', $edit, 'Save'));
$this->assertIdentical($results->checkbox_off, array('0', 0, 0), t('The first choice is on in checkbox_off but the rest is not'));
$this->assertIdentical($results->checkbox_off, array('0', 0, 0), 'The first choice is on in checkbox_off but the rest is not');
// Ensure that each checkbox is rendered correctly for a checkboxes group
// that includes a 0-indexed array of options.
@@ -1781,7 +1781,7 @@ class FormCheckboxTestCase extends DrupalWebTestCase {
foreach ($checkboxes as $checkbox) {
$checked = isset($checkbox['checked']);
$name = (string) $checkbox['name'];
$this->assertIdentical($checked, $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', t('Checkbox %name correctly checked', array('%name' => $name)));
$this->assertIdentical($checked, $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', format_string('Checkbox %name correctly checked', array('%name' => $name)));
}
$edit = array('checkbox_off[0]' => '0');
$this->drupalPost('form-test/checkboxes-zero/0', $edit, 'Save');
@@ -1789,7 +1789,7 @@ class FormCheckboxTestCase extends DrupalWebTestCase {
foreach ($checkboxes as $checkbox) {
$checked = isset($checkbox['checked']);
$name = (string) $checkbox['name'];
$this->assertIdentical($checked, $name == 'checkbox_off[0]' || $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', t('Checkbox %name correctly checked', array('%name' => $name)));
$this->assertIdentical($checked, $name == 'checkbox_off[0]' || $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', format_string('Checkbox %name correctly checked', array('%name' => $name)));
}
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -69,7 +69,7 @@ class GraphUnitTest extends DrupalUnitTestCase {
$this->assertReversePaths($graph, $expected_reverse_paths);
// Assert that DFS didn't created "missing" vertexes automatically.
$this->assertFALSE(isset($graph[6]), t('Vertex 6 has not been created'));
$this->assertFALSE(isset($graph[6]), 'Vertex 6 has not been created');
$expected_components = array(
array(1, 2, 3, 4, 5, 7),
@@ -115,7 +115,7 @@ class GraphUnitTest extends DrupalUnitTestCase {
// Build an array with keys = $paths and values = TRUE.
$expected = array_fill_keys($paths, TRUE);
$result = isset($graph[$vertex]['paths']) ? $graph[$vertex]['paths'] : array();
$this->assertEqual($expected, $result, t('Expected paths for vertex @vertex: @expected-paths, got @paths', array('@vertex' => $vertex, '@expected-paths' => $this->displayArray($expected, TRUE), '@paths' => $this->displayArray($result, TRUE))));
$this->assertEqual($expected, $result, format_string('Expected paths for vertex @vertex: @expected-paths, got @paths', array('@vertex' => $vertex, '@expected-paths' => $this->displayArray($expected, TRUE), '@paths' => $this->displayArray($result, TRUE))));
}
}
@@ -133,7 +133,7 @@ class GraphUnitTest extends DrupalUnitTestCase {
// Build an array with keys = $paths and values = TRUE.
$expected = array_fill_keys($paths, TRUE);
$result = isset($graph[$vertex]['reverse_paths']) ? $graph[$vertex]['reverse_paths'] : array();
$this->assertEqual($expected, $result, t('Expected reverse paths for vertex @vertex: @expected-paths, got @paths', array('@vertex' => $vertex, '@expected-paths' => $this->displayArray($expected, TRUE), '@paths' => $this->displayArray($result, TRUE))));
$this->assertEqual($expected, $result, format_string('Expected reverse paths for vertex @vertex: @expected-paths, got @paths', array('@vertex' => $vertex, '@expected-paths' => $this->displayArray($expected, TRUE), '@paths' => $this->displayArray($result, TRUE))));
}
}
@@ -153,9 +153,9 @@ class GraphUnitTest extends DrupalUnitTestCase {
$result_components[] = $graph[$vertex]['component'];
unset($unassigned_vertices[$vertex]);
}
$this->assertEqual(1, count(array_unique($result_components)), t('Expected one unique component for vertices @vertices, got @components', array('@vertices' => $this->displayArray($component), '@components' => $this->displayArray($result_components))));
$this->assertEqual(1, count(array_unique($result_components)), format_string('Expected one unique component for vertices @vertices, got @components', array('@vertices' => $this->displayArray($component), '@components' => $this->displayArray($result_components))));
}
$this->assertEqual(array(), $unassigned_vertices, t('Vertices not assigned to a component: @vertices', array('@vertices' => $this->displayArray($unassigned_vertices, TRUE))));
$this->assertEqual(array(), $unassigned_vertices, format_string('Vertices not assigned to a component: @vertices', array('@vertices' => $this->displayArray($unassigned_vertices, TRUE))));
}
/**
@@ -170,7 +170,7 @@ class GraphUnitTest extends DrupalUnitTestCase {
foreach ($expected_orders as $order) {
$previous_vertex = array_shift($order);
foreach ($order as $vertex) {
$this->assertTrue($graph[$previous_vertex]['weight'] < $graph[$vertex]['weight'], t('Weights of @previous-vertex and @vertex are correct relative to each other', array('@previous-vertex' => $previous_vertex, '@vertex' => $vertex)));
$this->assertTrue($graph[$previous_vertex]['weight'] < $graph[$vertex]['weight'], format_string('Weights of @previous-vertex and @vertex are correct relative to each other', array('@previous-vertex' => $previous_vertex, '@vertex' => $vertex)));
}
}
}

View File

@@ -55,19 +55,19 @@ class ImageToolkitTestCase extends DrupalWebTestCase {
// Determine if there were any expected that were not called.
$uncalled = array_diff($expected, $actual);
if (count($uncalled)) {
$this->assertTrue(FALSE, t('Expected operations %expected to be called but %uncalled was not called.', array('%expected' => implode(', ', $expected), '%uncalled' => implode(', ', $uncalled))));
$this->assertTrue(FALSE, format_string('Expected operations %expected to be called but %uncalled was not called.', array('%expected' => implode(', ', $expected), '%uncalled' => implode(', ', $uncalled))));
}
else {
$this->assertTrue(TRUE, t('All the expected operations were called: %expected', array('%expected' => implode(', ', $expected))));
$this->assertTrue(TRUE, format_string('All the expected operations were called: %expected', array('%expected' => implode(', ', $expected))));
}
// Determine if there were any unexpected calls.
$unexpected = array_diff($actual, $expected);
if (count($unexpected)) {
$this->assertTrue(FALSE, t('Unexpected operations were called: %unexpected.', array('%unexpected' => implode(', ', $unexpected))));
$this->assertTrue(FALSE, format_string('Unexpected operations were called: %unexpected.', array('%unexpected' => implode(', ', $unexpected))));
}
else {
$this->assertTrue(TRUE, t('No unexpected operations were called.'));
$this->assertTrue(TRUE, 'No unexpected operations were called.');
}
}
}
@@ -90,8 +90,8 @@ class ImageToolkitUnitTest extends ImageToolkitTestCase {
*/
function testGetAvailableToolkits() {
$toolkits = image_get_available_toolkits();
$this->assertTrue(isset($toolkits['test']), t('The working toolkit was returned.'));
$this->assertFalse(isset($toolkits['broken']), t('The toolkit marked unavailable was not returned'));
$this->assertTrue(isset($toolkits['test']), 'The working toolkit was returned.');
$this->assertFalse(isset($toolkits['broken']), 'The toolkit marked unavailable was not returned');
$this->assertToolkitOperationsCalled(array());
}
@@ -100,8 +100,8 @@ class ImageToolkitUnitTest extends ImageToolkitTestCase {
*/
function testLoad() {
$image = image_load($this->file, $this->toolkit);
$this->assertTrue(is_object($image), t('Returned an object.'));
$this->assertEqual($this->toolkit, $image->toolkit, t('Image had toolkit set.'));
$this->assertTrue(is_object($image), 'Returned an object.');
$this->assertEqual($this->toolkit, $image->toolkit, 'Image had toolkit set.');
$this->assertToolkitOperationsCalled(array('load', 'get_info'));
}
@@ -109,7 +109,7 @@ class ImageToolkitUnitTest extends ImageToolkitTestCase {
* Test the image_save() function.
*/
function testSave() {
$this->assertFalse(image_save($this->image), t('Function returned the expected value.'));
$this->assertFalse(image_save($this->image), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('save'));
}
@@ -117,13 +117,13 @@ class ImageToolkitUnitTest extends ImageToolkitTestCase {
* Test the image_resize() function.
*/
function testResize() {
$this->assertTrue(image_resize($this->image, 1, 2), t('Function returned the expected value.'));
$this->assertTrue(image_resize($this->image, 1, 2), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize'));
// Check the parameters.
$calls = image_test_get_all_calls();
$this->assertEqual($calls['resize'][0][1], 1, t('Width was passed correctly'));
$this->assertEqual($calls['resize'][0][2], 2, t('Height was passed correctly'));
$this->assertEqual($calls['resize'][0][1], 1, 'Width was passed correctly');
$this->assertEqual($calls['resize'][0][2], 2, 'Height was passed correctly');
}
/**
@@ -131,69 +131,69 @@ class ImageToolkitUnitTest extends ImageToolkitTestCase {
*/
function testScale() {
// TODO: need to test upscaling
$this->assertTrue(image_scale($this->image, 10, 10), t('Function returned the expected value.'));
$this->assertTrue(image_scale($this->image, 10, 10), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize'));
// Check the parameters.
$calls = image_test_get_all_calls();
$this->assertEqual($calls['resize'][0][1], 10, t('Width was passed correctly'));
$this->assertEqual($calls['resize'][0][2], 5, t('Height was based off aspect ratio and passed correctly'));
$this->assertEqual($calls['resize'][0][1], 10, 'Width was passed correctly');
$this->assertEqual($calls['resize'][0][2], 5, 'Height was based off aspect ratio and passed correctly');
}
/**
* Test the image_scale_and_crop() function.
*/
function testScaleAndCrop() {
$this->assertTrue(image_scale_and_crop($this->image, 5, 10), t('Function returned the expected value.'));
$this->assertTrue(image_scale_and_crop($this->image, 5, 10), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize', 'crop'));
// Check the parameters.
$calls = image_test_get_all_calls();
$this->assertEqual($calls['crop'][0][1], 7.5, t('X was computed and passed correctly'));
$this->assertEqual($calls['crop'][0][2], 0, t('Y was computed and passed correctly'));
$this->assertEqual($calls['crop'][0][3], 5, t('Width was computed and passed correctly'));
$this->assertEqual($calls['crop'][0][4], 10, t('Height was computed and passed correctly'));
$this->assertEqual($calls['crop'][0][1], 7.5, 'X was computed and passed correctly');
$this->assertEqual($calls['crop'][0][2], 0, 'Y was computed and passed correctly');
$this->assertEqual($calls['crop'][0][3], 5, 'Width was computed and passed correctly');
$this->assertEqual($calls['crop'][0][4], 10, 'Height was computed and passed correctly');
}
/**
* Test the image_rotate() function.
*/
function testRotate() {
$this->assertTrue(image_rotate($this->image, 90, 1), t('Function returned the expected value.'));
$this->assertTrue(image_rotate($this->image, 90, 1), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('rotate'));
// Check the parameters.
$calls = image_test_get_all_calls();
$this->assertEqual($calls['rotate'][0][1], 90, t('Degrees were passed correctly'));
$this->assertEqual($calls['rotate'][0][2], 1, t('Background color was passed correctly'));
$this->assertEqual($calls['rotate'][0][1], 90, 'Degrees were passed correctly');
$this->assertEqual($calls['rotate'][0][2], 1, 'Background color was passed correctly');
}
/**
* Test the image_crop() function.
*/
function testCrop() {
$this->assertTrue(image_crop($this->image, 1, 2, 3, 4), t('Function returned the expected value.'));
$this->assertTrue(image_crop($this->image, 1, 2, 3, 4), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('crop'));
// Check the parameters.
$calls = image_test_get_all_calls();
$this->assertEqual($calls['crop'][0][1], 1, t('X was passed correctly'));
$this->assertEqual($calls['crop'][0][2], 2, t('Y was passed correctly'));
$this->assertEqual($calls['crop'][0][3], 3, t('Width was passed correctly'));
$this->assertEqual($calls['crop'][0][4], 4, t('Height was passed correctly'));
$this->assertEqual($calls['crop'][0][1], 1, 'X was passed correctly');
$this->assertEqual($calls['crop'][0][2], 2, 'Y was passed correctly');
$this->assertEqual($calls['crop'][0][3], 3, 'Width was passed correctly');
$this->assertEqual($calls['crop'][0][4], 4, 'Height was passed correctly');
}
/**
* Test the image_desaturate() function.
*/
function testDesaturate() {
$this->assertTrue(image_desaturate($this->image), t('Function returned the expected value.'));
$this->assertTrue(image_desaturate($this->image), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('desaturate'));
// Check the parameters.
$calls = image_test_get_all_calls();
$this->assertEqual(count($calls['desaturate'][0]), 1, t('Only the image was passed.'));
$this->assertEqual(count($calls['desaturate'][0]), 1, 'Only the image was passed.');
}
}
@@ -453,11 +453,11 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
image_save($image, $directory . '/' . $op . '.' . $image->info['extension']);
$this->assertTrue($correct_dimensions_real, t('Image %file after %action action has proper dimensions.', array('%file' => $file, '%action' => $op)));
$this->assertTrue($correct_dimensions_object, t('Image %file object after %action action is reporting the proper height and width values.', array('%file' => $file, '%action' => $op)));
$this->assertTrue($correct_dimensions_real, format_string('Image %file after %action action has proper dimensions.', array('%file' => $file, '%action' => $op)));
$this->assertTrue($correct_dimensions_object, format_string('Image %file object after %action action is reporting the proper height and width values.', array('%file' => $file, '%action' => $op)));
// JPEG colors will always be messed up due to compression.
if ($image->info['extension'] != 'jpg') {
$this->assertTrue($correct_colors, t('Image %file object after %action action has the correct color placement.', array('%file' => $file, '%action' => $op)));
$this->assertTrue($correct_colors, format_string('Image %file object after %action action has the correct color placement.', array('%file' => $file, '%action' => $op)));
}
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -23,35 +23,35 @@ class LockFunctionalTest extends DrupalWebTestCase {
function testLockAcquire() {
$lock_acquired = 'TRUE: Lock successfully acquired in system_test_lock_acquire()';
$lock_not_acquired = 'FALSE: Lock not acquired in system_test_lock_acquire()';
$this->assertTrue(lock_acquire('system_test_lock_acquire'), t('Lock acquired by this request.'), t('Lock'));
$this->assertTrue(lock_acquire('system_test_lock_acquire'), t('Lock extended by this request.'), t('Lock'));
$this->assertTrue(lock_acquire('system_test_lock_acquire'), 'Lock acquired by this request.', 'Lock');
$this->assertTrue(lock_acquire('system_test_lock_acquire'), 'Lock extended by this request.', 'Lock');
lock_release('system_test_lock_acquire');
// Cause another request to acquire the lock.
$this->drupalGet('system-test/lock-acquire');
$this->assertText($lock_acquired, t('Lock acquired by the other request.'), t('Lock'));
$this->assertText($lock_acquired, 'Lock acquired by the other request.', 'Lock');
// The other request has finished, thus it should have released its lock.
$this->assertTrue(lock_acquire('system_test_lock_acquire'), t('Lock acquired by this request.'), t('Lock'));
$this->assertTrue(lock_acquire('system_test_lock_acquire'), 'Lock acquired by this request.', 'Lock');
// This request holds the lock, so the other request cannot acquire it.
$this->drupalGet('system-test/lock-acquire');
$this->assertText($lock_not_acquired, t('Lock not acquired by the other request.'), t('Lock'));
$this->assertText($lock_not_acquired, 'Lock not acquired by the other request.', 'Lock');
lock_release('system_test_lock_acquire');
// Try a very short timeout and lock breaking.
$this->assertTrue(lock_acquire('system_test_lock_acquire', 0.5), t('Lock acquired by this request.'), t('Lock'));
$this->assertTrue(lock_acquire('system_test_lock_acquire', 0.5), 'Lock acquired by this request.', 'Lock');
sleep(1);
// The other request should break our lock.
$this->drupalGet('system-test/lock-acquire');
$this->assertText($lock_acquired, t('Lock acquired by the other request, breaking our lock.'), t('Lock'));
$this->assertText($lock_acquired, 'Lock acquired by the other request, breaking our lock.', 'Lock');
// We cannot renew it, since the other thread took it.
$this->assertFalse(lock_acquire('system_test_lock_acquire'), t('Lock cannot be extended by this request.'), t('Lock'));
$this->assertFalse(lock_acquire('system_test_lock_acquire'), 'Lock cannot be extended by this request.', 'Lock');
// Check the shut-down function.
$lock_acquired_exit = 'TRUE: Lock successfully acquired in system_test_lock_exit()';
$lock_not_acquired_exit = 'FALSE: Lock not acquired in system_test_lock_exit()';
$this->drupalGet('system-test/lock-exit');
$this->assertText($lock_acquired_exit, t('Lock acquired by the other request before exit.'), t('Lock'));
$this->assertTrue(lock_acquire('system_test_lock_exit'), t('Lock acquired by this request after the other request exits.'), t('Lock'));
$this->assertText($lock_acquired_exit, 'Lock acquired by the other request before exit.', 'Lock');
$this->assertTrue(lock_acquire('system_test_lock_exit'), 'Lock acquired by this request after the other request exits.', 'Lock');
}
}

View File

@@ -38,7 +38,7 @@ class MailTestCase extends DrupalWebTestCase implements MailSystemInterface {
$message = drupal_mail('simpletest', 'mail_test', 'testing@example.com', $language);
// Assert whether the message was sent through the send function.
$this->assertEqual(self::$sent_message['to'], 'testing@example.com', t('Pluggable mail system is extendable.'));
$this->assertEqual(self::$sent_message['to'], 'testing@example.com', 'Pluggable mail system is extendable.');
}
/**

View File

@@ -48,7 +48,7 @@ class MenuWebTestCase extends DrupalWebTestCase {
// No parts must be left, or an expected "Home" will always pass.
$pass = ($pass && empty($parts));
$this->assertTrue($pass, t('Breadcrumb %parts found on @path.', array(
$this->assertTrue($pass, format_string('Breadcrumb %parts found on @path.', array(
'%parts' => implode(' » ', $trail),
'@path' => $this->getUrl(),
)));
@@ -78,7 +78,7 @@ class MenuWebTestCase extends DrupalWebTestCase {
$i++;
}
$elements = $this->xpath($xpath);
$this->assertTrue(!empty($elements), t('Active trail to current page was found in menu tree.'));
$this->assertTrue(!empty($elements), 'Active trail to current page was found in menu tree.');
// Append prefix for active link asserted below.
$xpath .= '/following-sibling::ul/descendant::';
@@ -95,7 +95,7 @@ class MenuWebTestCase extends DrupalWebTestCase {
':title' => $active_link_title,
);
$elements = $this->xpath($xpath, $args);
$this->assertTrue(!empty($elements), t('Active link %title was found in menu tree, including active trail links %tree.', array(
$this->assertTrue(!empty($elements), format_string('Active link %title was found in menu tree, including active trail links %tree.', array(
'%title' => $active_link_title,
'%tree' => implode(' » ', $tree),
)));
@@ -145,8 +145,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
*/
function testTitleCallbackFalse() {
$this->drupalGet('node');
$this->assertText('A title with @placeholder', t('Raw text found on the page'));
$this->assertNoText(t('A title with @placeholder', array('@placeholder' => 'some other text')), t('Text with placeholder substitutions not found.'));
$this->assertText('A title with @placeholder', 'Raw text found on the page');
$this->assertNoText(t('A title with @placeholder', array('@placeholder' => 'some other text')), 'Text with placeholder substitutions not found.');
}
/**
@@ -166,8 +166,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
*/
function testThemeCallbackAdministrative() {
$this->drupalGet('menu-test/theme-callback/use-admin-theme');
$this->assertText('Custom theme: seven. Actual theme: seven.', t('The administrative theme can be correctly set in a theme callback.'));
$this->assertRaw('seven/style.css', t("The administrative theme's CSS appears on the page."));
$this->assertText('Custom theme: seven. Actual theme: seven.', 'The administrative theme can be correctly set in a theme callback.');
$this->assertRaw('seven/style.css', "The administrative theme's CSS appears on the page.");
}
/**
@@ -175,8 +175,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
*/
function testThemeCallbackInheritance() {
$this->drupalGet('menu-test/theme-callback/use-admin-theme/inheritance');
$this->assertText('Custom theme: seven. Actual theme: seven. Theme callback inheritance is being tested.', t('Theme callback inheritance correctly uses the administrative theme.'));
$this->assertRaw('seven/style.css', t("The administrative theme's CSS appears on the page."));
$this->assertText('Custom theme: seven. Actual theme: seven. Theme callback inheritance is being tested.', 'Theme callback inheritance correctly uses the administrative theme.');
$this->assertRaw('seven/style.css', "The administrative theme's CSS appears on the page.");
}
/**
@@ -185,7 +185,7 @@ class MenuRouterTestCase extends DrupalWebTestCase {
*/
function testFileInheritance() {
$this->drupalGet('admin/config/development/file-inheritance');
$this->assertText('File inheritance test description', t('File inheritance works.'));
$this->assertText('File inheritance test description', 'File inheritance works.');
}
/**
@@ -208,14 +208,14 @@ class MenuRouterTestCase extends DrupalWebTestCase {
// For a regular user, the fact that the site is in maintenance mode means
// we expect the theme callback system to be bypassed entirely.
$this->drupalGet('menu-test/theme-callback/use-admin-theme');
$this->assertRaw('bartik/css/style.css', t("The maintenance theme's CSS appears on the page."));
$this->assertRaw('bartik/css/style.css', "The maintenance theme's CSS appears on the page.");
// An administrator, however, should continue to see the requested theme.
$admin_user = $this->drupalCreateUser(array('access site in maintenance mode'));
$this->drupalLogin($admin_user);
$this->drupalGet('menu-test/theme-callback/use-admin-theme');
$this->assertText('Custom theme: seven. Actual theme: seven.', t('The theme callback system is correctly triggered for an administrator when the site is in maintenance mode.'));
$this->assertRaw('seven/style.css', t("The administrative theme's CSS appears on the page."));
$this->assertText('Custom theme: seven. Actual theme: seven.', 'The theme callback system is correctly triggered for an administrator when the site is in maintenance mode.');
$this->assertRaw('seven/style.css', "The administrative theme's CSS appears on the page.");
}
/**
@@ -244,11 +244,11 @@ class MenuRouterTestCase extends DrupalWebTestCase {
$this->drupalGet('user/login');
// Check that we got to 'user'.
$this->assertTrue($this->url == url('user', array('absolute' => TRUE)), t("Logged-in user redirected to q=user on accessing q=user/login"));
$this->assertTrue($this->url == url('user', array('absolute' => TRUE)), "Logged-in user redirected to q=user on accessing q=user/login");
// user/register should redirect to user/UID/edit.
$this->drupalGet('user/register');
$this->assertTrue($this->url == url('user/' . $this->loggedInUser->uid . '/edit', array('absolute' => TRUE)), t("Logged-in user redirected to q=user/UID/edit on accessing q=user/register"));
$this->assertTrue($this->url == url('user/' . $this->loggedInUser->uid . '/edit', array('absolute' => TRUE)), "Logged-in user redirected to q=user/UID/edit on accessing q=user/register");
}
/**
@@ -257,14 +257,14 @@ class MenuRouterTestCase extends DrupalWebTestCase {
function testThemeCallbackOptionalTheme() {
// Request a theme that is not enabled.
$this->drupalGet('menu-test/theme-callback/use-stark-theme');
$this->assertText('Custom theme: NONE. Actual theme: bartik.', t('The theme callback system falls back on the default theme when a theme that is not enabled is requested.'));
$this->assertRaw('bartik/css/style.css', t("The default theme's CSS appears on the page."));
$this->assertText('Custom theme: NONE. Actual theme: bartik.', 'The theme callback system falls back on the default theme when a theme that is not enabled is requested.');
$this->assertRaw('bartik/css/style.css', "The default theme's CSS appears on the page.");
// Now enable the theme and request it again.
theme_enable(array('stark'));
$this->drupalGet('menu-test/theme-callback/use-stark-theme');
$this->assertText('Custom theme: stark. Actual theme: stark.', t('The theme callback system uses an optional theme once it has been enabled.'));
$this->assertRaw('stark/layout.css', t("The optional theme's CSS appears on the page."));
$this->assertText('Custom theme: stark. Actual theme: stark.', 'The theme callback system uses an optional theme once it has been enabled.');
$this->assertRaw('stark/layout.css', "The optional theme's CSS appears on the page.");
}
/**
@@ -272,8 +272,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
*/
function testThemeCallbackFakeTheme() {
$this->drupalGet('menu-test/theme-callback/use-fake-theme');
$this->assertText('Custom theme: NONE. Actual theme: bartik.', t('The theme callback system falls back on the default theme when a theme that does not exist is requested.'));
$this->assertRaw('bartik/css/style.css', t("The default theme's CSS appears on the page."));
$this->assertText('Custom theme: NONE. Actual theme: bartik.', 'The theme callback system falls back on the default theme when a theme that does not exist is requested.');
$this->assertRaw('bartik/css/style.css', "The default theme's CSS appears on the page.");
}
/**
@@ -281,8 +281,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
*/
function testThemeCallbackNoThemeRequested() {
$this->drupalGet('menu-test/theme-callback/no-theme-requested');
$this->assertText('Custom theme: NONE. Actual theme: bartik.', t('The theme callback system falls back on the default theme when no theme is requested.'));
$this->assertRaw('bartik/css/style.css', t("The default theme's CSS appears on the page."));
$this->assertText('Custom theme: NONE. Actual theme: bartik.', 'The theme callback system falls back on the default theme when no theme is requested.');
$this->assertRaw('bartik/css/style.css', "The default theme's CSS appears on the page.");
}
/**
@@ -297,8 +297,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
// Visit a page that does not implement a theme callback. The above request
// should be honored.
$this->drupalGet('menu-test/no-theme-callback');
$this->assertText('Custom theme: stark. Actual theme: stark.', t('The result of hook_custom_theme() is used as the theme for the current page.'));
$this->assertRaw('stark/layout.css', t("The Stark theme's CSS appears on the page."));
$this->assertText('Custom theme: stark. Actual theme: stark.', 'The result of hook_custom_theme() is used as the theme for the current page.');
$this->assertRaw('stark/layout.css', "The Stark theme's CSS appears on the page.");
}
/**
@@ -313,8 +313,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
// The menu "theme callback" should take precedence over a value set in
// hook_custom_theme().
$this->drupalGet('menu-test/theme-callback/use-admin-theme');
$this->assertText('Custom theme: seven. Actual theme: seven.', t('The result of hook_custom_theme() does not override what was set in a theme callback.'));
$this->assertRaw('seven/style.css', t("The Seven theme's CSS appears on the page."));
$this->assertText('Custom theme: seven. Actual theme: seven.', 'The result of hook_custom_theme() does not override what was set in a theme callback.');
$this->assertRaw('seven/style.css', "The Seven theme's CSS appears on the page.");
}
/**
@@ -348,19 +348,19 @@ class MenuRouterTestCase extends DrupalWebTestCase {
menu_link_maintain('menu_test', 'update', 'menu_test_maintain/1', 'Menu link updated');
// Load a different page to be sure that we have up to date information.
$this->drupalGet('menu_test_maintain/1');
$this->assertLink(t('Menu link updated'), 0, t('Found updated menu link'));
$this->assertNoLink(t('Menu link #1'), 0, t('Not found menu link #1'));
$this->assertNoLink(t('Menu link #1'), 0, t('Not found menu link #1-1'));
$this->assertLink(t('Menu link #2'), 0, t('Found menu link #2'));
$this->assertLink(t('Menu link updated'), 0, 'Found updated menu link');
$this->assertNoLink(t('Menu link #1'), 0, 'Not found menu link #1');
$this->assertNoLink(t('Menu link #1'), 0, 'Not found menu link #1-1');
$this->assertLink(t('Menu link #2'), 0, 'Found menu link #2');
// Delete all links for the given path.
menu_link_maintain('menu_test', 'delete', 'menu_test_maintain/1', '');
// Load a different page to be sure that we have up to date information.
$this->drupalGet('menu_test_maintain/2');
$this->assertNoLink(t('Menu link updated'), 0, t('Not found deleted menu link'));
$this->assertNoLink(t('Menu link #1'), 0, t('Not found menu link #1'));
$this->assertNoLink(t('Menu link #1'), 0, t('Not found menu link #1-1'));
$this->assertLink(t('Menu link #2'), 0, t('Found menu link #2'));
$this->assertNoLink(t('Menu link updated'), 0, 'Not found deleted menu link');
$this->assertNoLink(t('Menu link #1'), 0, 'Not found menu link #1');
$this->assertNoLink(t('Menu link #1'), 0, 'Not found menu link #1-1');
$this->assertLink(t('Menu link #2'), 0, 'Found menu link #2');
}
/**
@@ -397,7 +397,7 @@ class MenuRouterTestCase extends DrupalWebTestCase {
$sql = "SELECT menu_name FROM {menu_links} WHERE router_path = 'menu_name_test'";
$name = db_query($sql)->fetchField();
$this->assertEqual($name, 'original', t('Menu name is "original".'));
$this->assertEqual($name, 'original', 'Menu name is "original".');
// Change the menu_name parameter in menu_test.module, then force a menu
// rebuild.
@@ -406,7 +406,7 @@ class MenuRouterTestCase extends DrupalWebTestCase {
$sql = "SELECT menu_name FROM {menu_links} WHERE router_path = 'menu_name_test'";
$name = db_query($sql)->fetchField();
$this->assertEqual($name, 'changed', t('Menu name was successfully changed after rebuild.'));
$this->assertEqual($name, 'changed', 'Menu name was successfully changed after rebuild.');
}
/**
@@ -417,8 +417,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
$child_link = db_query('SELECT * FROM {menu_links} WHERE link_path = :link_path', array(':link_path' => 'menu-test/hierarchy/parent/child'))->fetchAssoc();
$unattached_child_link = db_query('SELECT * FROM {menu_links} WHERE link_path = :link_path', array(':link_path' => 'menu-test/hierarchy/parent/child2/child'))->fetchAssoc();
$this->assertEqual($child_link['plid'], $parent_link['mlid'], t('The parent of a directly attached child is correct.'));
$this->assertEqual($unattached_child_link['plid'], $parent_link['mlid'], t('The parent of a non-directly attached child is correct.'));
$this->assertEqual($child_link['plid'], $parent_link['mlid'], 'The parent of a directly attached child is correct.');
$this->assertEqual($unattached_child_link['plid'], $parent_link['mlid'], 'The parent of a non-directly attached child is correct.');
}
/**
@@ -438,40 +438,40 @@ class MenuRouterTestCase extends DrupalWebTestCase {
$plid = $parent['mlid'];
$link = $links['menu-test/hidden/menu/list'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/menu/add'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/menu/settings'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/menu/manage/%'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$parent = $links['menu-test/hidden/menu/manage/%'];
$depth = $parent['depth'] + 1;
$plid = $parent['mlid'];
$link = $links['menu-test/hidden/menu/manage/%/list'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/menu/manage/%/add'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/menu/manage/%/edit'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/menu/manage/%/delete'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
// Verify links for two dynamic arguments.
$links = db_select('menu_links', 'ml')
@@ -486,28 +486,28 @@ class MenuRouterTestCase extends DrupalWebTestCase {
$plid = $parent['mlid'];
$link = $links['menu-test/hidden/block/list'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/block/add'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/block/manage/%/%'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$parent = $links['menu-test/hidden/block/manage/%/%'];
$depth = $parent['depth'] + 1;
$plid = $parent['mlid'];
$link = $links['menu-test/hidden/block/manage/%/%/configure'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$link = $links['menu-test/hidden/block/manage/%/%/delete'];
$this->assertEqual($link['depth'], $depth, t('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, t('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
$this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth)));
$this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid)));
}
/**
@@ -524,7 +524,7 @@ class MenuRouterTestCase extends DrupalWebTestCase {
function testMenuSetItem() {
$item = menu_get_item('node');
$this->assertEqual($item['path'], 'node', t("Path from menu_get_item('node') is equal to 'node'"), 'menu');
$this->assertEqual($item['path'], 'node', "Path from menu_get_item('node') is equal to 'node'", 'menu');
// Modify the path for the item then save it.
$item['path'] = 'node_test';
@@ -532,7 +532,7 @@ class MenuRouterTestCase extends DrupalWebTestCase {
menu_set_item('node', $item);
$compare_item = menu_get_item('node');
$this->assertEqual($compare_item, $item, t('Modified menu item is equal to newly retrieved menu item.'), 'menu');
$this->assertEqual($compare_item, $item, 'Modified menu item is equal to newly retrieved menu item.', 'menu');
}
/**
@@ -541,13 +541,13 @@ class MenuRouterTestCase extends DrupalWebTestCase {
function testMenuItemHooks() {
// Create an item.
menu_link_maintain('menu_test', 'insert', 'menu_test_maintain/4', 'Menu link #4');
$this->assertEqual(menu_test_static_variable(), 'insert', t('hook_menu_link_insert() fired correctly'));
$this->assertEqual(menu_test_static_variable(), 'insert', 'hook_menu_link_insert() fired correctly');
// Update the item.
menu_link_maintain('menu_test', 'update', 'menu_test_maintain/4', 'Menu link updated');
$this->assertEqual(menu_test_static_variable(), 'update', t('hook_menu_link_update() fired correctly'));
$this->assertEqual(menu_test_static_variable(), 'update', 'hook_menu_link_update() fired correctly');
// Delete the item.
menu_link_maintain('menu_test', 'delete', 'menu_test_maintain/4', '');
$this->assertEqual(menu_test_static_variable(), 'delete', t('hook_menu_link_delete() fired correctly'));
$this->assertEqual(menu_test_static_variable(), 'delete', 'hook_menu_link_delete() fired correctly');
}
/**
@@ -572,8 +572,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
// Load front page.
$this->drupalGet('node');
$this->assertRaw('title="Test title attribute"', t('Title attribute of a menu link renders.'));
$this->assertRaw('testparam=testvalue', t('Query parameter added to menu link.'));
$this->assertRaw('title="Test title attribute"', 'Title attribute of a menu link renders.');
$this->assertRaw('testparam=testvalue', 'Query parameter added to menu link.');
}
/**
@@ -606,7 +606,7 @@ class MenuRouterTestCase extends DrupalWebTestCase {
$this->drupalGet('menu-title-test/case' . $case_no);
$this->assertResponse(200);
$asserted_title = $override ? 'Alternative example title - Case ' . $case_no : 'Example title - Case ' . $case_no;
$this->assertTitle($asserted_title . ' | Drupal', t('Menu title is') . ': ' . $asserted_title, 'Menu');
$this->assertTitle($asserted_title . ' | Drupal', format_string('Menu title is: %title.', array('%title' => $asserted_title)), 'Menu');
}
/**
@@ -663,7 +663,7 @@ class MenuRouterTestCase extends DrupalWebTestCase {
foreach ($expected as $router_path => $load_functions) {
$router_item = $this->menuLoadRouter($router_path);
$this->assertIdentical(unserialize($router_item['load_functions']), $load_functions, t('Expected load functions for router %router_path' , array('%router_path' => $router_path)));
$this->assertIdentical(unserialize($router_item['load_functions']), $load_functions, format_string('Expected load functions for router %router_path' , array('%router_path' => $router_path)));
}
}
}
@@ -744,7 +744,7 @@ class MenuLinksUnitTestCase extends DrupalWebTestCase {
$menu_link = menu_link_load($mlid);
menu_link_save($menu_link);
$this->assertEqual($menu_link['plid'], $plid, t('Menu link %mlid has parent of %plid, expected %expected_plid.', array('%mlid' => $mlid, '%plid' => $menu_link['plid'], '%expected_plid' => $plid)));
$this->assertEqual($menu_link['plid'], $plid, format_string('Menu link %mlid has parent of %plid, expected %expected_plid.', array('%mlid' => $mlid, '%plid' => $menu_link['plid'], '%expected_plid' => $plid)));
}
}
@@ -905,14 +905,14 @@ class MenuRebuildTestCase extends DrupalWebTestCase {
function testMenuRebuildByVariable() {
// Check if 'admin' path exists.
$admin_exists = db_query('SELECT path from {menu_router} WHERE path = :path', array(':path' => 'admin'))->fetchField();
$this->assertEqual($admin_exists, 'admin', t("The path 'admin/' exists prior to deleting."));
$this->assertEqual($admin_exists, 'admin', "The path 'admin/' exists prior to deleting.");
// Delete the path item 'admin', and test that the path doesn't exist in the database.
$delete = db_delete('menu_router')
->condition('path', 'admin')
->execute();
$admin_exists = db_query('SELECT path from {menu_router} WHERE path = :path', array(':path' => 'admin'))->fetchField();
$this->assertFalse($admin_exists, t("The path 'admin/' has been deleted and doesn't exist in the database."));
$this->assertFalse($admin_exists, "The path 'admin/' has been deleted and doesn't exist in the database.");
// Now we enable the rebuild variable and trigger menu_execute_active_handler()
// to rebuild the menu item. Now 'admin' should exist.
@@ -920,7 +920,7 @@ class MenuRebuildTestCase extends DrupalWebTestCase {
// menu_execute_active_handler() should trigger the rebuild.
$this->drupalGet('<front>');
$admin_exists = db_query('SELECT path from {menu_router} WHERE path = :path', array(':path' => 'admin'))->fetchField();
$this->assertEqual($admin_exists, 'admin', t("The menu has been rebuilt, the path 'admin' now exists again."));
$this->assertEqual($admin_exists, 'admin', "The menu has been rebuilt, the path 'admin' now exists again.");
}
}
@@ -955,12 +955,12 @@ class MenuTreeDataTestCase extends DrupalUnitTestCase {
$tree = menu_tree_data($this->links);
// Validate that parent items #1, #2, and #5 exist on the root level.
$this->assertSameLink($this->links[1], $tree[1]['link'], t('Parent item #1 exists.'));
$this->assertSameLink($this->links[2], $tree[2]['link'], t('Parent item #2 exists.'));
$this->assertSameLink($this->links[5], $tree[5]['link'], t('Parent item #5 exists.'));
$this->assertSameLink($this->links[1], $tree[1]['link'], 'Parent item #1 exists.');
$this->assertSameLink($this->links[2], $tree[2]['link'], 'Parent item #2 exists.');
$this->assertSameLink($this->links[5], $tree[5]['link'], 'Parent item #5 exists.');
// Validate that child item #4 exists at the correct location in the hierarchy.
$this->assertSameLink($this->links[4], $tree[2]['below'][3]['below'][4]['link'], t('Child item #4 exists in the hierarchy.'));
$this->assertSameLink($this->links[4], $tree[2]['below'][3]['below'][4]['link'], 'Child item #4 exists in the hierarchy.');
}
/**
@@ -976,7 +976,7 @@ class MenuTreeDataTestCase extends DrupalUnitTestCase {
* TRUE if the assertion succeeded, FALSE otherwise.
*/
protected function assertSameLink($link1, $link2, $message = '') {
return $this->assert($link1['mlid'] == $link2['mlid'], $message ? $message : t('First link is identical to second link'));
return $this->assert($link1['mlid'] == $link2['mlid'], $message ? $message : 'First link is identical to second link');
}
}
@@ -1025,16 +1025,16 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
$output = menu_tree_output($this->tree_data);
// Validate that the - in main-menu is changed into an underscore
$this->assertEqual( $output['1']['#theme'], 'menu_link__main_menu', t('Hyphen is changed to a dash on menu_link'));
$this->assertEqual( $output['#theme_wrappers'][0], 'menu_tree__main_menu', t('Hyphen is changed to a dash on menu_tree wrapper'));
$this->assertEqual( $output['1']['#theme'], 'menu_link__main_menu', 'Hyphen is changed to a dash on menu_link');
$this->assertEqual( $output['#theme_wrappers'][0], 'menu_tree__main_menu', 'Hyphen is changed to a dash on menu_tree wrapper');
// Looking for child items in the data
$this->assertEqual( $output['1']['#below']['2']['#href'], 'a/b', t('Checking the href on a child item'));
$this->assertTrue( in_array('active-trail',$output['1']['#below']['2']['#attributes']['class']) , t('Checking the active trail class'));
$this->assertEqual( $output['1']['#below']['2']['#href'], 'a/b', 'Checking the href on a child item');
$this->assertTrue( in_array('active-trail',$output['1']['#below']['2']['#attributes']['class']) , 'Checking the active trail class');
// Validate that the hidden and no access items are missing
$this->assertFalse( isset($output['5']), t('Hidden item should be missing'));
$this->assertFalse( isset($output['6']), t('False access should be missing'));
$this->assertFalse( isset($output['5']), 'Hidden item should be missing');
$this->assertFalse( isset($output['6']), 'False access should be missing');
// Item 7 is after a couple hidden items. Just to make sure that 5 and 6 are skipped and 7 still included
$this->assertTrue( isset($output['7']), t('Item after hidden items is present'));
$this->assertTrue( isset($output['7']), 'Item after hidden items is present');
}
}
@@ -1698,13 +1698,13 @@ class MenuTrailTestCase extends MenuWebTestCase {
// Check that the initial trail (during the Drupal bootstrap) matches
// what we expect.
$initial_trail = variable_get('menu_test_active_trail_initial', array());
$this->assertEqual(count($initial_trail), count($expected_trail[$status_code]['initial']), t('The initial active trail for a @status_code page contains the expected number of items (expected: @expected, found: @found).', array(
$this->assertEqual(count($initial_trail), count($expected_trail[$status_code]['initial']), format_string('The initial active trail for a @status_code page contains the expected number of items (expected: @expected, found: @found).', array(
'@status_code' => $status_code,
'@expected' => count($expected_trail[$status_code]['initial']),
'@found' => count($initial_trail),
)));
foreach (array_keys($expected_trail[$status_code]['initial']) as $index => $path) {
$this->assertEqual($initial_trail[$index]['href'], $path, t('Element number @number of the initial active trail for a @status_code page contains the correct path (expected: @expected, found: @found)', array(
$this->assertEqual($initial_trail[$index]['href'], $path, format_string('Element number @number of the initial active trail for a @status_code page contains the correct path (expected: @expected, found: @found)', array(
'@number' => $index + 1,
'@status_code' => $status_code,
'@expected' => $path,
@@ -1715,13 +1715,13 @@ class MenuTrailTestCase extends MenuWebTestCase {
// Check that the final trail (after the user has been redirected to the
// custom 403/404 page) matches what we expect.
$final_trail = variable_get('menu_test_active_trail_final', array());
$this->assertEqual(count($final_trail), count($expected_trail[$status_code]['final']), t('The final active trail for a @status_code page contains the expected number of items (expected: @expected, found: @found).', array(
$this->assertEqual(count($final_trail), count($expected_trail[$status_code]['final']), format_string('The final active trail for a @status_code page contains the expected number of items (expected: @expected, found: @found).', array(
'@status_code' => $status_code,
'@expected' => count($expected_trail[$status_code]['final']),
'@found' => count($final_trail),
)));
foreach (array_keys($expected_trail[$status_code]['final']) as $index => $path) {
$this->assertEqual($final_trail[$index]['href'], $path, t('Element number @number of the final active trail for a @status_code page contains the correct path (expected: @expected, found: @found)', array(
$this->assertEqual($final_trail[$index]['href'], $path, format_string('Element number @number of the final active trail for a @status_code page contains the correct path (expected: @expected, found: @found)', array(
'@number' => $index + 1,
'@status_code' => $status_code,
'@expected' => $path,

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -76,9 +76,9 @@ class ModuleUnitTest extends DrupalWebTestCase {
*/
protected function assertModuleList(Array $expected_values, $condition) {
$expected_values = array_combine($expected_values, $expected_values);
$this->assertEqual($expected_values, module_list(), t('@condition: module_list() returns correct results', array('@condition' => $condition)));
$this->assertEqual($expected_values, module_list(), format_string('@condition: module_list() returns correct results', array('@condition' => $condition)));
ksort($expected_values);
$this->assertIdentical($expected_values, module_list(FALSE, FALSE, TRUE), t('@condition: module_list() returns correctly sorted results', array('@condition' => $condition)));
$this->assertIdentical($expected_values, module_list(FALSE, FALSE, TRUE), format_string('@condition: module_list() returns correctly sorted results', array('@condition' => $condition)));
}
/**
@@ -87,16 +87,16 @@ class ModuleUnitTest extends DrupalWebTestCase {
function testModuleImplements() {
// Clear the cache.
cache_clear_all('module_implements', 'cache_bootstrap');
$this->assertFalse(cache_get('module_implements', 'cache_bootstrap'), t('The module implements cache is empty.'));
$this->assertFalse(cache_get('module_implements', 'cache_bootstrap'), 'The module implements cache is empty.');
$this->drupalGet('');
$this->assertTrue(cache_get('module_implements', 'cache_bootstrap'), t('The module implements cache is populated after requesting a page.'));
$this->assertTrue(cache_get('module_implements', 'cache_bootstrap'), 'The module implements cache is populated after requesting a page.');
// Test again with an authenticated user.
$this->user = $this->drupalCreateUser();
$this->drupalLogin($this->user);
cache_clear_all('module_implements', 'cache_bootstrap');
$this->drupalGet('');
$this->assertTrue(cache_get('module_implements', 'cache_bootstrap'), t('The module implements cache is populated after requesting a page.'));
$this->assertTrue(cache_get('module_implements', 'cache_bootstrap'), 'The module implements cache is populated after requesting a page.');
// Make sure group include files are detected properly even when the file is
// already loaded when the cache is rebuilt.
@@ -117,7 +117,7 @@ class ModuleUnitTest extends DrupalWebTestCase {
module_enable(array('module_test'), FALSE);
$this->resetAll();
$this->drupalGet('module-test/hook-dynamic-loading-invoke');
$this->assertText('success!', t('module_invoke() dynamically loads a hook defined in hook_hook_info().'));
$this->assertText('success!', 'module_invoke() dynamically loads a hook defined in hook_hook_info().');
}
/**
@@ -127,7 +127,7 @@ class ModuleUnitTest extends DrupalWebTestCase {
module_enable(array('module_test'), FALSE);
$this->resetAll();
$this->drupalGet('module-test/hook-dynamic-loading-invoke-all');
$this->assertText('success!', t('module_invoke_all() dynamically loads a hook defined in hook_hook_info().'));
$this->assertText('success!', 'module_invoke_all() dynamically loads a hook defined in hook_hook_info().');
}
/**
@@ -138,79 +138,79 @@ class ModuleUnitTest extends DrupalWebTestCase {
// are not already enabled. (If they were, the tests below would not work
// correctly.)
module_enable(array('module_test'), FALSE);
$this->assertTrue(module_exists('module_test'), t('Test module is enabled.'));
$this->assertFalse(module_exists('forum'), t('Forum module is disabled.'));
$this->assertFalse(module_exists('poll'), t('Poll module is disabled.'));
$this->assertFalse(module_exists('php'), t('PHP module is disabled.'));
$this->assertTrue(module_exists('module_test'), 'Test module is enabled.');
$this->assertFalse(module_exists('forum'), 'Forum module is disabled.');
$this->assertFalse(module_exists('poll'), 'Poll module is disabled.');
$this->assertFalse(module_exists('php'), 'PHP module is disabled.');
// First, create a fake missing dependency. Forum depends on poll, which
// depends on a made-up module, foo. Nothing should be installed.
variable_set('dependency_test', 'missing dependency');
drupal_static_reset('system_rebuild_module_data');
$result = module_enable(array('forum'));
$this->assertFalse($result, t('module_enable() returns FALSE if dependencies are missing.'));
$this->assertFalse(module_exists('forum'), t('module_enable() aborts if dependencies are missing.'));
$this->assertFalse($result, 'module_enable() returns FALSE if dependencies are missing.');
$this->assertFalse(module_exists('forum'), 'module_enable() aborts if dependencies are missing.');
// Now, fix the missing dependency. Forum module depends on poll, but poll
// depends on the PHP module. module_enable() should work.
variable_set('dependency_test', 'dependency');
drupal_static_reset('system_rebuild_module_data');
$result = module_enable(array('forum'));
$this->assertTrue($result, t('module_enable() returns the correct value.'));
$this->assertTrue($result, 'module_enable() returns the correct value.');
// Verify that the fake dependency chain was installed.
$this->assertTrue(module_exists('poll') && module_exists('php'), t('Dependency chain was installed by module_enable().'));
$this->assertTrue(module_exists('poll') && module_exists('php'), 'Dependency chain was installed by module_enable().');
// Verify that the original module was installed.
$this->assertTrue(module_exists('forum'), t('Module installation with unlisted dependencies succeeded.'));
$this->assertTrue(module_exists('forum'), 'Module installation with unlisted dependencies succeeded.');
// Finally, verify that the modules were enabled in the correct order.
$this->assertEqual(variable_get('test_module_enable_order', array()), array('php', 'poll', 'forum'), t('Modules were enabled in the correct order by module_enable().'));
$this->assertEqual(variable_get('test_module_enable_order', array()), array('php', 'poll', 'forum'), 'Modules were enabled in the correct order by module_enable().');
// Now, disable the PHP module. Both forum and poll should be disabled as
// well, in the correct order.
module_disable(array('php'));
$this->assertTrue(!module_exists('forum') && !module_exists('poll'), t('Depedency chain was disabled by module_disable().'));
$this->assertFalse(module_exists('php'), t('Disabling a module with unlisted dependents succeeded.'));
$this->assertEqual(variable_get('test_module_disable_order', array()), array('forum', 'poll', 'php'), t('Modules were disabled in the correct order by module_disable().'));
$this->assertTrue(!module_exists('forum') && !module_exists('poll'), 'Depedency chain was disabled by module_disable().');
$this->assertFalse(module_exists('php'), 'Disabling a module with unlisted dependents succeeded.');
$this->assertEqual(variable_get('test_module_disable_order', array()), array('forum', 'poll', 'php'), 'Modules were disabled in the correct order by module_disable().');
// Disable a module that is listed as a dependency by the installation
// profile. Make sure that the profile itself is not on the list of
// dependent modules to be disabled.
$profile = drupal_get_profile();
$info = install_profile_info($profile);
$this->assertTrue(in_array('comment', $info['dependencies']), t('Comment module is listed as a dependency of the installation profile.'));
$this->assertTrue(module_exists('comment'), t('Comment module is enabled.'));
$this->assertTrue(in_array('comment', $info['dependencies']), 'Comment module is listed as a dependency of the installation profile.');
$this->assertTrue(module_exists('comment'), 'Comment module is enabled.');
module_disable(array('comment'));
$this->assertFalse(module_exists('comment'), t('Comment module was disabled.'));
$this->assertFalse(module_exists('comment'), 'Comment module was disabled.');
$disabled_modules = variable_get('test_module_disable_order', array());
$this->assertTrue(in_array('comment', $disabled_modules), t('Comment module is in the list of disabled modules.'));
$this->assertFalse(in_array($profile, $disabled_modules), t('The installation profile is not in the list of disabled modules.'));
$this->assertTrue(in_array('comment', $disabled_modules), 'Comment module is in the list of disabled modules.');
$this->assertFalse(in_array($profile, $disabled_modules), 'The installation profile is not in the list of disabled modules.');
// Try to uninstall the PHP module by itself. This should be rejected,
// since the modules which it depends on need to be uninstalled first, and
// that is too destructive to perform automatically.
$result = drupal_uninstall_modules(array('php'));
$this->assertFalse($result, t('Calling drupal_uninstall_modules() on a module whose dependents are not uninstalled fails.'));
$this->assertFalse($result, 'Calling drupal_uninstall_modules() on a module whose dependents are not uninstalled fails.');
foreach (array('forum', 'poll', 'php') as $module) {
$this->assertNotEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, t('The @module module was not uninstalled.', array('@module' => $module)));
$this->assertNotEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, format_string('The @module module was not uninstalled.', array('@module' => $module)));
}
// Now uninstall all three modules explicitly, but in the incorrect order,
// and make sure that drupal_uninstal_modules() uninstalled them in the
// correct sequence.
$result = drupal_uninstall_modules(array('poll', 'php', 'forum'));
$this->assertTrue($result, t('drupal_uninstall_modules() returns the correct value.'));
$this->assertTrue($result, 'drupal_uninstall_modules() returns the correct value.');
foreach (array('forum', 'poll', 'php') as $module) {
$this->assertEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, t('The @module module was uninstalled.', array('@module' => $module)));
$this->assertEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, format_string('The @module module was uninstalled.', array('@module' => $module)));
}
$this->assertEqual(variable_get('test_module_uninstall_order', array()), array('forum', 'poll', 'php'), t('Modules were uninstalled in the correct order by drupal_uninstall_modules().'));
$this->assertEqual(variable_get('test_module_uninstall_order', array()), array('forum', 'poll', 'php'), 'Modules were uninstalled in the correct order by drupal_uninstall_modules().');
// Uninstall the profile module from above, and make sure that the profile
// itself is not on the list of dependent modules to be uninstalled.
$result = drupal_uninstall_modules(array('comment'));
$this->assertTrue($result, t('drupal_uninstall_modules() returns the correct value.'));
$this->assertEqual(drupal_get_installed_schema_version('comment'), SCHEMA_UNINSTALLED, t('Comment module was uninstalled.'));
$this->assertTrue($result, 'drupal_uninstall_modules() returns the correct value.');
$this->assertEqual(drupal_get_installed_schema_version('comment'), SCHEMA_UNINSTALLED, 'Comment module was uninstalled.');
$uninstalled_modules = variable_get('test_module_uninstall_order', array());
$this->assertTrue(in_array('comment', $uninstalled_modules), t('Comment module is in the list of uninstalled modules.'));
$this->assertFalse(in_array($profile, $uninstalled_modules), t('The installation profile is not in the list of uninstalled modules.'));
$this->assertTrue(in_array('comment', $uninstalled_modules), 'Comment module is in the list of uninstalled modules.');
$this->assertFalse(in_array($profile, $uninstalled_modules), 'The installation profile is not in the list of uninstalled modules.');
// Enable forum module again, which should enable both the poll module and
// php module. But, this time do it with poll module declaring a dependency
@@ -219,11 +219,11 @@ class ModuleUnitTest extends DrupalWebTestCase {
variable_set('dependency_test', 'version dependency');
drupal_static_reset('system_rebuild_module_data');
$result = module_enable(array('forum'));
$this->assertTrue($result, t('module_enable() returns the correct value.'));
$this->assertTrue($result, 'module_enable() returns the correct value.');
// Verify that the fake dependency chain was installed.
$this->assertTrue(module_exists('poll') && module_exists('php'), t('Dependency chain was installed by module_enable().'));
$this->assertTrue(module_exists('poll') && module_exists('php'), 'Dependency chain was installed by module_enable().');
// Verify that the original module was installed.
$this->assertTrue(module_exists('forum'), t('Module installation with version dependencies succeeded.'));
$this->assertTrue(module_exists('forum'), 'Module installation with version dependencies succeeded.');
// Finally, verify that the modules were enabled in the correct order.
$enable_order = variable_get('test_module_enable_order', array());
$php_position = array_search('php', $enable_order);
@@ -231,7 +231,7 @@ class ModuleUnitTest extends DrupalWebTestCase {
$forum_position = array_search('forum', $enable_order);
$php_before_poll = $php_position !== FALSE && $poll_position !== FALSE && $php_position < $poll_position;
$poll_before_forum = $poll_position !== FALSE && $forum_position !== FALSE && $poll_position < $forum_position;
$this->assertTrue($php_before_poll && $poll_before_forum, t('Modules were enabled in the correct order by module_enable().'));
$this->assertTrue($php_before_poll && $poll_before_forum, 'Modules were enabled in the correct order by module_enable().');
}
}
@@ -267,8 +267,8 @@ class ModuleInstallTestCase extends DrupalWebTestCase {
// Check for data that was inserted using drupal_write_record() while the
// 'module_test' module was being installed and enabled.
$data = db_query("SELECT data FROM {module_test}")->fetchCol();
$this->assertTrue(in_array('Data inserted in hook_install()', $data), t('Data inserted using drupal_write_record() in hook_install() is correctly saved.'));
$this->assertTrue(in_array('Data inserted in hook_enable()', $data), t('Data inserted using drupal_write_record() in hook_enable() is correctly saved.'));
$this->assertTrue(in_array('Data inserted in hook_install()', $data), 'Data inserted using drupal_write_record() in hook_install() is correctly saved.');
$this->assertTrue(in_array('Data inserted in hook_enable()', $data), 'Data inserted using drupal_write_record() in hook_enable() is correctly saved.');
}
}
@@ -299,6 +299,6 @@ class ModuleUninstallTestCase extends DrupalWebTestCase {
// Are the perms defined by module_test removed from {role_permission}.
$count = db_query("SELECT COUNT(rid) FROM {role_permission} WHERE permission = :perm", array(':perm' => 'module_test perm'))->fetchField();
$this->assertEqual(0, $count, t('Permissions were all removed.'));
$this->assertEqual(0, $count, 'Permissions were all removed.');
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -101,24 +101,24 @@ class PagerFunctionalWebTestCase extends DrupalWebTestCase {
// Verify first/previous and next/last items and links.
if (isset($first)) {
$this->assertClass($first, 'pager-first', "Item for first page has .pager-first class.");
$this->assertTrue($first->a, "Link to first page found.");
$this->assertNoClass($first->a, 'active', "Link to first page is not active.");
$this->assertClass($first, 'pager-first', 'Item for first page has .pager-first class.');
$this->assertTrue($first->a, 'Link to first page found.');
$this->assertNoClass($first->a, 'active', 'Link to first page is not active.');
}
if (isset($previous)) {
$this->assertClass($previous, 'pager-previous', "Item for first page has .pager-previous class.");
$this->assertTrue($previous->a, "Link to previous page found.");
$this->assertNoClass($previous->a, 'active', "Link to previous page is not active.");
$this->assertClass($previous, 'pager-previous', 'Item for first page has .pager-previous class.');
$this->assertTrue($previous->a, 'Link to previous page found.');
$this->assertNoClass($previous->a, 'active', 'Link to previous page is not active.');
}
if (isset($next)) {
$this->assertClass($next, 'pager-next', "Item for next page has .pager-next class.");
$this->assertTrue($next->a, "Link to next page found.");
$this->assertNoClass($next->a, 'active', "Link to next page is not active.");
$this->assertClass($next, 'pager-next', 'Item for next page has .pager-next class.');
$this->assertTrue($next->a, 'Link to next page found.');
$this->assertNoClass($next->a, 'active', 'Link to next page is not active.');
}
if (isset($last)) {
$this->assertClass($last, 'pager-last', "Item for last page has .pager-last class.");
$this->assertTrue($last->a, "Link to last page found.");
$this->assertNoClass($last->a, 'active', "Link to last page is not active.");
$this->assertClass($last, 'pager-last', 'Item for last page has .pager-last class.');
$this->assertTrue($last->a, 'Link to last page found.');
$this->assertNoClass($last->a, 'active', 'Link to last page is not active.');
}
}

View File

@@ -35,26 +35,26 @@ class PasswordHashingTest extends DrupalWebTestCase {
$password = 'baz';
$account = (object) array('name' => 'foo', 'pass' => md5($password));
// The md5 password should be flagged as needing an update.
$this->assertTrue(user_needs_new_hash($account), t('User with md5 password needs a new hash.'));
$this->assertTrue(user_needs_new_hash($account), 'User with md5 password needs a new hash.');
// Re-hash the password.
$old_hash = $account->pass;
$account->pass = user_hash_password($password);
$this->assertIdentical(_password_get_count_log2($account->pass), DRUPAL_MIN_HASH_COUNT, t('Re-hashed password has the minimum number of log2 iterations.'));
$this->assertTrue($account->pass != $old_hash, t('Password hash changed.'));
$this->assertTrue(user_check_password($password, $account), t('Password check succeeds.'));
$this->assertIdentical(_password_get_count_log2($account->pass), DRUPAL_MIN_HASH_COUNT, 'Re-hashed password has the minimum number of log2 iterations.');
$this->assertTrue($account->pass != $old_hash, 'Password hash changed.');
$this->assertTrue(user_check_password($password, $account), 'Password check succeeds.');
// Since the log2 setting hasn't changed and the user has a valid password,
// user_needs_new_hash() should return FALSE.
$this->assertFalse(user_needs_new_hash($account), t('User does not need a new hash.'));
$this->assertFalse(user_needs_new_hash($account), 'User does not need a new hash.');
// Increment the log2 iteration to MIN + 1.
variable_set('password_count_log2', DRUPAL_MIN_HASH_COUNT + 1);
$this->assertTrue(user_needs_new_hash($account), t('User needs a new hash after incrementing the log2 count.'));
$this->assertTrue(user_needs_new_hash($account), 'User needs a new hash after incrementing the log2 count.');
// Re-hash the password.
$old_hash = $account->pass;
$account->pass = user_hash_password($password);
$this->assertIdentical(_password_get_count_log2($account->pass), DRUPAL_MIN_HASH_COUNT + 1, t('Re-hashed password has the correct number of log2 iterations.'));
$this->assertTrue($account->pass != $old_hash, t('Password hash changed again.'));
$this->assertIdentical(_password_get_count_log2($account->pass), DRUPAL_MIN_HASH_COUNT + 1, 'Re-hashed password has the correct number of log2 iterations.');
$this->assertTrue($account->pass != $old_hash, 'Password hash changed again.');
// Now the hash should be OK.
$this->assertFalse(user_needs_new_hash($account), t('Re-hashed password does not need a new hash.'));
$this->assertTrue(user_check_password($password, $account), t('Password check succeeds with re-hashed password.'));
$this->assertFalse(user_needs_new_hash($account), 'Re-hashed password does not need a new hash.');
$this->assertTrue(user_check_password($password, $account), 'Password check succeeds with re-hashed password.');
}
}

View File

@@ -41,7 +41,7 @@ class DrupalMatchPathTestCase extends DrupalWebTestCase {
foreach ($tests as $patterns => $cases) {
foreach ($cases as $path => $expected_result) {
$actual_result = drupal_match_path($path, $patterns);
$this->assertIdentical($actual_result, $expected_result, t('Tried matching the path <code>@path</code> to the pattern <pre>@patterns</pre> - expected @expected, got @actual.', array('@path' => $path, '@patterns' => $patterns, '@expected' => var_export($expected_result, TRUE), '@actual' => var_export($actual_result, TRUE))));
$this->assertIdentical($actual_result, $expected_result, format_string('Tried matching the path <code>@path</code> to the pattern <pre>@patterns</pre> - expected @expected, got @actual.', array('@path' => $path, '@patterns' => $patterns, '@expected' => var_export($expected_result, TRUE), '@actual' => var_export($actual_result, TRUE))));
}
}
}
@@ -196,8 +196,8 @@ class UrlAlterFunctionalTest extends DrupalWebTestCase {
*/
function testCurrentUrlRequestedPath() {
$this->drupalGet('url-alter-test/bar');
$this->assertRaw('request_path=url-alter-test/bar', t('request_path() returns the requested path.'));
$this->assertRaw('current_path=url-alter-test/foo', t('current_path() returns the internal path.'));
$this->assertRaw('request_path=url-alter-test/bar', 'request_path() returns the requested path.');
$this->assertRaw('current_path=url-alter-test/foo', 'current_path() returns the internal path.');
}
/**
@@ -223,7 +223,7 @@ class UrlAlterFunctionalTest extends DrupalWebTestCase {
$result = url($original);
$base_path = base_path() . (variable_get('clean_url', '0') ? '' : '?q=');
$result = substr($result, strlen($base_path));
$this->assertIdentical($result, $final, t('Altered outbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
$this->assertIdentical($result, $final, format_string('Altered outbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
}
/**
@@ -240,7 +240,7 @@ class UrlAlterFunctionalTest extends DrupalWebTestCase {
protected function assertUrlInboundAlter($original, $final) {
// Test inbound altering.
$result = drupal_get_normal_path($original);
$this->assertIdentical($result, $final, t('Altered inbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
$this->assertIdentical($result, $final, format_string('Altered inbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
}
}
@@ -271,8 +271,8 @@ class PathLookupTest extends DrupalWebTestCase {
'alias' => 'foo',
);
path_save($path);
$this->assertEqual(drupal_lookup_path('alias', $path['source']), $path['alias'], t('Basic alias lookup works.'));
$this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], t('Basic source lookup works.'));
$this->assertEqual(drupal_lookup_path('alias', $path['source']), $path['alias'], 'Basic alias lookup works.');
$this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], 'Basic source lookup works.');
// Create a language specific alias for the default language (English).
$path = array(
@@ -281,8 +281,8 @@ class PathLookupTest extends DrupalWebTestCase {
'language' => 'en',
);
path_save($path);
$this->assertEqual(drupal_lookup_path('alias', $path['source']), $path['alias'], t('English alias overrides language-neutral alias.'));
$this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], t('English source overrides language-neutral source.'));
$this->assertEqual(drupal_lookup_path('alias', $path['source']), $path['alias'], 'English alias overrides language-neutral alias.');
$this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], 'English source overrides language-neutral source.');
// Create a language-neutral alias for the same path, again.
$path = array(
@@ -290,7 +290,7 @@ class PathLookupTest extends DrupalWebTestCase {
'alias' => 'bar',
);
path_save($path);
$this->assertEqual(drupal_lookup_path('alias', $path['source']), "users/$name", t('English alias still returned after entering a language-neutral alias.'));
$this->assertEqual(drupal_lookup_path('alias', $path['source']), "users/$name", 'English alias still returned after entering a language-neutral alias.');
// Create a language-specific (xx-lolspeak) alias for the same path.
$path = array(
@@ -299,9 +299,9 @@ class PathLookupTest extends DrupalWebTestCase {
'language' => 'xx-lolspeak',
);
path_save($path);
$this->assertEqual(drupal_lookup_path('alias', $path['source']), "users/$name", t('English alias still returned after entering a LOLspeak alias.'));
$this->assertEqual(drupal_lookup_path('alias', $path['source']), "users/$name", 'English alias still returned after entering a LOLspeak alias.');
// The LOLspeak alias should be returned if we really want LOLspeak.
$this->assertEqual(drupal_lookup_path('alias', $path['source'], 'xx-lolspeak'), 'LOL', t('LOLspeak alias returned if we specify xx-lolspeak to drupal_lookup_path().'));
$this->assertEqual(drupal_lookup_path('alias', $path['source'], 'xx-lolspeak'), 'LOL', 'LOLspeak alias returned if we specify xx-lolspeak to drupal_lookup_path().');
// Create a new alias for this path in English, which should override the
// previous alias for "user/$uid".
@@ -311,8 +311,8 @@ class PathLookupTest extends DrupalWebTestCase {
'language' => 'en',
);
path_save($path);
$this->assertEqual(drupal_lookup_path('alias', $path['source']), $path['alias'], t('Recently created English alias returned.'));
$this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], t('Recently created English source returned.'));
$this->assertEqual(drupal_lookup_path('alias', $path['source']), $path['alias'], 'Recently created English alias returned.');
$this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], 'Recently created English source returned.');
// Remove the English aliases, which should cause a fallback to the most
// recently created language-neutral alias, 'bar'.
@@ -320,7 +320,7 @@ class PathLookupTest extends DrupalWebTestCase {
->condition('language', 'en')
->execute();
drupal_clear_path_cache();
$this->assertEqual(drupal_lookup_path('alias', $path['source']), 'bar', t('Path lookup falls back to recently created language-neutral alias.'));
$this->assertEqual(drupal_lookup_path('alias', $path['source']), 'bar', 'Path lookup falls back to recently created language-neutral alias.');
// Test the situation where the alias and language are the same, but
// the source differs. The newer alias record should be returned.
@@ -330,7 +330,7 @@ class PathLookupTest extends DrupalWebTestCase {
'alias' => 'bar',
);
path_save($path);
$this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], t('Newer alias record is returned when comparing two LANGUAGE_NONE paths with the same alias.'));
$this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], 'Newer alias record is returned when comparing two LANGUAGE_NONE paths with the same alias.');
}
}
@@ -375,7 +375,7 @@ class PathSaveTest extends DrupalWebTestCase {
// Test to see if the original alias is available to modules during
// hook_path_update().
$results = variable_get('path_test_results', array());
$this->assertIdentical($results['hook_path_update']['original']['alias'], $path_original['alias'], t('Old path alias available to modules during hook_path_update.'));
$this->assertIdentical($results['hook_path_update']['original']['source'], $path_original['source'], t('Old path alias available to modules during hook_path_update.'));
$this->assertIdentical($results['hook_path_update']['original']['alias'], $path_original['alias'], 'Old path alias available to modules during hook_path_update.');
$this->assertIdentical($results['hook_path_update']['original']['source'], $path_original['source'], 'Old path alias available to modules during hook_path_update.');
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ core = 7.x
hidden = TRUE
package = Testing
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -7,8 +7,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -44,7 +44,7 @@ class SchemaTestCase extends DrupalWebTestCase {
db_create_table('test_table', $table_specification);
// Assert that the table exists.
$this->assertTrue(db_table_exists('test_table'), t('The table exists.'));
$this->assertTrue(db_table_exists('test_table'), 'The table exists.');
// Assert that the table comment has been set.
$this->checkSchemaComment($table_specification['description'], 'test_table');
@@ -53,46 +53,46 @@ class SchemaTestCase extends DrupalWebTestCase {
$this->checkSchemaComment($table_specification['fields']['test_field']['description'], 'test_table', 'test_field');
// An insert without a value for the column 'test_table' should fail.
$this->assertFalse($this->tryInsert(), t('Insert without a default failed.'));
$this->assertFalse($this->tryInsert(), 'Insert without a default failed.');
// Add a default value to the column.
db_field_set_default('test_table', 'test_field', 0);
// The insert should now succeed.
$this->assertTrue($this->tryInsert(), t('Insert with a default succeeded.'));
$this->assertTrue($this->tryInsert(), 'Insert with a default succeeded.');
// Remove the default.
db_field_set_no_default('test_table', 'test_field');
// The insert should fail again.
$this->assertFalse($this->tryInsert(), t('Insert without a default failed.'));
$this->assertFalse($this->tryInsert(), 'Insert without a default failed.');
// Test for fake index and test for the boolean result of indexExists().
$index_exists = Database::getConnection()->schema()->indexExists('test_table', 'test_field');
$this->assertIdentical($index_exists, FALSE, t('Fake index does not exists'));
$this->assertIdentical($index_exists, FALSE, 'Fake index does not exists');
// Add index.
db_add_index('test_table', 'test_field', array('test_field'));
// Test for created index and test for the boolean result of indexExists().
$index_exists = Database::getConnection()->schema()->indexExists('test_table', 'test_field');
$this->assertIdentical($index_exists, TRUE, t('Index created.'));
$this->assertIdentical($index_exists, TRUE, 'Index created.');
// Rename the table.
db_rename_table('test_table', 'test_table2');
// Index should be renamed.
$index_exists = Database::getConnection()->schema()->indexExists('test_table2', 'test_field');
$this->assertTrue($index_exists, t('Index was renamed.'));
$this->assertTrue($index_exists, 'Index was renamed.');
// We need the default so that we can insert after the rename.
db_field_set_default('test_table2', 'test_field', 0);
$this->assertFalse($this->tryInsert(), t('Insert into the old table failed.'));
$this->assertTrue($this->tryInsert('test_table2'), t('Insert into the new table succeeded.'));
$this->assertFalse($this->tryInsert(), 'Insert into the old table failed.');
$this->assertTrue($this->tryInsert('test_table2'), 'Insert into the new table succeeded.');
// We should have successfully inserted exactly two rows.
$count = db_query('SELECT COUNT(*) FROM {test_table2}')->fetchField();
$this->assertEqual($count, 2, t('Two fields were successfully inserted.'));
$this->assertEqual($count, 2, 'Two fields were successfully inserted.');
// Try to drop the table.
db_drop_table('test_table2');
$this->assertFalse(db_table_exists('test_table2'), t('The dropped table does not exist.'));
$this->assertFalse(db_table_exists('test_table2'), 'The dropped table does not exist.');
// Recreate the table.
db_create_table('test_table', $table_specification);
@@ -108,14 +108,14 @@ class SchemaTestCase extends DrupalWebTestCase {
// Assert that the column comment has been set.
$this->checkSchemaComment('Changed column description.', 'test_table', 'test_serial');
$this->assertTrue($this->tryInsert(), t('Insert with a serial succeeded.'));
$this->assertTrue($this->tryInsert(), 'Insert with a serial succeeded.');
$max1 = db_query('SELECT MAX(test_serial) FROM {test_table}')->fetchField();
$this->assertTrue($this->tryInsert(), t('Insert with a serial succeeded.'));
$this->assertTrue($this->tryInsert(), 'Insert with a serial succeeded.');
$max2 = db_query('SELECT MAX(test_serial) FROM {test_table}')->fetchField();
$this->assertTrue($max2 > $max1, t('The serial is monotone.'));
$this->assertTrue($max2 > $max1, 'The serial is monotone.');
$count = db_query('SELECT COUNT(*) FROM {test_table}')->fetchField();
$this->assertEqual($count, 2, t('There were two rows.'));
$this->assertEqual($count, 2, 'There were two rows.');
// Use database specific data type and ensure that table is created.
$table_specification = array(
@@ -134,7 +134,7 @@ class SchemaTestCase extends DrupalWebTestCase {
db_create_table('test_timestamp', $table_specification);
}
catch (Exception $e) {}
$this->assertTrue(db_table_exists('test_timestamp'), t('Table with database specific datatype was created.'));
$this->assertTrue(db_table_exists('test_timestamp'), 'Table with database specific datatype was created.');
}
function tryInsert($table = 'test_table') {
@@ -162,7 +162,7 @@ class SchemaTestCase extends DrupalWebTestCase {
function checkSchemaComment($description, $table, $column = NULL) {
if (method_exists(Database::getConnection()->schema(), 'getComment')) {
$comment = Database::getConnection()->schema()->getComment($table, $column);
$this->assertEqual($comment, $description, t('The comment matches the schema description.'));
$this->assertEqual($comment, $description, 'The comment matches the schema description.');
}
}
@@ -193,8 +193,8 @@ class SchemaTestCase extends DrupalWebTestCase {
// Finally, check each column and try to insert invalid values into them.
foreach ($table_spec['fields'] as $column_name => $column_spec) {
$this->assertTrue(db_field_exists($table_name, $column_name), t('Unsigned @type column was created.', array('@type' => $column_spec['type'])));
$this->assertFalse($this->tryUnsignedInsert($table_name, $column_name), t('Unsigned @type column rejected a negative value.', array('@type' => $column_spec['type'])));
$this->assertTrue(db_field_exists($table_name, $column_name), format_string('Unsigned @type column was created.', array('@type' => $column_spec['type'])));
$this->assertFalse($this->tryUnsignedInsert($table_name, $column_name), format_string('Unsigned @type column rejected a negative value.', array('@type' => $column_spec['type'])));
}
}
@@ -312,7 +312,7 @@ class SchemaTestCase extends DrupalWebTestCase {
'primary key' => array('serial_column'),
);
db_create_table($table_name, $table_spec);
$this->pass(t('Table %table created.', array('%table' => $table_name)));
$this->pass(format_string('Table %table created.', array('%table' => $table_name)));
// Check the characteristics of the field.
$this->assertFieldCharacteristics($table_name, 'test_field', $field_spec);
@@ -329,7 +329,7 @@ class SchemaTestCase extends DrupalWebTestCase {
'primary key' => array('serial_column'),
);
db_create_table($table_name, $table_spec);
$this->pass(t('Table %table created.', array('%table' => $table_name)));
$this->pass(format_string('Table %table created.', array('%table' => $table_name)));
// Insert some rows to the table to test the handling of initial values.
for ($i = 0; $i < 3; $i++) {
@@ -339,7 +339,7 @@ class SchemaTestCase extends DrupalWebTestCase {
}
db_add_field($table_name, 'test_field', $field_spec);
$this->pass(t('Column %column created.', array('%column' => 'test_field')));
$this->pass(format_string('Column %column created.', array('%column' => 'test_field')));
// Check the characteristics of the field.
$this->assertFieldCharacteristics($table_name, 'test_field', $field_spec);
@@ -362,7 +362,7 @@ class SchemaTestCase extends DrupalWebTestCase {
->countQuery()
->execute()
->fetchField();
$this->assertEqual($count, 0, t('Initial values filled out.'));
$this->assertEqual($count, 0, 'Initial values filled out.');
}
// Check that the default value has been registered.
@@ -376,7 +376,7 @@ class SchemaTestCase extends DrupalWebTestCase {
->condition('serial_column', $id)
->execute()
->fetchField();
$this->assertEqual($field_value, $field_spec['default'], t('Default value registered.'));
$this->assertEqual($field_value, $field_spec['default'], 'Default value registered.');
}
db_drop_field($table_name, $field_name);

View File

@@ -22,11 +22,11 @@ class SessionTestCase extends DrupalWebTestCase {
* Tests for drupal_save_session() and drupal_session_regenerate().
*/
function testSessionSaveRegenerate() {
$this->assertFalse(drupal_save_session(), t('drupal_save_session() correctly returns FALSE (inside of testing framework) when initially called with no arguments.'), t('Session'));
$this->assertFalse(drupal_save_session(FALSE), t('drupal_save_session() correctly returns FALSE when called with FALSE.'), t('Session'));
$this->assertFalse(drupal_save_session(), t('drupal_save_session() correctly returns FALSE when saving has been disabled.'), t('Session'));
$this->assertTrue(drupal_save_session(TRUE), t('drupal_save_session() correctly returns TRUE when called with TRUE.'), t('Session'));
$this->assertTrue(drupal_save_session(), t('drupal_save_session() correctly returns TRUE when saving has been enabled.'), t('Session'));
$this->assertFalse(drupal_save_session(), 'drupal_save_session() correctly returns FALSE (inside of testing framework) when initially called with no arguments.', 'Session');
$this->assertFalse(drupal_save_session(FALSE), 'drupal_save_session() correctly returns FALSE when called with FALSE.', 'Session');
$this->assertFalse(drupal_save_session(), 'drupal_save_session() correctly returns FALSE when saving has been disabled.', 'Session');
$this->assertTrue(drupal_save_session(TRUE), 'drupal_save_session() correctly returns TRUE when called with TRUE.', 'Session');
$this->assertTrue(drupal_save_session(), 'drupal_save_session() correctly returns TRUE when saving has been enabled.', 'Session');
// Test session hardening code from SA-2008-044.
$user = $this->drupalCreateUser(array('access content'));
@@ -36,7 +36,7 @@ class SessionTestCase extends DrupalWebTestCase {
// Make sure the session cookie is set as HttpOnly.
$this->drupalLogin($user);
$this->assertTrue(preg_match('/HttpOnly/i', $this->drupalGetHeader('Set-Cookie', TRUE)), t('Session cookie is set as HttpOnly.'));
$this->assertTrue(preg_match('/HttpOnly/i', $this->drupalGetHeader('Set-Cookie', TRUE)), 'Session cookie is set as HttpOnly.');
$this->drupalLogout();
// Verify that the session is regenerated if a module calls exit
@@ -46,7 +46,7 @@ class SessionTestCase extends DrupalWebTestCase {
$this->drupalGet('session-test/id');
$matches = array();
preg_match('/\s*session_id:(.*)\n/', $this->drupalGetContent(), $matches);
$this->assertTrue(!empty($matches[1]) , t('Found session ID before logging in.'));
$this->assertTrue(!empty($matches[1]) , 'Found session ID before logging in.');
$original_session = $matches[1];
// We cannot use $this->drupalLogin($user); because we exit in
@@ -57,14 +57,14 @@ class SessionTestCase extends DrupalWebTestCase {
);
$this->drupalPost('user', $edit, t('Log in'));
$this->drupalGet('user');
$pass = $this->assertText($user->name, t('Found name: %name', array('%name' => $user->name)), t('User login'));
$pass = $this->assertText($user->name, format_string('Found name: %name', array('%name' => $user->name)), 'User login');
$this->_logged_in = $pass;
$this->drupalGet('session-test/id');
$matches = array();
preg_match('/\s*session_id:(.*)\n/', $this->drupalGetContent(), $matches);
$this->assertTrue(!empty($matches[1]) , t('Found session ID after logging in.'));
$this->assertTrue($matches[1] != $original_session, t('Session ID changed after login.'));
$this->assertTrue(!empty($matches[1]) , 'Found session ID after logging in.');
$this->assertTrue($matches[1] != $original_session, 'Session ID changed after login.');
}
/**
@@ -80,48 +80,48 @@ class SessionTestCase extends DrupalWebTestCase {
$value_1 = $this->randomName();
$this->drupalGet('session-test/set/' . $value_1);
$this->assertText($value_1, t('The session value was stored.'), t('Session'));
$this->assertText($value_1, 'The session value was stored.', 'Session');
$this->drupalGet('session-test/get');
$this->assertText($value_1, t('Session correctly returned the stored data for an authenticated user.'), t('Session'));
$this->assertText($value_1, 'Session correctly returned the stored data for an authenticated user.', 'Session');
// Attempt to write over val_1. If drupal_save_session(FALSE) is working.
// properly, val_1 will still be set.
$value_2 = $this->randomName();
$this->drupalGet('session-test/no-set/' . $value_2);
$this->assertText($value_2, t('The session value was correctly passed to session-test/no-set.'), t('Session'));
$this->assertText($value_2, 'The session value was correctly passed to session-test/no-set.', 'Session');
$this->drupalGet('session-test/get');
$this->assertText($value_1, t('Session data is not saved for drupal_save_session(FALSE).'), t('Session'));
$this->assertText($value_1, 'Session data is not saved for drupal_save_session(FALSE).', 'Session');
// Switch browser cookie to anonymous user, then back to user 1.
$this->sessionReset();
$this->sessionReset($user->uid);
$this->assertText($value_1, t('Session data persists through browser close.'), t('Session'));
$this->assertText($value_1, 'Session data persists through browser close.', 'Session');
// Logout the user and make sure the stored value no longer persists.
$this->drupalLogout();
$this->sessionReset();
$this->drupalGet('session-test/get');
$this->assertNoText($value_1, t("After logout, previous user's session data is not available."), t('Session'));
$this->assertNoText($value_1, "After logout, previous user's session data is not available.", 'Session');
// Now try to store some data as an anonymous user.
$value_3 = $this->randomName();
$this->drupalGet('session-test/set/' . $value_3);
$this->assertText($value_3, t('Session data stored for anonymous user.'), t('Session'));
$this->assertText($value_3, 'Session data stored for anonymous user.', 'Session');
$this->drupalGet('session-test/get');
$this->assertText($value_3, t('Session correctly returned the stored data for an anonymous user.'), t('Session'));
$this->assertText($value_3, 'Session correctly returned the stored data for an anonymous user.', 'Session');
// Try to store data when drupal_save_session(FALSE).
$value_4 = $this->randomName();
$this->drupalGet('session-test/no-set/' . $value_4);
$this->assertText($value_4, t('The session value was correctly passed to session-test/no-set.'), t('Session'));
$this->assertText($value_4, 'The session value was correctly passed to session-test/no-set.', 'Session');
$this->drupalGet('session-test/get');
$this->assertText($value_3, t('Session data is not saved for drupal_save_session(FALSE).'), t('Session'));
$this->assertText($value_3, 'Session data is not saved for drupal_save_session(FALSE).', 'Session');
// Login, the data should persist.
$this->drupalLogin($user);
$this->sessionReset($user->uid);
$this->drupalGet('session-test/get');
$this->assertNoText($value_1, t('Session has persisted for an authenticated user after logging out and then back in.'), t('Session'));
$this->assertNoText($value_1, 'Session has persisted for an authenticated user after logging out and then back in.', 'Session');
// Change session and create another user.
$user2 = $this->drupalCreateUser(array('access content'));
@@ -143,29 +143,29 @@ class SessionTestCase extends DrupalWebTestCase {
$this->drupalGet('');
$this->assertSessionCookie(FALSE);
$this->assertSessionEmpty(TRUE);
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', t('Page was not cached.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.');
// Start a new session by setting a message.
$this->drupalGet('session-test/set-message');
$this->assertSessionCookie(TRUE);
$this->assertTrue($this->drupalGetHeader('Set-Cookie'), t('New session was started.'));
$this->assertTrue($this->drupalGetHeader('Set-Cookie'), 'New session was started.');
// Display the message, during the same request the session is destroyed
// and the session cookie is unset.
$this->drupalGet('');
$this->assertSessionCookie(FALSE);
$this->assertSessionEmpty(FALSE);
$this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), t('Caching was bypassed.'));
$this->assertText(t('This is a dummy message.'), t('Message was displayed.'));
$this->assertTrue(preg_match('/SESS\w+=deleted/', $this->drupalGetHeader('Set-Cookie')), t('Session cookie was deleted.'));
$this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), 'Caching was bypassed.');
$this->assertText(t('This is a dummy message.'), 'Message was displayed.');
$this->assertTrue(preg_match('/SESS\w+=deleted/', $this->drupalGetHeader('Set-Cookie')), 'Session cookie was deleted.');
// Verify that session was destroyed.
$this->drupalGet('');
$this->assertSessionCookie(FALSE);
$this->assertSessionEmpty(TRUE);
$this->assertNoText(t('This is a dummy message.'), t('Message was not cached.'));
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.'));
$this->assertFalse($this->drupalGetHeader('Set-Cookie'), t('New session was not started.'));
$this->assertNoText(t('This is a dummy message.'), 'Message was not cached.');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertFalse($this->drupalGetHeader('Set-Cookie'), 'New session was not started.');
// Verify that no session is created if drupal_save_session(FALSE) is called.
$this->drupalGet('session-test/set-message-but-dont-save');
@@ -176,7 +176,7 @@ class SessionTestCase extends DrupalWebTestCase {
$this->drupalGet('');
$this->assertSessionCookie(FALSE);
$this->assertSessionEmpty(TRUE);
$this->assertNoText(t('This is a dummy message.'), t('The message was not saved.'));
$this->assertNoText(t('This is a dummy message.'), 'The message was not saved.');
}
/**
@@ -196,29 +196,29 @@ class SessionTestCase extends DrupalWebTestCase {
sleep(1);
$this->drupalGet('session-test/set/foo');
$times2 = db_query($sql, array(':uid' => $user->uid))->fetchObject();
$this->assertEqual($times2->access, $times1->access, t('Users table was not updated.'));
$this->assertNotEqual($times2->timestamp, $times1->timestamp, t('Sessions table was updated.'));
$this->assertEqual($times2->access, $times1->access, 'Users table was not updated.');
$this->assertNotEqual($times2->timestamp, $times1->timestamp, 'Sessions table was updated.');
// Write the same value again, i.e. do not modify the session.
sleep(1);
$this->drupalGet('session-test/set/foo');
$times3 = db_query($sql, array(':uid' => $user->uid))->fetchObject();
$this->assertEqual($times3->access, $times1->access, t('Users table was not updated.'));
$this->assertEqual($times3->timestamp, $times2->timestamp, t('Sessions table was not updated.'));
$this->assertEqual($times3->access, $times1->access, 'Users table was not updated.');
$this->assertEqual($times3->timestamp, $times2->timestamp, 'Sessions table was not updated.');
// Do not change the session.
sleep(1);
$this->drupalGet('');
$times4 = db_query($sql, array(':uid' => $user->uid))->fetchObject();
$this->assertEqual($times4->access, $times3->access, t('Users table was not updated.'));
$this->assertEqual($times4->timestamp, $times3->timestamp, t('Sessions table was not updated.'));
$this->assertEqual($times4->access, $times3->access, 'Users table was not updated.');
$this->assertEqual($times4->timestamp, $times3->timestamp, 'Sessions table was not updated.');
// Force updating of users and sessions table once per second.
variable_set('session_write_interval', 0);
$this->drupalGet('');
$times5 = db_query($sql, array(':uid' => $user->uid))->fetchObject();
$this->assertNotEqual($times5->access, $times4->access, t('Users table was updated.'));
$this->assertNotEqual($times5->timestamp, $times4->timestamp, t('Sessions table was updated.'));
$this->assertNotEqual($times5->access, $times4->access, 'Users table was updated.');
$this->assertNotEqual($times5->timestamp, $times4->timestamp, 'Sessions table was updated.');
}
/**
@@ -228,7 +228,7 @@ class SessionTestCase extends DrupalWebTestCase {
$user = $this->drupalCreateUser(array('access content'));
$this->drupalLogin($user);
$this->drupalGet('session-test/is-logged-in');
$this->assertResponse(200, t('User is logged in.'));
$this->assertResponse(200, 'User is logged in.');
// Reset the sid in {sessions} to a blank string. This may exist in the
// wild in some cases, although we normally prevent it from happening.
@@ -239,10 +239,10 @@ class SessionTestCase extends DrupalWebTestCase {
$this->curlClose();
$this->additionalCurlOptions[CURLOPT_COOKIE] = rawurlencode($this->session_name) . '=;';
$this->drupalGet('session-test/id-from-cookie');
$this->assertRaw("session_id:\n", t('Session ID is blank as sent from cookie header.'));
$this->assertRaw("session_id:\n", 'Session ID is blank as sent from cookie header.');
// Assert that we have an anonymous session now.
$this->drupalGet('session-test/is-logged-in');
$this->assertResponse(403, t('An empty session ID is not allowed.'));
$this->assertResponse(403, 'An empty session ID is not allowed.');
}
/**
@@ -260,7 +260,7 @@ class SessionTestCase extends DrupalWebTestCase {
$this->additionalCurlOptions[CURLOPT_COOKIEFILE] = $this->cookieFile;
$this->additionalCurlOptions[CURLOPT_COOKIESESSION] = TRUE;
$this->drupalGet('session-test/get');
$this->assertResponse(200, t('Session test module is correctly enabled.'), t('Session'));
$this->assertResponse(200, 'Session test module is correctly enabled.', 'Session');
}
/**
@@ -268,10 +268,10 @@ class SessionTestCase extends DrupalWebTestCase {
*/
function assertSessionCookie($sent) {
if ($sent) {
$this->assertNotNull($this->session_id, t('Session cookie was sent.'));
$this->assertNotNull($this->session_id, 'Session cookie was sent.');
}
else {
$this->assertNull($this->session_id, t('Session cookie was not sent.'));
$this->assertNull($this->session_id, 'Session cookie was not sent.');
}
}
@@ -280,10 +280,10 @@ class SessionTestCase extends DrupalWebTestCase {
*/
function assertSessionEmpty($empty) {
if ($empty) {
$this->assertIdentical($this->drupalGetHeader('X-Session-Empty'), '1', t('Session was empty.'));
$this->assertIdentical($this->drupalGetHeader('X-Session-Empty'), '1', 'Session was empty.');
}
else {
$this->assertIdentical($this->drupalGetHeader('X-Session-Empty'), '0', t('Session was not empty.'));
$this->assertIdentical($this->drupalGetHeader('X-Session-Empty'), '0', 'Session was not empty.');
}
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -6,8 +6,8 @@ core = 7.x
hidden = TRUE
dependencies[] = _missing_dependency
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -6,8 +6,8 @@ core = 7.x
hidden = TRUE
dependencies[] = system_incompatible_core_version_test
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 5.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -7,8 +7,8 @@ hidden = TRUE
; system_incompatible_module_version_test declares version 1.0
dependencies[] = system_incompatible_module_version_test (>2.0)
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = 1.0
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -6,8 +6,8 @@ core = 7.x
files[] = system_test.module
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -58,7 +58,7 @@ class TableSortTest extends DrupalUnitTestCase {
);
$ts = tablesort_init($headers);
$this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
$this->assertEqual($ts, $expected_ts, t('Simple table headers sorted correctly.'));
$this->assertEqual($ts, $expected_ts, 'Simple table headers sorted correctly.');
// Test with simple table headers plus $_GET parameters that should _not_
// override the default.
@@ -71,7 +71,7 @@ class TableSortTest extends DrupalUnitTestCase {
);
$ts = tablesort_init($headers);
$this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
$this->assertEqual($ts, $expected_ts, t('Simple table headers plus non-overriding $_GET parameters sorted correctly.'));
$this->assertEqual($ts, $expected_ts, 'Simple table headers plus non-overriding $_GET parameters sorted correctly.');
// Test with simple table headers plus $_GET parameters that _should_
// override the default.
@@ -87,7 +87,7 @@ class TableSortTest extends DrupalUnitTestCase {
$expected_ts['query'] = array('alpha' => 'beta');
$ts = tablesort_init($headers);
$this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
$this->assertEqual($ts, $expected_ts, t('Simple table headers plus $_GET parameters sorted correctly.'));
$this->assertEqual($ts, $expected_ts, 'Simple table headers plus $_GET parameters sorted correctly.');
// Test complex table headers.
@@ -118,7 +118,7 @@ class TableSortTest extends DrupalUnitTestCase {
'query' => array(),
);
$this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
$this->assertEqual($ts, $expected_ts, t('Complex table headers sorted correctly.'));
$this->assertEqual($ts, $expected_ts, 'Complex table headers sorted correctly.');
// Test complex table headers plus $_GET parameters that should _not_
// override the default.
@@ -137,7 +137,7 @@ class TableSortTest extends DrupalUnitTestCase {
'query' => array(),
);
$this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
$this->assertEqual($ts, $expected_ts, t('Complex table headers plus non-overriding $_GET parameters sorted correctly.'));
$this->assertEqual($ts, $expected_ts, 'Complex table headers plus non-overriding $_GET parameters sorted correctly.');
unset($_GET['sort'], $_GET['order'], $_GET['alpha']);
// Test complex table headers plus $_GET parameters that _should_
@@ -159,7 +159,7 @@ class TableSortTest extends DrupalUnitTestCase {
);
$ts = tablesort_init($headers);
$this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
$this->assertEqual($ts, $expected_ts, t('Complex table headers plus $_GET parameters sorted correctly.'));
$this->assertEqual($ts, $expected_ts, 'Complex table headers plus $_GET parameters sorted correctly.');
unset($_GET['sort'], $_GET['order'], $_GET['alpha']);
}

View File

@@ -6,8 +6,8 @@ core = 7.x
hidden = TRUE
dependencies[] = taxonomy
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -33,22 +33,22 @@ class ThemeTestCase extends DrupalWebTestCase {
variable_set('site_frontpage', 'nobody-home');
$args = array('node', '1', 'edit');
$suggestions = theme_get_suggestions($args, 'page');
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1', 'page__node__edit'), t('Found expected node edit page suggestions'));
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1', 'page__node__edit'), 'Found expected node edit page suggestions');
// Check attack vectors.
$args = array('node', '\\1');
$suggestions = theme_get_suggestions($args, 'page');
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), t('Removed invalid \\ from suggestions'));
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), 'Removed invalid \\ from suggestions');
$args = array('node', '1/');
$suggestions = theme_get_suggestions($args, 'page');
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), t('Removed invalid / from suggestions'));
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), 'Removed invalid / from suggestions');
$args = array('node', "1\0");
$suggestions = theme_get_suggestions($args, 'page');
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), t('Removed invalid \\0 from suggestions'));
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), 'Removed invalid \\0 from suggestions');
// Define path with hyphens to be used to generate suggestions.
$args = array('node', '1', 'hyphen-path');
$result = array('page__node', 'page__node__%', 'page__node__1', 'page__node__hyphen_path');
$suggestions = theme_get_suggestions($args, 'page');
$this->assertEqual($suggestions, $result, t('Found expected page suggestions for paths containing hyphens.'));
$this->assertEqual($suggestions, $result, 'Found expected page suggestions for paths containing hyphens.');
}
/**
@@ -78,7 +78,7 @@ class ThemeTestCase extends DrupalWebTestCase {
$suggestions = theme_get_suggestions(explode('/', $_GET['q']), 'page');
// Set it back to not annoy the batch runner.
$_GET['q'] = $q;
$this->assertTrue(in_array('page__front', $suggestions), t('Front page template was suggested.'));
$this->assertTrue(in_array('page__front', $suggestions), 'Front page template was suggested.');
}
/**
@@ -86,7 +86,7 @@ class ThemeTestCase extends DrupalWebTestCase {
*/
function testAlter() {
$this->drupalGet('theme-test/alter');
$this->assertText('The altered data is test_theme_theme_test_alter_alter was invoked.', t('The theme was able to implement an alter hook during page building before anything was rendered.'));
$this->assertText('The altered data is test_theme_theme_test_alter_alter was invoked.', 'The theme was able to implement an alter hook during page building before anything was rendered.');
}
/**
@@ -101,7 +101,7 @@ class ThemeTestCase extends DrupalWebTestCase {
// test theme. First we test with CSS aggregation disabled.
variable_set('preprocess_css', 0);
$this->drupalGet('theme-test/suggestion');
$this->assertNoText('system.base.css', t('The theme\'s .info file is able to override a module CSS file from being added to the page.'));
$this->assertNoText('system.base.css', 'The theme\'s .info file is able to override a module CSS file from being added to the page.');
// Also test with aggregation enabled, simply ensuring no PHP errors are
// triggered during drupal_build_css_cache() when a source file doesn't
@@ -131,19 +131,19 @@ class ThemeTestCase extends DrupalWebTestCase {
function testListThemes() {
$themes = list_themes();
// Check if drupal_theme_access() retrieves enabled themes properly from list_themes().
$this->assertTrue(drupal_theme_access('test_theme'), t('Enabled theme detected'));
$this->assertTrue(drupal_theme_access('test_theme'), 'Enabled theme detected');
// Check if list_themes() returns disabled themes.
$this->assertTrue(array_key_exists('test_basetheme', $themes), t('Disabled theme detected'));
$this->assertTrue(array_key_exists('test_basetheme', $themes), 'Disabled theme detected');
// Check for base theme and subtheme lists.
$base_theme_list = array('test_basetheme' => 'Theme test base theme');
$sub_theme_list = array('test_subtheme' => 'Theme test subtheme');
$this->assertIdentical($themes['test_basetheme']->sub_themes, $sub_theme_list, t('Base theme\'s object includes list of subthemes.'));
$this->assertIdentical($themes['test_subtheme']->base_themes, $base_theme_list, t('Subtheme\'s object includes list of base themes.'));
$this->assertIdentical($themes['test_basetheme']->sub_themes, $sub_theme_list, 'Base theme\'s object includes list of subthemes.');
$this->assertIdentical($themes['test_subtheme']->base_themes, $base_theme_list, 'Subtheme\'s object includes list of base themes.');
// Check for theme engine in subtheme.
$this->assertIdentical($themes['test_subtheme']->engine, 'phptemplate', t('Subtheme\'s object includes the theme engine.'));
$this->assertIdentical($themes['test_subtheme']->engine, 'phptemplate', 'Subtheme\'s object includes the theme engine.');
// Check for theme engine prefix.
$this->assertIdentical($themes['test_basetheme']->prefix, 'phptemplate', t('Base theme\'s object includes the theme engine prefix.'));
$this->assertIdentical($themes['test_subtheme']->prefix, 'phptemplate', t('Subtheme\'s object includes the theme engine prefix.'));
$this->assertIdentical($themes['test_basetheme']->prefix, 'phptemplate', 'Base theme\'s object includes the theme engine prefix.');
$this->assertIdentical($themes['test_subtheme']->prefix, 'phptemplate', 'Subtheme\'s object includes the theme engine prefix.');
}
/**
@@ -151,9 +151,9 @@ class ThemeTestCase extends DrupalWebTestCase {
*/
function testThemeGetSetting() {
$GLOBALS['theme_key'] = 'test_theme';
$this->assertIdentical(theme_get_setting('theme_test_setting'), 'default value', t('theme_get_setting() uses the default theme automatically.'));
$this->assertNotEqual(theme_get_setting('subtheme_override', 'test_basetheme'), theme_get_setting('subtheme_override', 'test_subtheme'), t('Base theme\'s default settings values can be overridden by subtheme.'));
$this->assertIdentical(theme_get_setting('basetheme_only', 'test_subtheme'), 'base theme value', t('Base theme\'s default settings values are inherited by subtheme.'));
$this->assertIdentical(theme_get_setting('theme_test_setting'), 'default value', 'theme_get_setting() uses the default theme automatically.');
$this->assertNotEqual(theme_get_setting('subtheme_override', 'test_basetheme'), theme_get_setting('subtheme_override', 'test_subtheme'), 'Base theme\'s default settings values can be overridden by subtheme.');
$this->assertIdentical(theme_get_setting('basetheme_only', 'test_subtheme'), 'base theme value', 'Base theme\'s default settings values are inherited by subtheme.');
}
}
@@ -177,8 +177,8 @@ class ThemeTableTestCase extends DrupalWebTestCase {
$rows = array(array(1,2,3), array(4,5,6), array(7,8,9));
$this->content = theme('table', array('header' => $header, 'rows' => $rows));
$js = drupal_add_js();
$this->assertTrue(isset($js['misc/tableheader.js']), t('tableheader.js was included when $sticky = TRUE.'));
$this->assertRaw('sticky-enabled', t('Table has a class of sticky-enabled when $sticky = TRUE.'));
$this->assertTrue(isset($js['misc/tableheader.js']), 'tableheader.js was included when $sticky = TRUE.');
$this->assertRaw('sticky-enabled', 'Table has a class of sticky-enabled when $sticky = TRUE.');
drupal_static_reset('drupal_add_js');
}
@@ -193,8 +193,8 @@ class ThemeTableTestCase extends DrupalWebTestCase {
$colgroups = array();
$this->content = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes, 'caption' => $caption, 'colgroups' => $colgroups, 'sticky' => FALSE));
$js = drupal_add_js();
$this->assertFalse(isset($js['misc/tableheader.js']), t('tableheader.js was not included because $sticky = FALSE.'));
$this->assertNoRaw('sticky-enabled', t('Table does not have a class of sticky-enabled because $sticky = FALSE.'));
$this->assertFalse(isset($js['misc/tableheader.js']), 'tableheader.js was not included because $sticky = FALSE.');
$this->assertNoRaw('sticky-enabled', 'Table does not have a class of sticky-enabled because $sticky = FALSE.');
drupal_static_reset('drupal_add_js');
}
@@ -211,10 +211,24 @@ class ThemeTableTestCase extends DrupalWebTestCase {
),
);
$this->content = theme('table', array('header' => $header, 'rows' => array(), 'empty' => t('No strings available.')));
$this->assertRaw('<tr class="odd"><td colspan="3" class="empty message">No strings available.</td>', t('Correct colspan was set on empty message.'));
$this->assertRaw('<thead><tr><th>Header 1</th>', t('Table header was printed.'));
$this->assertRaw('<tr class="odd"><td colspan="3" class="empty message">No strings available.</td>', 'Correct colspan was set on empty message.');
$this->assertRaw('<thead><tr><th>Header 1</th>', 'Table header was printed.');
}
/**
* Tests that the 'no_striping' option works correctly.
*/
function testThemeTableWithNoStriping() {
$rows = array(
array(
'data' => array(1),
'no_striping' => TRUE,
),
);
$this->content = theme('table', array('rows' => $rows));
$this->assertNoRaw('class="odd"', 'Odd/even classes were not added because $no_striping = TRUE.');
$this->assertNoRaw('no_striping', 'No invalid no_striping HTML attribute was printed.');
}
}
/**
@@ -321,14 +335,14 @@ class ThemeLinksTest extends DrupalWebTestCase {
$html = drupal_render($render_array);
$dom = new DOMDocument();
$dom->loadHTML($html);
$this->assertEqual($dom->getElementsByTagName('ul')->length, 1, t('One "ul" tag found in the rendered HTML.'));
$this->assertEqual($dom->getElementsByTagName('ul')->length, 1, 'One "ul" tag found in the rendered HTML.');
$list_elements = $dom->getElementsByTagName('li');
$this->assertEqual($list_elements->length, 3, t('Three "li" tags found in the rendered HTML.'));
$this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link original', t('First expected link found.'));
$this->assertEqual($list_elements->item(1)->nodeValue, 'First child link', t('Second expected link found.'));
$this->assertEqual($list_elements->item(2)->nodeValue, 'Second child link', t('Third expected link found.'));
$this->assertIdentical(strpos($html, 'Parent link copy'), FALSE, t('"Parent link copy" link not found.'));
$this->assertIdentical(strpos($html, 'Third child link'), FALSE, t('"Third child link" link not found.'));
$this->assertEqual($list_elements->length, 3, 'Three "li" tags found in the rendered HTML.');
$this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link original', 'First expected link found.');
$this->assertEqual($list_elements->item(1)->nodeValue, 'First child link', 'Second expected link found.');
$this->assertEqual($list_elements->item(2)->nodeValue, 'Second child link', 'Third expected link found.');
$this->assertIdentical(strpos($html, 'Parent link copy'), FALSE, '"Parent link copy" link not found.');
$this->assertIdentical(strpos($html, 'Third child link'), FALSE, '"Third child link" link not found.');
// Now render 'first_child', followed by the rest of the links, and make
// sure we get two separate <ul>'s with the appropriate links contained
@@ -339,21 +353,21 @@ class ThemeLinksTest extends DrupalWebTestCase {
// First check the child HTML.
$dom = new DOMDocument();
$dom->loadHTML($child_html);
$this->assertEqual($dom->getElementsByTagName('ul')->length, 1, t('One "ul" tag found in the rendered child HTML.'));
$this->assertEqual($dom->getElementsByTagName('ul')->length, 1, 'One "ul" tag found in the rendered child HTML.');
$list_elements = $dom->getElementsByTagName('li');
$this->assertEqual($list_elements->length, 2, t('Two "li" tags found in the rendered child HTML.'));
$this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link copy', t('First expected link found.'));
$this->assertEqual($list_elements->item(1)->nodeValue, 'First child link', t('Second expected link found.'));
$this->assertEqual($list_elements->length, 2, 'Two "li" tags found in the rendered child HTML.');
$this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link copy', 'First expected link found.');
$this->assertEqual($list_elements->item(1)->nodeValue, 'First child link', 'Second expected link found.');
// Then check the parent HTML.
$dom = new DOMDocument();
$dom->loadHTML($parent_html);
$this->assertEqual($dom->getElementsByTagName('ul')->length, 1, t('One "ul" tag found in the rendered parent HTML.'));
$this->assertEqual($dom->getElementsByTagName('ul')->length, 1, 'One "ul" tag found in the rendered parent HTML.');
$list_elements = $dom->getElementsByTagName('li');
$this->assertEqual($list_elements->length, 2, t('Two "li" tags found in the rendered parent HTML.'));
$this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link original', t('First expected link found.'));
$this->assertEqual($list_elements->item(1)->nodeValue, 'Second child link', t('Second expected link found.'));
$this->assertIdentical(strpos($parent_html, 'First child link'), FALSE, t('"First child link" link not found.'));
$this->assertIdentical(strpos($parent_html, 'Third child link'), FALSE, t('"Third child link" link not found.'));
$this->assertEqual($list_elements->length, 2, 'Two "li" tags found in the rendered parent HTML.');
$this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link original', 'First expected link found.');
$this->assertEqual($list_elements->item(1)->nodeValue, 'Second child link', 'Second expected link found.');
$this->assertIdentical(strpos($parent_html, 'First child link'), FALSE, '"First child link" link not found.');
$this->assertIdentical(strpos($parent_html, 'Third child link'), FALSE, '"Third child link" link not found.');
}
}
@@ -378,8 +392,8 @@ class ThemeHookInitTestCase extends DrupalWebTestCase {
*/
function testThemeInitializationHookInit() {
$this->drupalGet('theme-test/hook-init');
$this->assertRaw('Themed output generated in hook_init()', t('Themed output generated in hook_init() correctly appears on the page.'));
$this->assertRaw('bartik/css/style.css', t("The default theme's CSS appears on the page when the theme system is initialized in hook_init()."));
$this->assertRaw('Themed output generated in hook_init()', 'Themed output generated in hook_init() correctly appears on the page.');
$this->assertRaw('bartik/css/style.css', "The default theme's CSS appears on the page when the theme system is initialized in hook_init().");
}
}
@@ -406,7 +420,7 @@ class ThemeFastTestCase extends DrupalWebTestCase {
function testUserAutocomplete() {
$this->drupalLogin($this->account);
$this->drupalGet('user/autocomplete/' . $this->account->name);
$this->assertText('registry not initialized', t('The registry was not initialized'));
$this->assertText('registry not initialized', 'The registry was not initialized');
}
}
@@ -428,11 +442,11 @@ class ThemeHtmlTag extends DrupalUnitTestCase {
function testThemeHtmlTag() {
// Test auto-closure meta tag generation
$tag['element'] = array('#tag' => 'meta', '#attributes' => array('name' => 'description', 'content' => 'Drupal test'));
$this->assertEqual('<meta name="description" content="Drupal test" />'."\n", theme_html_tag($tag), t('Test auto-closure meta tag generation.'));
$this->assertEqual('<meta name="description" content="Drupal test" />'."\n", theme_html_tag($tag), 'Test auto-closure meta tag generation.');
// Test title tag generation
$tag['element'] = array('#tag' => 'title', '#value' => 'title test');
$this->assertEqual('<title>title test</title>'."\n", theme_html_tag($tag), t('Test title tag generation.'));
$this->assertEqual('<title>title test</title>'."\n", theme_html_tag($tag), 'Test title tag generation.');
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -6,8 +6,8 @@ hidden = TRUE
settings[basetheme_only] = base theme value
settings[subtheme_override] = base theme value
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -6,8 +6,8 @@ hidden = TRUE
settings[subtheme_override] = subtheme value
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -17,8 +17,8 @@ stylesheets[all][] = system.base.css
settings[theme_test_setting] = default value
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -80,7 +80,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
}
foreach ($testcase as $input => $output) {
$this->assertEqual(drupal_strtolower($input), $output, t('%input is lowercased as %output', array('%input' => $input, '%output' => $output)));
$this->assertEqual(drupal_strtolower($input), $output, format_string('%input is lowercased as %output', array('%input' => $input, '%output' => $output)));
}
}
@@ -94,7 +94,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
}
foreach ($testcase as $input => $output) {
$this->assertEqual(drupal_strtoupper($input), $output, t('%input is uppercased as %output', array('%input' => $input, '%output' => $output)));
$this->assertEqual(drupal_strtoupper($input), $output, format_string('%input is uppercased as %output', array('%input' => $input, '%output' => $output)));
}
}
@@ -110,7 +110,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
}
foreach ($testcase as $input => $output) {
$this->assertEqual(drupal_ucfirst($input), $output, t('%input is ucfirst-ed as %output', array('%input' => $input, '%output' => $output)));
$this->assertEqual(drupal_ucfirst($input), $output, format_string('%input is ucfirst-ed as %output', array('%input' => $input, '%output' => $output)));
}
}
@@ -121,7 +121,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
);
foreach ($testcase as $input => $output) {
$this->assertEqual(drupal_strlen($input), $output, t('%input length is %output', array('%input' => $input, '%output' => $output)));
$this->assertEqual(drupal_strlen($input), $output, format_string('%input length is %output', array('%input' => $input, '%output' => $output)));
}
}
@@ -181,7 +181,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
foreach ($testcase as $test) {
list($input, $start, $length, $output) = $test;
$result = drupal_substr($input, $start, $length);
$this->assertEqual($result, $output, t('%input substring at offset %offset for %length characters is %output (got %result)', array('%input' => $input, '%offset' => $start, '%length' => $length, '%output' => $output, '%result' => $result)));
$this->assertEqual($result, $output, format_string('%input substring at offset %offset for %length characters is %output (got %result)', array('%input' => $input, '%offset' => $start, '%length' => $length, '%output' => $output, '%result' => $result)));
}
}
@@ -213,7 +213,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
'&euro;' => '€',
);
foreach ($testcase as $input => $output) {
$this->assertEqual(decode_entities($input), $output, t('Make sure the decoded entity of @input is @output', array('@input' => $input, '@output' => $output)));
$this->assertEqual(decode_entities($input), $output, format_string('Make sure the decoded entity of @input is @output', array('@input' => $input, '@output' => $output)));
}
}
@@ -299,7 +299,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
foreach ($cases as $case) {
list($input, $max_length, $expected) = $case;
$output = truncate_utf8($input, $max_length, $wordsafe, $ellipsis);
$this->assertEqual($output, $expected, t('%input truncate to %length characters with %wordsafe, %ellipsis is %expected (got %output)', array('%input' => $input, '%length' => $max_length, '%output' => $output, '%expected' => $expected, '%wordsafe' => ($wordsafe ? 'word-safe' : 'not word-safe'), '%ellipsis' => ($ellipsis ? 'ellipsis' : 'not ellipsis'))));
$this->assertEqual($output, $expected, format_string('%input truncate to %length characters with %wordsafe, %ellipsis is %expected (got %output)', array('%input' => $input, '%length' => $max_length, '%output' => $output, '%expected' => $expected, '%wordsafe' => ($wordsafe ? 'word-safe' : 'not word-safe'), '%ellipsis' => ($ellipsis ? 'ellipsis' : 'not ellipsis'))));
}
}
}

View File

@@ -35,7 +35,7 @@ class UpdateDependencyOrderingTestCase extends DrupalWebTestCase {
'update_test_1_update_7002',
);
$actual_updates = array_keys(update_resolve_dependencies($starting_updates));
$this->assertEqual($expected_updates, $actual_updates, t('Updates within a single module run in the correct order.'));
$this->assertEqual($expected_updates, $actual_updates, 'Updates within a single module run in the correct order.');
}
/**
@@ -49,9 +49,9 @@ class UpdateDependencyOrderingTestCase extends DrupalWebTestCase {
$update_order = array_keys(update_resolve_dependencies($starting_updates));
// Make sure that each dependency is satisfied.
$first_dependency_satisfied = array_search('update_test_2_update_7000', $update_order) < array_search('update_test_3_update_7000', $update_order);
$this->assertTrue($first_dependency_satisfied, t('The dependency of the second module on the first module is respected by the update function order.'));
$this->assertTrue($first_dependency_satisfied, 'The dependency of the second module on the first module is respected by the update function order.');
$second_dependency_satisfied = array_search('update_test_3_update_7000', $update_order) < array_search('update_test_2_update_7001', $update_order);
$this->assertTrue($second_dependency_satisfied, t('The dependency of the first module on the second module is respected by the update function order.'));
$this->assertTrue($second_dependency_satisfied, 'The dependency of the first module on the second module is respected by the update function order.');
}
}
@@ -79,9 +79,9 @@ class UpdateDependencyMissingTestCase extends DrupalWebTestCase {
'update_test_2' => 7000,
);
$update_graph = update_resolve_dependencies($starting_updates);
$this->assertTrue($update_graph['update_test_2_update_7000']['allowed'], t("The module's first update function is allowed to run, since it does not have any missing dependencies."));
$this->assertFalse($update_graph['update_test_2_update_7001']['allowed'], t("The module's second update function is not allowed to run, since it has a direct dependency on a missing update."));
$this->assertFalse($update_graph['update_test_2_update_7002']['allowed'], t("The module's third update function is not allowed to run, since it has an indirect dependency on a missing update."));
$this->assertTrue($update_graph['update_test_2_update_7000']['allowed'], "The module's first update function is allowed to run, since it does not have any missing dependencies.");
$this->assertFalse($update_graph['update_test_2_update_7001']['allowed'], "The module's second update function is not allowed to run, since it has a direct dependency on a missing update.");
$this->assertFalse($update_graph['update_test_2_update_7002']['allowed'], "The module's third update function is not allowed to run, since it has an indirect dependency on a missing update.");
}
}
@@ -107,9 +107,9 @@ class UpdateDependencyHookInvocationTestCase extends DrupalWebTestCase {
*/
function testHookUpdateDependencies() {
$update_dependencies = update_retrieve_dependencies();
$this->assertTrue($update_dependencies['system'][7000]['update_test_1'] == 7000, t('An update function that has a dependency on two separate modules has the first dependency recorded correctly.'));
$this->assertTrue($update_dependencies['system'][7000]['update_test_2'] == 7001, t('An update function that has a dependency on two separate modules has the second dependency recorded correctly.'));
$this->assertTrue($update_dependencies['system'][7001]['update_test_1'] == 7002, t('An update function that depends on more than one update from the same module only has the dependency on the higher-numbered update function recorded.'));
$this->assertTrue($update_dependencies['system'][7000]['update_test_1'] == 7000, 'An update function that has a dependency on two separate modules has the first dependency recorded correctly.');
$this->assertTrue($update_dependencies['system'][7000]['update_test_2'] == 7001, 'An update function that has a dependency on two separate modules has the second dependency recorded correctly.');
$this->assertTrue($update_dependencies['system'][7001]['update_test_1'] == 7002, 'An update function that depends on more than one update from the same module only has the dependency on the higher-numbered update function recorded.');
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -34,7 +34,7 @@ class FieldUpdatePathTestCase extends UpdatePathTestCase {
* Tests that the update is successful.
*/
public function testFilledUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The update was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The update was completed successfully.');
$expected_settings = array(
'extra_fields' => array(
'display' => array(

View File

@@ -32,6 +32,6 @@ class TriggerUpdatePathTestCase extends UpdatePathTestCase {
* Tests that the upgrade is successful.
*/
public function testFilledUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
}
}

View File

@@ -29,7 +29,7 @@ class UserUpdatePathTestCase extends UpdatePathTestCase {
* Tests that the update is successful.
*/
public function testFilledUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The update was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The update was completed successfully.');
$this->assertTrue(db_index_exists('users', 'picture'), 'The {users}.picture column has an index.');
}
}

View File

@@ -27,6 +27,6 @@ class CommentUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testCommentUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
}
}

View File

@@ -28,20 +28,20 @@ class FilterFormatUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
function testFilterFormatUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$format = filter_format_load('1');
$this->assertTrue($format->format == '1', t('Filter format found.'));
$this->assertTrue($format->format == '1', 'Filter format found.');
$format->format = 'test_filter';
$format->name = 'Test filter';
filter_format_save($format);
$format = filter_format_load('test_filter');
$this->assertTrue($format->format == 'test_filter', t('Saved a filter format with machine name.'));
$this->assertTrue($format->format == 'test_filter', 'Saved a filter format with machine name.');
$account = user_load(4);
user_save($account, array('signature_format' => 'test_filter'));
$account = user_load(4);
$this->assertTrue($account->signature_format == 'test_filter', t('Signature format changed successfully to a filter format with machine name.'));
$this->assertTrue($account->signature_format == 'test_filter', 'Signature format changed successfully to a filter format with machine name.');
$delta = db_insert('block_custom')
->fields(array(
@@ -50,6 +50,6 @@ class FilterFormatUpgradePathTestCase extends UpgradePathTestCase {
'format' => 'test_filter',
))
->execute();
$this->assertTrue($delta > 0, t('Created a custom block using a filter format with machine name.'));
$this->assertTrue($delta > 0, 'Created a custom block using a filter format with machine name.');
}
}

View File

@@ -27,7 +27,7 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testForumUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Work around http://drupal.org/node/931512
$this->drupalPost('admin/structure/types/manage/forum/fields', array(), t('Save'));
@@ -47,11 +47,11 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase {
);
$this->drupalPost("node/add/forum/$tid", $edit, t('Save'));
$type = t('Forum topic');
$this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was created'));
$this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), 'Forum topic was created');
// Retrieve node object, ensure that the topic was created and in the proper forum.
$node = $this->drupalGetNodeByTitle($title);
$this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title)));
$this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
$this->assertEqual($node->taxonomy_forums[LANGUAGE_NONE][0]['tid'], $tid, 'Saved forum topic was in the expected forum');
$this->drupalGet("forum/$tid");
@@ -59,6 +59,6 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase {
$this->drupalLogout();
$this->drupalGet("node/add/forum/$tid");
$this->assertResponse(200, t('User can access forum creation page.'));
$this->assertResponse(200, 'User can access forum creation page.');
}
}

View File

@@ -27,7 +27,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testLocaleUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The home page should be in French.
$this->assertPageInLanguage('', 'fr');
@@ -46,13 +46,13 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
// LANGUAGE_NEGOTIATION_PATH_DEFAULT.
$this->variable_set('language_negotiation', 1);
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The home page should be in French.
$this->assertPageInLanguage('', 'fr');
// The language switcher block should be displayed.
$this->assertRaw('block-locale-language', t('The language switcher block is displayed.'));
$this->assertRaw('block-locale-language', 'The language switcher block is displayed.');
// The French prefix should not be active because French is the default language.
$this->drupalGet('fr');
@@ -75,7 +75,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
->condition('uid', 1)
->execute();
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Both prefixes should be active.
$this->assertPageInLanguage('fr', 'fr');
@@ -85,7 +85,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
$this->assertPageInLanguage('', 'en');
// The language switcher block should be displayed.
$this->assertRaw('block-locale-language', t('The language switcher block is displayed.'));
$this->assertRaw('block-locale-language', 'The language switcher block is displayed.');
}
/**
@@ -95,13 +95,13 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
// LANGUAGE_NEGOTIATION_DOMAIN.
$this->variable_set('language_negotiation', 3);
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The home page should be in French.
$this->assertPageInLanguage('', 'fr');
// The language switcher block should be displayed.
$this->assertRaw('block-locale-language', t('The language switcher block is displayed.'));
$this->assertRaw('block-locale-language', 'The language switcher block is displayed.');
// The language switcher block should point to http://en.example.com.
$language_links = $this->xpath('//ul[contains(@class, :class)]/li/a', array(':class' => 'language-switcher-locale-url'));
@@ -111,7 +111,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase {
$found_english_link = TRUE;
}
}
$this->assertTrue($found_english_link, t('The English link points to the correct domain.'));
$this->assertTrue($found_english_link, 'The English link points to the correct domain.');
// Both prefixes should be inactive.
$this->drupalGet('en');

View File

@@ -27,7 +27,7 @@ class MenuUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testMenuUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Test the migration of "Default menu for content" setting to individual
// node types.

View File

@@ -26,7 +26,7 @@ class NodeBodyUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testNodeBodyUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$instance = field_info_instance('node', 'body', 'story');
$this->assertIdentical($instance['required'], 0, 'The required setting was preserved during the upgrade path.');
@@ -77,7 +77,7 @@ class DisabledNodeTypeTestCase extends UpgradePathTestCase {
* Tests a successful upgrade.
*/
public function testDisabledNodeTypeUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->assertTrue(field_info_instance('comment', 'comment_body', 'comment_node_broken'), 'Comment body field instance was created for comments attached to the disabled broken node type');
}
}
@@ -114,7 +114,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testPollUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Check modules page for poll
$this->drupalGet('admin/modules');
@@ -126,14 +126,14 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
$nbchoices = ($i % 4) + 2;
for ($c = 0; $c < $nbchoices; $c++) {
$this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on poll view'));
$this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on poll view');
}
// Now check that the votes are correct
$this->clickLink(t('Results'));
for ($c = 0; $c < $nbchoices; $c++) {
$this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on result view'));
$this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on result view');
}
$nbvotes = floor (($i % 4) + 5);
@@ -141,7 +141,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
for ($c = 0; $c < $nbchoices; $c++) {
$votes = floor($nbvotes / $nbchoices);
if (($nbvotes % $nbchoices) > $c) $votes++;
$this->assertTrue(preg_match("/$votes vote/", $elements[$c]), t('The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]));
$this->assertTrue(preg_match("/$votes vote/", $elements[$c]), 'The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]);
}
}
}

View File

@@ -32,7 +32,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testPollUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Check modules page for poll
$this->drupalGet('admin/modules');
@@ -44,14 +44,14 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
$nbchoices = ($i % 4) + 2;
for ($c = 0; $c < $nbchoices; $c++) {
$this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on poll view'));
$this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on poll view');
}
// Now check that the votes are correct
$this->clickLink(t('Results'));
for ($c = 0; $c < $nbchoices; $c++) {
$this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on result view'));
$this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on result view');
}
$nbvotes = floor (($i % 4) + 5);
@@ -59,7 +59,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase {
for ($c = 0; $c < $nbchoices; $c++) {
$votes = floor($nbvotes / $nbchoices);
if (($nbvotes % $nbchoices) > $c) $votes++;
$this->assertTrue(preg_match("/$votes vote/", $elements[$c]), t('The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]));
$this->assertTrue(preg_match("/$votes vote/", $elements[$c]), 'The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]);
}
}
}

View File

@@ -46,15 +46,15 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
* Basic tests for the taxonomy upgrade.
*/
public function testTaxonomyUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Visit the front page to assert for PHP warning and errors.
$this->drupalGet('');
// Check that taxonomy_vocabulary_node_type and taxonomy_term_node have been
// removed.
$this->assertFalse(db_table_exists('taxonomy_vocabulary_node_type'), t('taxonomy_vocabulary_node_type has been removed.'));
$this->assertFalse(db_table_exists('taxonomy_term_node'), t('taxonomy_term_node has been removed.'));
$this->assertFalse(db_table_exists('taxonomy_vocabulary_node_type'), 'taxonomy_vocabulary_node_type has been removed.');
$this->assertFalse(db_table_exists('taxonomy_term_node'), 'taxonomy_term_node has been removed.');
// Check that the node type 'page' has been associated to a taxonomy
// reference field for each vocabulary.
@@ -66,7 +66,7 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
$inst_keys = array_keys($instances);
sort($voc_keys);
sort($inst_keys);
$this->assertEqual($voc_keys, $inst_keys, t('Node type page has instances for every vocabulary.'));
$this->assertEqual($voc_keys, $inst_keys, 'Node type page has instances for every vocabulary.');
// Ensure instance variables are getting through.
foreach ($instances as $instance) {
@@ -80,13 +80,13 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
// the taxonomyextra field.
$instances = $this->instanceVocabularies('node', 'story');
$field_names = array_flip($instances);
$this->assertEqual(count($field_names), 1, t('Only one taxonomy term field instance exists for story nodes'));
$this->assertEqual(key($field_names), 'taxonomyextra', t('Only the excess taxonomy term field is used on story nodes'));
$this->assertEqual(count($field_names), 1, 'Only one taxonomy term field instance exists for story nodes');
$this->assertEqual(key($field_names), 'taxonomyextra', 'Only the excess taxonomy term field is used on story nodes');
// Check that the node type 'poll' has been associated to no taxonomy
// reference field.
$instances = $this->instanceVocabularies('node', 'poll');
$this->assertTrue(empty($instances), t('Node type poll has no taxonomy term reference field instances.'));
$this->assertTrue(empty($instances), 'Node type poll has no taxonomy term reference field instances.');
// Check that each node of type 'page' and 'story' is associated to all the
// terms except terms whose ID is equal to the node ID or is equal to the
@@ -147,14 +147,14 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
if (!$should_be_displayed) {
// Look for any link with the term path.
$links = $this->xpath('//a[@href=:term_path]', array(':term_path' => $term_path));
$this->assertFalse($links, t('Term %name (@field) is not displayed on node %nid', $args));
$this->assertFalse($links, format_string('Term %name (@field) is not displayed on node %nid', $args));
}
else {
// Look for a link with the term path inside the correct field.
// We search for "SPACE + class + SPACE" to avoid matching a substring
// of the class.
$links = $this->xpath('//div[contains(concat(" ", normalize-space(@class), " "), :field_class)]//a[@href=:term_path]', array(':field_class' => ' ' . $field_class . ' ', ':term_path' => $term_path));
$this->assertTrue($links, t('Term %name (@field) is displayed on node %nid', $args));
$this->assertTrue($links, format_string('Term %name (@field) is displayed on node %nid', $args));
}
}
@@ -162,7 +162,7 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
// ID 0. Make sure we ignored this instead of generating a bogus term.
if ($node->nid == 1) {
$link = l($term->name, 'taxonomy/term/0');
$this->assertNoRaw($link, t('Bogus term (tid 0) is not displayed on node 1 vid %old_vid.', $args));
$this->assertNoRaw($link, format_string('Bogus term (tid 0) is not displayed on node 1 vid %old_vid.', $args));
}
// The first 12 nodes have two revisions. For nodes with
@@ -170,7 +170,7 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
// to terms whose ID is equal to the node ID or 49 less the node ID.
$revisions = node_revision_list($node);
if ($node->nid < 13) {
$this->assertEqual(count($revisions), 2, t('Node %nid has two revisions.', $args));
$this->assertEqual(count($revisions), 2, format_string('Node %nid has two revisions.', $args));
$last_rev = end($revisions);
$args['%old_vid'] = $last_rev->vid;
@@ -183,13 +183,13 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase {
$term = $terms[$node->nid];
$link = l($term->name, 'taxonomy/term/' . $term->tid);
$this->assertRaw($link, t('Term %name (@field) is displayed on node %nid vid %old_vid.', $args));
$this->assertRaw($link, format_string('Term %name (@field) is displayed on node %nid vid %old_vid.', $args));
$term = $terms[49-$node->nid];
$link = l($term->name, 'taxonomy/term/' . $term->tid);
$this->assertRaw($link, t('Term %name (@field) is displayed on node %nid %old_vid.', $args));
$this->assertRaw($link, format_string('Term %name (@field) is displayed on node %nid %old_vid.', $args));
}
else {
$this->assertEqual(count($revisions), 1, t('Node %nid has one revision.', $args));
$this->assertEqual(count($revisions), 1, format_string('Node %nid has one revision.', $args));
}
}
}

View File

@@ -256,7 +256,7 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
// Check if there still are pending updates.
$this->drupalGet($update_url, array('external' => TRUE));
$this->drupalPost(NULL, array(), t('Continue'));
if (!$this->assertText(t('No pending updates.'), t('No pending updates at the end of the update process.'))) {
if (!$this->assertText(t('No pending updates.'), 'No pending updates at the end of the update process.')) {
return FALSE;
}
@@ -358,14 +358,14 @@ class BasicUpgradePath extends UpgradePathTestCase {
// Destroy a table that the upgrade process needs.
db_drop_table('access');
// Assert that the upgrade fails.
$this->assertFalse($this->performUpgrade(FALSE) && $this->pendingUpdates, t('A failed upgrade should return messages.'));
$this->assertFalse($this->performUpgrade(FALSE) && $this->pendingUpdates, 'A failed upgrade should return messages.');
}
/**
* Test a successful upgrade.
*/
public function testBasicUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -374,7 +374,7 @@ class BasicUpgradePath extends UpgradePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -394,7 +394,7 @@ class BasicUpgradePath extends UpgradePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal 6', t('The site name is correctly displayed.'));
$this->assertText('Drupal 6', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -408,11 +408,11 @@ class BasicUpgradePath extends UpgradePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
// Test that the environment after the upgrade is in a consistent status.
$update_d6 = variable_get('update_d6', FALSE);
$this->assertFalse($update_d6, t('The D6 upgrade flag variable has been correctly disabled.'));
$this->assertFalse($update_d6, 'The D6 upgrade flag variable has been correctly disabled.');
}
}
@@ -446,7 +446,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase {
* Tests a successful point release update.
*/
public function testBasicStandardUpdate() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -455,7 +455,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -475,7 +475,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal', t('The site name is correctly displayed.'));
$this->assertText('Drupal', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -489,7 +489,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
}
}
@@ -522,7 +522,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
* Tests a successful point release update.
*/
public function testBasicMinimalUpdate() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -531,7 +531,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -551,7 +551,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal', t('The site name is correctly displayed.'));
$this->assertText('Drupal', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -565,7 +565,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
// Confirm that a date format that just differs in the case can be added.
$admin_date_format = 'j M y';
@@ -613,7 +613,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase {
* Tests a successful point release update.
*/
public function testFilledStandardUpdate() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -622,7 +622,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -642,7 +642,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal', t('The site name is correctly displayed.'));
$this->assertText('Drupal', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -656,7 +656,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
}
}
@@ -689,7 +689,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase {
* Tests a successful point release update.
*/
public function testFilledStandardUpdate() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Hit the frontpage.
$this->drupalGet('');
@@ -698,7 +698,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase {
// Verify that we are still logged in.
$this->drupalGet('user');
$this->clickLink(t('Edit'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
$this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');
// Logout and verify that we can login back in with our initial password.
$this->drupalLogout();
@@ -718,7 +718,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase {
));
// Test that the site name is correctly displayed.
$this->assertText('Drupal', t('The site name is correctly displayed.'));
$this->assertText('Drupal', 'The site name is correctly displayed.');
// Verify that the main admin sections are available.
$this->drupalGet('admin');
@@ -732,6 +732,6 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
$this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
}
}

View File

@@ -28,7 +28,7 @@ class TranslatableUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade (no negotiation).
*/
public function testTranslatableUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// The D6 database contains the english node "First translatable page" with
// nid 53.
@@ -39,12 +39,12 @@ class TranslatableUpgradePathTestCase extends UpgradePathTestCase {
// Check whether the node displays properly.
$this->drupalGet("node/$nid");
$this->assertText($body, t('Translatable node body displays properly'));
$this->assertText($body, 'Translatable node body displays properly');
// Retrieve node object, ensure that both the body and the teaser has
// survived upgrade properly.
$node = $this->drupalGetNodeByTitle($title);
$this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title)));
$this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
$this->assertEqual($node->body[LANGUAGE_NONE][0]['value'], $body, 'Body of the node survived upgrade properly');
$this->assertEqual($node->body[LANGUAGE_NONE][0]['summary'], $teaser, 'Teaser of the node survived upgrade properly');
}

View File

@@ -29,7 +29,7 @@ class UpgradePathTriggerTestCase extends UpgradePathTestCase {
* Basic tests for the trigger upgrade.
*/
public function testTaxonomyUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->drupalGet('admin/structure/trigger/node');
$this->assertRaw('<td>'. t('Make post sticky') .'</td>');
$this->assertRaw('<td>'. t('Publish post') .'</td>');

View File

@@ -29,7 +29,7 @@ class UploadUpgradePathTestCase extends UpgradePathTestCase {
* Test a successful upgrade.
*/
public function testUploadUpgrade() {
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query->entityCondition('bundle', 'page');

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"

View File

@@ -48,7 +48,7 @@ class XMLRPCBasicTestCase extends DrupalWebTestCase {
$url = url(NULL, array('absolute' => TRUE)) . 'xmlrpc.php';
$signature = xmlrpc($url, array('system.methodSignature' => array('system.listMethods')));
$this->assert(is_array($signature) && !empty($signature) && is_array($signature[0]),
t('system.methodSignature returns an array of signature arrays.'));
'system.methodSignature returns an array of signature arrays.');
}
/**
@@ -58,19 +58,19 @@ class XMLRPCBasicTestCase extends DrupalWebTestCase {
$invalid_messages = array(
array(
'message' => xmlrpc_message(''),
'assertion' => t('Empty message correctly rejected during parsing.'),
'assertion' => 'Empty message correctly rejected during parsing.',
),
array(
'message' => xmlrpc_message('<?xml version="1.0" encoding="ISO-8859-1"?>'),
'assertion' => t('Empty message with XML declaration correctly rejected during parsing.'),
'assertion' => 'Empty message with XML declaration correctly rejected during parsing.',
),
array(
'message' => xmlrpc_message('<?xml version="1.0"?><params><param><value><string>value</string></value></param></params>'),
'assertion' => t('Non-empty message without a valid message type is rejected during parsing.'),
'assertion' => 'Non-empty message without a valid message type is rejected during parsing.',
),
array(
'message' => xmlrpc_message('<methodResponse><params><param><value><string>value</string></value></param></methodResponse>'),
'assertion' => t('Non-empty malformed message is rejected during parsing.'),
'assertion' => 'Non-empty malformed message is rejected during parsing.',
),
);
@@ -217,7 +217,7 @@ class XMLRPCMessagesTestCase extends DrupalWebTestCase {
$xml_message_l = xmlrpc_test_message_sized_in_kb($size);
$xml_message_r = xmlrpc($xml_url, array('messages.messageSizedInKB' => array($size)));
$this->assertEqual($xml_message_l, $xml_message_r, t('XML-RPC messages.messageSizedInKB of %s Kb size received', array('%s' => $size)));
$this->assertEqual($xml_message_l, $xml_message_r, format_string('XML-RPC messages.messageSizedInKB of %s Kb size received', array('%s' => $size)));
}
}
@@ -236,9 +236,9 @@ class XMLRPCMessagesTestCase extends DrupalWebTestCase {
$methods2 = xmlrpc($url, array('system.listMethods' => array()));
$diff = array_diff($methods1, $methods2);
$this->assertTrue(is_array($diff) && !empty($diff), t('Method list is altered by hook_xmlrpc_alter'));
$this->assertTrue(is_array($diff) && !empty($diff), 'Method list is altered by hook_xmlrpc_alter');
$removed = reset($diff);
$this->assertEqual($removed, 'system.methodSignature', t('Hiding builting system.methodSignature with hook_xmlrpc_alter works'));
$this->assertEqual($removed, 'system.methodSignature', 'Hiding builting system.methodSignature with hook_xmlrpc_alter works');
}
}

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by drupal.org packaging script on 2013-08-08
version = "7.23"
project = "drupal"
datestamp = "1365027012"
datestamp = "1375928238"