You are here

public function RestIncidentStorageTest::testGetInvalidIncident in Radioactivity 4.0.x

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

@covers ::getIncidents

File

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

Class

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

Namespace

Drupal\Tests\radioactivity\Unit

Code

public function testGetInvalidIncident() {
  $incidentData = Json::decode('[[{"fn":"field_name","et":"entity_type","id":"99","ti":0,"e":10,"h":"invalid-hash"}]]');
  $this->sut
    ->expects($this
    ->once())
    ->method('getIncidentsFromStorage')
    ->will($this
    ->returnValue($incidentData));
  $result = $this->sut
    ->getIncidents();
  $this
    ->assertCount(0, $result);
}