| 1 |
<?php |
<?php |
| 2 |
// $Id: stumble.test,v 1.1.2.2 2008/11/28 19:10:17 davereid Exp $ |
// $Id: stumble.test,v 1.1.2.3 2008/12/24 14:13:46 davereid Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 27 |
*/ |
*/ |
| 28 |
function testStumbleLink() { |
function testStumbleLink() { |
| 29 |
$node = $this->drupalCreateNode(array('promote' => 1, 'type' => 'story')); |
$node = $this->drupalCreateNode(array('promote' => 1, 'type' => 'story')); |
| 30 |
$stumble_link = '<a href="'. |
$stumble_link = l(t('Stumble'), 'stumble', array('query' => "nid={$node->nid}&type={$node->type}", title = t('View a random page on this site.'), class = "stumble")); |
| 31 |
$this->drupalGet('node'); |
$this->drupalGet('node'); |
| 32 |
$this->assertNoLink(t('Stumble'), t('No stumble link found on teasers.')); |
$this->assertNoLink(t('Stumble'), t('No stumble link found on teasers.')); |
| 33 |
|
|
| 63 |
for ($i = 0; $i < 8; $i++) { |
for ($i = 0; $i < 8; $i++) { |
| 64 |
$this->drupalGet('stumble'); |
$this->drupalGet('stumble'); |
| 65 |
foreach ($nodes as &$node) { |
foreach ($nodes as &$node) { |
| 66 |
if ($this->get); |
if ($this->getUrl() == url('node/'. $node->nid, array('absolute' => TRUE))) { |
| 67 |
|
if ($i < 4) { |
| 68 |
|
$this->assertTrue($node->unread, t('Node was unread.')); |
| 69 |
$node->unread = FALSE; |
$node->unread = FALSE; |
| 70 |
} |
} |
| 71 |
else { |
else { |