12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- class ContextualDynamicContextTestCase extends DrupalWebTestCase {
- protected $profile = 'testing';
- public static function getInfo() {
- return array(
- 'name' => 'Contextual links on node lists',
- 'description' => 'Tests if contextual links are showing on the front page depending on permissions.',
- 'group' => 'Contextual',
- );
- }
- function setUp() {
- parent::setUp(array('contextual', 'node'));
- $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
- $web_user = $this->drupalCreateUser(array('access content', 'access contextual links', 'edit any article content'));
- $this->drupalLogin($web_user);
- }
-
- function testNodeLinks() {
-
-
-
-
- $node1 = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
- $node2 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 1));
- $node3 = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
-
-
- $this->drupalGet('node');
- $this->assertRaw('node/' . $node1->nid . '/edit', 'Edit link for oldest article node showing.');
- $this->assertNoRaw('node/' . $node2->nid . '/edit', 'No edit link for page nodes.');
- $this->assertRaw('node/' . $node3->nid . '/edit', 'Edit link for most recent article node showing.');
- }
- }
|