You are here

protected function DefaultRoleEventTest::assertRoleEquals in Organic groups 8

Asserts that the given role properties matches the expected result.

Parameters

\Drupal\og\Entity\OgRole $expected: The expected role.

\Drupal\og\Entity\OgRole $actual: The actual OgRole entity to check.

Note that we are not specifying the OgRoleInterface type because of a PHP 5 class inheritance limitation.

8 calls to DefaultRoleEventTest::assertRoleEquals()
DefaultRoleEventTest::testAddRole in tests/src/Unit/DefaultRoleEventTest.php
Tests adding an OG role to the default role event.
DefaultRoleEventTest::testAddRoles in tests/src/Unit/DefaultRoleEventTest.php
Tests adding OG roles to the default role event.
DefaultRoleEventTest::testGetRole in tests/src/Unit/DefaultRoleEventTest.php
Tests getting OG roles from the default role event.
DefaultRoleEventTest::testGetRoles in tests/src/Unit/DefaultRoleEventTest.php
Tests getting OG roles from the default role event.
DefaultRoleEventTest::testIteratorAggregate in tests/src/Unit/DefaultRoleEventTest.php
Tests "testIteratorAggregate".

... See full list

File

tests/src/Unit/DefaultRoleEventTest.php, line 528

Class

DefaultRoleEventTest
Tests default role events.

Namespace

Drupal\Tests\og\Unit

Code

protected function assertRoleEquals(OgRole $expected, OgRole $actual) {
  foreach ([
    'name',
    'label',
    'role_type',
    'is_admin',
  ] as $property) {
    $this
      ->assertEquals($expected
      ->get($property), $actual
      ->get($property));
  }
}