diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-11 03:07:21 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-11 03:07:21 +0000 |
commit | b3265dbe174ce0efefa181b8af6c1eaea3ff22c2 (patch) | |
tree | aa7e8b709c162fd781748d8bebaa12c75727e01e /modules/tracker | |
parent | 64a1a0d67eb5aecc8e6d78469b19f58e8443c717 (diff) | |
download | brdo-b3265dbe174ce0efefa181b8af6c1eaea3ff22c2.tar.gz brdo-b3265dbe174ce0efefa181b8af6c1eaea3ff22c2.tar.bz2 |
#557292 by peximo, plach, catch, and yched: Convert node title to Field API.
Diffstat (limited to 'modules/tracker')
-rw-r--r-- | modules/tracker/tracker.test | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/modules/tracker/tracker.test b/modules/tracker/tracker.test index 7aa215bd1..e304be310 100644 --- a/modules/tracker/tracker.test +++ b/modules/tracker/tracker.test @@ -32,17 +32,17 @@ class TrackerTest extends DrupalWebTestCase { $this->drupalLogin($this->user); $unpublished = $this->drupalCreateNode(array( - 'title' => $this->randomName(8), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'status' => 0, )); $published = $this->drupalCreateNode(array( - 'title' => $this->randomName(8), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'status' => 1, )); $this->drupalGet('tracker'); - $this->assertNoText($unpublished->title, t('Unpublished node do not show up in the tracker listing.')); - $this->assertText($published->title, t('Published node show up in the tracker listing.')); + $this->assertNoText($unpublished->title[FIELD_LANGUAGE_NONE][0]['value'], t('Unpublished node do not show up in the tracker listing.')); + $this->assertText($published->title[FIELD_LANGUAGE_NONE][0]['value'], t('Published node show up in the tracker listing.')); $this->assertLink(t('My recent posts'), 0, t('User tab shows up on the global tracker page.')); } @@ -53,22 +53,22 @@ class TrackerTest extends DrupalWebTestCase { $this->drupalLogin($this->user); $unpublished = $this->drupalCreateNode(array( - 'title' => $this->randomName(8), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'uid' => $this->user->uid, 'status' => 0, )); $my_published = $this->drupalCreateNode(array( - 'title' => $this->randomName(8), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'uid' => $this->user->uid, 'status' => 1, )); $other_published_no_comment = $this->drupalCreateNode(array( - 'title' => $this->randomName(8), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'uid' => $this->other_user->uid, 'status' => 1, )); $other_published_my_comment = $this->drupalCreateNode(array( - 'title' => $this->randomName(8), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), 'uid' => $this->other_user->uid, 'status' => 1, )); @@ -79,10 +79,10 @@ class TrackerTest extends DrupalWebTestCase { $this->drupalPost('comment/reply/' . $other_published_my_comment->nid, $comment, t('Save')); $this->drupalGet('user/' . $this->user->uid . '/track'); - $this->assertNoText($unpublished->title, t("Unpublished nodes do not show up in the users's tracker listing.")); - $this->assertText($my_published->title, t("Published nodes show up in the user's tracker listing.")); - $this->assertNoText($other_published_no_comment->title, t("Other user's nodes do not show up in the user's tracker listing.")); - $this->assertText($other_published_my_comment->title, t("Nodes that the user has commented on appear in the user's tracker listing.")); + $this->assertNoText($unpublished->title[FIELD_LANGUAGE_NONE][0]['value'], t("Unpublished nodes do not show up in the users's tracker listing.")); + $this->assertText($my_published->title[FIELD_LANGUAGE_NONE][0]['value'], t("Published nodes show up in the user's tracker listing.")); + $this->assertNoText($other_published_no_comment->title[FIELD_LANGUAGE_NONE][0]['value'], t("Other user's nodes do not show up in the user's tracker listing.")); + $this->assertText($other_published_my_comment->title[FIELD_LANGUAGE_NONE][0]['value'], t("Nodes that the user has commented on appear in the user's tracker listing.")); } /** @@ -92,24 +92,25 @@ class TrackerTest extends DrupalWebTestCase { $this->drupalLogin($this->user); $edit = array( - 'title' => $this->randomName(), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), ); - $node = $this->drupalCreateNode($edit); + $node = $this->drupalCreateNode($edit); + $title = $edit['title'][FIELD_LANGUAGE_NONE][0]['value']; $this->drupalGet('tracker'); - $this->assertPattern('/' . $edit['title'] . '.*new/', t('New nodes are flagged as such in the tracker listing.')); + $this->assertPattern('/' . $title . '.*new/', t('New nodes are flagged as such in the tracker listing.')); $this->drupalGet('node/' . $node->nid); $this->drupalGet('tracker'); - $this->assertNoPattern('/' . $edit['title'] . '.*new/', t('Visited nodes are not flagged as new.')); + $this->assertNoPattern('/' . $title . '.*new/', t('Visited nodes are not flagged as new.')); $this->drupalLogin($this->other_user); $this->drupalGet('tracker'); - $this->assertPattern('/' . $edit['title'] . '.*new/', t('For another user, new nodes are flagged as such in the tracker listing.')); + $this->assertPattern('/' . $title . '.*new/', t('For another user, new nodes are flagged as such in the tracker listing.')); $this->drupalGet('node/' . $node->nid); $this->drupalGet('tracker'); - $this->assertNoPattern('/' . $edit['title'] . '.*new/', t('For another user, visited nodes are not flagged as new.')); + $this->assertNoPattern('/' . $title . '.*new/', t('For another user, visited nodes are not flagged as new.')); } /** @@ -120,7 +121,7 @@ class TrackerTest extends DrupalWebTestCase { $node = $this->drupalCreateNode(array( 'comment' => 2, - 'title' => $this->randomName(), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName(8)))), )); // Add a comment to the page. @@ -162,7 +163,7 @@ class TrackerTest extends DrupalWebTestCase { for ($i = 1; $i <= 3; $i++) { $edits[$i] = array( 'comment' => 2, - 'title' => $this->randomName(), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName()))), ); $nodes[$i] = $this->drupalCreateNode($edits[$i]); } @@ -192,7 +193,7 @@ class TrackerTest extends DrupalWebTestCase { // Assert that all node titles are displayed. foreach ($nodes as $i => $node) { - $this->assertText($node->title, t('Node @i is displayed on the tracker listing pages.', array('@i' => $i))); + $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node @i is displayed on the tracker listing pages.', array('@i' => $i))); } $this->assertText('1 new', t('New comment is counted on the tracker listing pages.')); $this->assertText('updated', t('Node is listed as updated')); @@ -203,7 +204,7 @@ class TrackerTest extends DrupalWebTestCase { // Assert that all node titles are displayed. foreach ($nodes as $i => $node) { - $this->assertText($node->title, t('Node @i is displayed on the tracker listing pages.', array('@i' => $i))); + $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node @i is displayed on the tracker listing pages.', array('@i' => $i))); } $this->assertText('1 new', t('New comment is counted on the tracker listing pages.')); } @@ -217,12 +218,12 @@ class TrackerTest extends DrupalWebTestCase { $node = $this->drupalCreateNode(array( 'comment' => 2, - 'title' => $this->randomName(), + 'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => $this->randomName()))), )); // Assert that the node is displayed. $this->drupalGet('tracker'); - $this->assertText($node->title, t('Node is displayed on the tracker listing pages.')); + $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node is displayed on the tracker listing pages.')); // Unpublish the node and ensure that it's no longer displayed. $edit = array( |