summaryrefslogtreecommitdiff
path: root/modules/system/system.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-11 03:07:21 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-11 03:07:21 +0000
commitb3265dbe174ce0efefa181b8af6c1eaea3ff22c2 (patch)
treeaa7e8b709c162fd781748d8bebaa12c75727e01e /modules/system/system.test
parent64a1a0d67eb5aecc8e6d78469b19f58e8443c717 (diff)
downloadbrdo-b3265dbe174ce0efefa181b8af6c1eaea3ff22c2.tar.gz
brdo-b3265dbe174ce0efefa181b8af6c1eaea3ff22c2.tar.bz2
#557292 by peximo, plach, catch, and yched: Convert node title to Field API.
Diffstat (limited to 'modules/system/system.test')
-rw-r--r--modules/system/system.test24
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/system/system.test b/modules/system/system.test
index 05b42f290..fdf6887bb 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -533,7 +533,7 @@ class AccessDeniedTestCase extends DrupalWebTestCase {
$this->assertText(t('Access denied'), t('Found the default 403 page'));
$edit = array(
- 'title' => $this->randomName(10),
+ 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(10)))),
'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(100)))),
);
$node = $this->drupalCreateNode($edit);
@@ -542,13 +542,13 @@ class AccessDeniedTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/config/system/site-information', array('site_403' => 'node/' . $node->nid), t('Save configuration'));
$this->drupalGet('admin');
- $this->assertText($node->title, t('Found the custom 403 page'));
+ $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Found the custom 403 page'));
// Logout and check that the user login block is shown on custom 403 pages.
$this->drupalLogout();
$this->drupalGet('admin');
- $this->assertText($node->title, t('Found the custom 403 page'));
+ $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Found the custom 403 page'));
$this->assertText(t('User login'), t('Blocks are shown on the custom 403 page'));
// Log back in and remove the custom 403 page.
@@ -610,7 +610,7 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
$this->assertText(t('Page not found'), t('Found the default 404 page'));
$edit = array(
- 'title' => $this->randomName(10),
+ 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(10)))),
'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(100)))),
);
$node = $this->drupalCreateNode($edit);
@@ -619,7 +619,7 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/config/system/site-information', array('site_404' => 'node/' . $node->nid), t('Save configuration'));
$this->drupalGet($this->randomName(10));
- $this->assertText($node->title, t('Found the custom 404 page'));
+ $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Found the custom 404 page'));
}
}
@@ -805,16 +805,16 @@ class PageTitleFiltering extends DrupalWebTestCase {
// Generate node content.
$langcode = FIELD_LANGUAGE_NONE;
$edit = array(
- 'title' => '!SimpleTest! ' . $title . $this->randomName(20),
+ "title[$langcode][0][value]" => '!SimpleTest! ' . $title . $this->randomName(20),
"body[$langcode][0][value]" => '!SimpleTest! test body' . $this->randomName(200),
);
// Create the node with HTML in the title.
$this->drupalPost('node/add/page', $edit, t('Save'));
- $node = $this->drupalGetNodeByTitle($edit['title']);
+ $node = $this->drupalGetNodeByTitle($edit["title[$langcode][0][value]"]);
$this->assertNotNull($node, 'Node created and found in database');
$this->drupalGet("node/" . $node->nid);
- $this->assertText(check_plain($edit['title']), 'Check to make sure tags in the node title are converted.');
+ $this->assertText(check_plain($edit["title[$langcode][0][value]"]), 'Check to make sure tags in the node title are converted.');
}
}
@@ -1184,7 +1184,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
// Create the initial objects.
$account = $this->drupalCreateUser();
$node = $this->drupalCreateNode(array('uid' => $account->uid));
- $node->title = '<blink>Blinking Text</blink>';
+ $node->title = array(FIELD_LANGUAGE_NONE => array(array('value' => '<blink>Blinking Text</blink>')));
global $user, $language;
$source = '[node:title]'; // Title of the node we passed in
@@ -1195,7 +1195,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$source .= '[date:short]'; // Short date format of REQUEST_TIME
$source .= '[bogus:token]'; // Nonexistent token, should be untouched
- $target = check_plain($node->title);
+ $target = check_plain($node->title[FIELD_LANGUAGE_NONE][0]['value']);
$target .= check_plain($account->name);
$target .= format_interval(REQUEST_TIME - $node->created, 2, $language->language);
$target .= check_plain($user->name);
@@ -1213,10 +1213,10 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$raw_tokens = array('title' => '[node:title]');
$generated = token_generate('node', $raw_tokens, array('node' => $node));
- $this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title)), t('Token sanitized.'));
+ $this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title[FIELD_LANGUAGE_NONE][0]['value'])), t('Token sanitized.'));
$generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE));
- $this->assertFalse(strcmp($generated['[node:title]'], $node->title), t('Unsanitized token generated properly.'));
+ $this->assertFalse(strcmp($generated['[node:title]'], $node->title[FIELD_LANGUAGE_NONE][0]['value']), t('Unsanitized token generated properly.'));
}
}