Commit 6ec9c1ff authored by webchick's avatar webchick

Issue #2384165 by tibbsa: Clean-up Contextual module test members — ensure...

Issue #2384165 by tibbsa: Clean-up Contextual module test members — ensure property definition and use of camelCase naming convention
parent a30b30bf
......@@ -19,6 +19,27 @@
*/
class ContextualDynamicContextTest extends WebTestBase {
/**
* A user with permission to access contextual links and edit content.
*
* @var \Drupal\user\UserInterface
*/
protected $editorUser;
/**
* An authenticated user with permission to access contextual links.
*
* @var \Drupal\user\UserInterface
*/
protected $authenticatedUser;
/**
* A simulated anonymous user with access only to node content.
*
* @var \Drupal\user\UserInterface
*/
protected $anonymousUser;
/**
* Modules to enable.
*
......@@ -32,9 +53,9 @@ protected function setUp() {
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
$this->editor_user = $this->drupalCreateUser(array('access content', 'access contextual links', 'edit any article content'));
$this->authenticated_user = $this->drupalCreateUser(array('access content', 'access contextual links'));
$this->anonymous_user = $this->drupalCreateUser(array('access content'));
$this->editorUser = $this->drupalCreateUser(array('access content', 'access contextual links', 'edit any article content'));
$this->authenticatedUser = $this->drupalCreateUser(array('access content', 'access contextual links'));
$this->anonymousUser = $this->drupalCreateUser(array('access content'));
}
/**
......@@ -44,7 +65,7 @@ protected function setUp() {
* not allowed to use contextual links.
*/
function testDifferentPermissions() {
$this->drupalLogin($this->editor_user);
$this->drupalLogin($this->editorUser);
// Create three nodes in the following order:
// - An article, which should be user-editable.
......@@ -80,7 +101,7 @@ function testDifferentPermissions() {
$this->assertIdentical($json[$ids[3]], '');
// Authenticated user: can access contextual links, cannot edit articles.
$this->drupalLogin($this->authenticated_user);
$this->drupalLogin($this->authenticatedUser);
$this->drupalGet('node');
for ($i = 0; $i < count($ids); $i++) {
$this->assertContextualLinkPlaceHolder($ids[$i]);
......@@ -97,7 +118,7 @@ function testDifferentPermissions() {
$this->assertIdentical($json[$ids[3]], '');
// Anonymous user: cannot access contextual links.
$this->drupalLogin($this->anonymous_user);
$this->drupalLogin($this->anonymousUser);
$this->drupalGet('node');
for ($i = 0; $i < count($ids); $i++) {
$this->assertContextualLinkPlaceHolder($ids[$i]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment