You are here

public function DeleteOgMembershipActionTest::testExecute in Organic groups 8

Checks if the action can be performed correctly.

@covers ::execute @dataProvider executeProvider

Parameters

string $membership: The membership on which to perform the action.

Overrides ActionTestBase::testExecute

File

tests/src/Kernel/Action/DeleteOgMembershipActionTest.php, line 31

Class

DeleteOgMembershipActionTest
Tests the DeleteOgMembership action plugin.

Namespace

Drupal\Tests\og\Kernel\Action

Code

public function testExecute($membership = NULL) {
  $membership = $this->memberships[$membership];
  $member = $membership
    ->getOwner();

  /** @var \Drupal\og\Plugin\Action\AddSingleOgMembershipRole $plugin */
  $plugin = $this
    ->getPlugin();
  $plugin
    ->execute($membership);
  $this
    ->assertFalse($this->membershipManager
    ->isMember($this->group, $member
    ->id(), [
    OgMembershipInterface::STATE_ACTIVE,
    OgMembershipInterface::STATE_BLOCKED,
    OgMembershipInterface::STATE_PENDING,
  ]));
}