Closed (works as designed)
Project:
SimpleTest
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2009 at 13:53 UTC
Updated:
29 Apr 2009 at 17:16 UTC
Here's my function:
function testWeblinksCreate() {
// Prepare a user to do the stuff.
$user = $this->drupalCreateUser(array('access content', 'access web links', 'create weblinks', 'edit own weblinks'));
$this->drupalLogin($user);
$settings = array(
'type' => 'weblinks',
'title' => 'A sample link',
'url' => 'http://www.example.com',
'weight' => 0,
);
$link1 = $this->drupalCreateNode($settings);
// Now do a list.
$this->drupalGet('weblinks');
$this->assertEqual($link1->is_new, 1, t('Link node created.'), 'Basic');
$this->assertText($link1->title, t('Node title appears on the list.'), 'Basic');
$this->assertNoText(t('There are no weblinks to display yet.'), t('No empty list message.'), 'Basic');
$check = db_result(db_query("SELECT url FROM {weblinks} WHERE nid=%d", $link1->nid));
$this->assertEqual($link1->url, $check, t('URL successfully stored.'), 'Basic');
}
The node appears to be created, but the "drupalGet" is not finding any nodes to display. What am I doing wrong?
Comments
Comment #1
nancydruI have now added a second node to my test and it is unpublished, but a db_query fails to find it.
Comment #2
nancydruActually, I'm wondering, since Taxonomy is on by default in 6.x, is it turned on when I do
parent::setUp('weblinks', 'help');?Comment #3
nancydruCongratulations, SimpleTest found a bug in my module.