public function GroupSubscribeFormatterTest::testGroupMemberActive in Organic groups 8
Tests the formatter for an "active" group member.
File
- tests/
src/ Unit/ GroupSubscribeFormatterTest.php, line 248
Class
- GroupSubscribeFormatterTest
- Tests the OG group formatter.
Namespace
Drupal\Tests\og\UnitCode
public function testGroupMemberActive() {
$this->group
->getOwnerId()
->willReturn(rand(100, 200));
$this->ogAccess
->userAccess($this->group
->reveal(), 'subscribe without approval', $this->user
->reveal())
->willReturn($this->accessResult
->reveal());
$this->accessResult
->isAllowed()
->willReturn(TRUE);
$elements = $this
->getElements();
$this
->assertEquals('Subscribe to group', $elements[0]['#title']);
}