You are here

public function RestIncidentStorageTest::testAddIncident in Radioactivity 8.3

Same name and namespace in other branches
  1. 4.0.x tests/src/Unit/RestIncidentStorageTest.php \Drupal\Tests\radioactivity\Unit\RestIncidentStorageTest::testAddIncident()

@covers ::addIncident

File

tests/src/Unit/RestIncidentStorageTest.php, line 48

Class

RestIncidentStorageTest
@coversDefaultClass \Drupal\radioactivity\RestIncidentStorage @group radioactivity

Namespace

Drupal\Tests\radioactivity\Unit

Code

public function testAddIncident() {
  $incident = $this
    ->getMockBuilder(IncidentInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this
    ->expectException("Exception");
  $this
    ->expectExceptionMessage("The Radioactivity rest endpoint expects incidents to be added somewhere else.");
  $this->sut
    ->addIncident($incident);
}