function ResourceResponseSubscriberTest::providerTestSerialization

Same name in other branches
  1. 9 core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php \Drupal\Tests\rest\Unit\EventSubscriber\ResourceResponseSubscriberTest::providerTestSerialization()
  2. 8.9.x core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php \Drupal\Tests\rest\Unit\EventSubscriber\ResourceResponseSubscriberTest::providerTestSerialization()
  3. 10 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 56

Class

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

Namespace

Drupal\Tests\rest\Unit\EventSubscriber

Code

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

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