og-8.x-1.x-dev/tests/src/Unit/OgRoleTest.php

tests/src/Unit/OgRoleTest.php
<?php

declare(strict_types=1);

namespace Drupal\Tests\og\Unit;

use Drupal\Tests\UnitTestCase;
use Drupal\og\Entity\OgRole;

/**
 * Unit tests for the OgRole config entity.
 *
 * @group og
 * @coversDefaultClass \Drupal\og\Entity\OgRole
 */
class OgRoleTest extends UnitTestCase {

  /**
   * Tests getting and setting the admin role through the inherited methods.
   *
   * @param bool $value
   *   A boolean value whether or not the admin role will be set.
   *
   * @covers ::isAdmin
   * @covers ::setIsAdmin
   *
   * @dataProvider booleanProvider
   */
  public function testIsAdmin(bool $value): void {
    $role = new OgRole([]);
    $role->setIsAdmin($value);
    $this->assertEquals($value, $role->isAdmin());
  }

  /**
   * Provides boolean data.
   */
  public static function booleanProvider(): array {
    return [[TRUE], [FALSE]];
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc