classified_basic.test in Classified Ads 6.2
Same filename and directory in other branches
Basic test for pluggable access.
File
tests/classified_basic.testView source
<?php
/**
* @file
* Basic test for pluggable access.
*/
class ClassifiedBasicTest extends DrupalWebTestCase {
public $admin_user;
public $creator_user;
public $basic_user;
public static function getInfo() {
return array(
'name' => t('Classified'),
'description' => t('Basic tests for Classified.'),
'group' => t('Classified'),
);
}
public function setUp() {
parent::setUp('ed_classified');
$this->admin_user = $this
->drupalCreateUser(array(
'access content',
'administer classified ads',
));
$this->creator_user = $this
->drupalCreateUser(array(
'access content',
'create classified ad content',
));
$this->basic_user = $this
->drupalCreateUser(array(
'access content',
));
}
/**
* Bug 547214: view Ads tab for users without permission.
*/
function test547214() {
$this
->drupalLogin($this->admin_user);
$uid = $this->admin_user->uid;
$this
->assertLink(t('Ads'), 0, t('Ads admin has "Ads" tab'), 'Ads Tab');
$this
->drupalLogin($this->creator_user);
$uid = $this->admin_user->uid;
$this
->assertLink(t('Ads'), 0, t('Ads creator has "Ads" tab'), 'Ads Tab');
$this
->drupalLogin($this->basic_user);
$uid = $this->admin_user->uid;
$this
->assertNoLink(t('Ads'), 0, t('Ads non-creator does not have "Ads" tab'), 'Ads Tab');
}
}
Classes
Name | Description |
---|---|
ClassifiedBasicTest | @file Basic test for pluggable access. |