You are here

public function ResourceResponseSubscriberTest::providerTestSerialization in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php \Drupal\Tests\rest\Unit\EventSubscriber\ResourceResponseSubscriberTest::providerTestSerialization()

File

core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php, line 54

Class

ResourceResponseSubscriberTest
@coversDefaultClass \Drupal\rest\EventSubscriber\ResourceResponseSubscriber @group rest

Namespace

Drupal\Tests\rest\Unit\EventSubscriber

Code

public function providerTestSerialization() {
  return [
    // The default data for \Drupal\rest\ResourceResponse.
    'default' => [
      NULL,
      '',
    ],
    'empty string' => [
      '',
    ],
    'simple string' => [
      'string',
    ],
    'complex string' => [
      'Complex \\ string $%^&@ with unicode ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΣὨ',
    ],
    'empty array' => [
      [],
    ],
    'numeric array' => [
      [
        'test',
      ],
    ],
    'associative array' => [
      [
        'test' => 'foobar',
      ],
    ],
    'boolean true' => [
      TRUE,
    ],
    'boolean false' => [
      FALSE,
    ],
  ];
}