You are here

TokenTest.php in Hook Event Dispatcher 8.2

Same filename and directory in other branches
  1. 3.x modules/core_event_dispatcher/tests/src/Unit/Token/TokenTest.php

File

modules/core_event_dispatcher/tests/src/Unit/Token/TokenTest.php
View source
<?php

namespace Drupal\Tests\core_event_dispatcher\Unit\Token;

use Drupal\core_event_dispatcher\ValueObject\Token;
use PHPUnit\Framework\TestCase;
use UnexpectedValueException;

/**
 * Class TokenTest.
 *
 * @group hook_event_dispatcher
 */
class TokenTest extends TestCase {

  /**
   * Test Token invalid token exception.
   */
  public function testTokenInvalidNameException() : void {
    $this
      ->expectException(UnexpectedValueException::class);
    Token::create('', '', NULL);
  }

  /**
   * Test Token invalid description exception.
   */
  public function testTokenInvalidDescriptionException() : void {
    $this
      ->expectException(UnexpectedValueException::class);
    Token::create('', '', '')
      ->setDescription(NULL);
  }

}

Classes

Namesort descending Description
TokenTest Class TokenTest.