function ResourceTypeRepositoryTest::testAll

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

Tests all.

File

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

Class

ResourceTypeRepositoryTest
Tests Drupal\jsonapi\ResourceType\ResourceTypeRepository.

Namespace

Drupal\Tests\jsonapi\Kernel\ResourceType

Code

public function testAll() : void {
  // 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());
  });
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.