You are here

public function ResourceTypeRepositoryTest::testAll in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php \Drupal\Tests\jsonapi\Kernel\ResourceType\ResourceTypeRepositoryTest::testAll()

@covers ::all

File

core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php, line 65

Class

ResourceTypeRepositoryTest
@coversDefaultClass \Drupal\jsonapi\ResourceType\ResourceTypeRepository @group jsonapi

Namespace

Drupal\Tests\jsonapi\Kernel\ResourceType

Code

public function testAll() {

  // Make sure that there are resources being created.
  $all = $this->resourceTypeRepository
    ->all();
  $this
    ->assertNotEmpty($all);
  array_walk($all, function (ResourceType $resource_type) {
    $this
      ->assertNotEmpty($resource_type
      ->getDeserializationTargetClass());
    $this
      ->assertNotEmpty($resource_type
      ->getEntityTypeId());
    $this
      ->assertNotEmpty($resource_type
      ->getTypeName());
  });
}