You are here

public function ServiceResourceTest::testCanConstructResourceNoCacheTrue in Services 8.4

Same name and namespace in other branches
  1. 9.0.x tests/src/Unit/Entity/ServiceResourceTest.php \Drupal\Tests\services\Unit\Entity\ServiceResourceTest::testCanConstructResourceNoCacheTrue()

File

tests/src/Unit/Entity/ServiceResourceTest.php, line 50

Class

ServiceResourceTest
@coversDefaultClass \Drupal\services\Entity\ServiceResource

Namespace

Drupal\Tests\services\Unit\Entity

Code

public function testCanConstructResourceNoCacheTrue() {

  /** @var \Drupal\services\Entity\ServiceResource $resource */
  $resource = new ServiceResource([
    'service_plugin_id' => 'test:plugin:id',
    'service_endpoint_id' => 'test_endpoint_id',
    'formats' => [],
    'authentication' => [],
    'no_cache' => TRUE,
  ], 'service_endpoint_resource');
  $this
    ->assertEquals(1, $resource
    ->getNoCache(), 'Cache setting found.');
}