You are here

ScheduledTransitionsPermissionsUnitTest.php in Scheduled Transitions 8

Same filename and directory in other branches
  1. 2.x tests/src/Unit/ScheduledTransitionsPermissionsUnitTest.php

File

tests/src/Unit/ScheduledTransitionsPermissionsUnitTest.php
View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\scheduled_transitions\Unit;

use Drupal\scheduled_transitions\ScheduledTransitionsPermissions;
use Drupal\Tests\UnitTestCase;

/**
 * Tests scheduled transactions dynamic permissions.
 *
 * @coversDefaultClass \Drupal\scheduled_transitions\ScheduledTransitionsPermissions
 * @group scheduled_transitions
 */
class ScheduledTransitionsPermissionsUnitTest extends UnitTestCase {

  /**
   * Tests result of permission function.
   *
   * @covers ::viewScheduledTransitionsPermission
   */
  public function testViewScheduledTransitionsPermission() : void {
    $actual = ScheduledTransitionsPermissions::viewScheduledTransitionsPermission('foo', 'bar');
    $this
      ->assertEquals('view scheduled transitions foo bar', $actual);
  }

  /**
   * Tests result of permission function.
   *
   * @covers ::viewScheduledTransitionsPermission
   */
  public function testAddScheduledTransitionsPermission() : void {
    $actual = ScheduledTransitionsPermissions::addScheduledTransitionsPermission('foo', 'bar');
    $this
      ->assertEquals('add scheduled transitions foo bar', $actual);
  }

}

Classes

Namesort descending Description
ScheduledTransitionsPermissionsUnitTest Tests scheduled transactions dynamic permissions.