You are here

public function EntitySubjectTest::testDetachMethod in Changed Fields API 8.3

Entity subject can detach observers.

File

tests/src/Unit/EntitySubjectTest.php, line 63

Class

EntitySubjectTest
@coversDefaultClass \Drupal\changed_fields\EntitySubject

Namespace

Drupal\Tests\changed_fields\Unit

Code

public function testDetachMethod() {
  $observer_mock = $this
    ->createMock('SplObserver');
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('Observer must implement ObserverInterface interface.');
  $this->entitySubject
    ->detach($observer_mock);
}