Skip to content

Commit

Permalink
Fix GroupTabTest
Browse files Browse the repository at this point in the history
  • Loading branch information
DiDebru committed Nov 22, 2018
1 parent a3513a1 commit 364255a
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions tests/src/Functional/GroupTabTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ class GroupTabTest extends BrowserTestBase {
*/
protected $group;

/**
* Test entity group.
*
* @var \Drupal\node\NodeInterface
*/
protected $nonGroup;

/**
* A group bundle name.
*
Expand Down Expand Up @@ -82,24 +75,19 @@ protected function setUp() {
Og::groupTypeManager()->addGroup('node', $this->bundle1);

// Create node author user.
$user = $this->createUser();
$this->user1 = $this->drupalCreateUser(['administer group']);

// Create normal user.
$this->user2 = $this->drupalCreateUser(['access content']);

// Create nodes.
$this->group = Node::create([
'type' => $this->bundle1,
'title' => $this->randomString(),
'uid' => $user->id(),
'uid' => $this->user1->id(),
]);
$this->group->save();

$this->nonGroup = Node::create([
'type' => $this->bundle2,
'title' => $this->randomString(),
'uid' => $user->id(),
]);
$this->nonGroup->save();

$this->user1 = $this->drupalCreateUser(['administer group']);
}

/**
Expand All @@ -109,8 +97,11 @@ public function testGroupTab() {
$this->drupalLogin($this->user1);
$this->drupalGet('group/node/' . $this->group->id() . '/admin');
$this->assertResponse(200);
$this->drupalLogout();
}

$this->drupalGet('group/node/' . $this->nonGroup->id() . '/admin');
public function testGroupTabAccessDenied() {
$this->drupalGet('group/node/' . $this->group->id() . '/admin');
$this->assertResponse(403);
}

Expand Down

0 comments on commit 364255a

Please sign in to comment.