You are here

public function UnitTest::testAcsfEventHandlerIncompatibleType in Acquia Cloud Site Factory Connector 8

Same name and namespace in other branches
  1. 8.2 tests/AcsfEventsTest.php \UnitTest::testAcsfEventHandlerIncompatibleType()

Tests that incompatible handler types may not be used.

File

tests/AcsfEventsTest.php, line 119
Provides PHPUnit tests for the Acsf Events system.

Class

UnitTest

Code

public function testAcsfEventHandlerIncompatibleType() {
  $registry = acsf_get_registry(FALSE, 'UnitTestDummyHandler1');
  $event = new AcsfEvent(new AcsfEventDispatcher(), new AcsfLog(), 'unit_test', $registry, []);

  // Pass in a bogus handler type to trigger an exception.
  $this
    ->expectException(AcsfEventHandlerIncompatibleException::class);
  $event
    ->popHandler('bogus_type');
}