function JsonEncoderTest::testSupportsEncoding

Same name in other branches
  1. 8.9.x core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php \Drupal\Tests\serialization\Unit\Encoder\JsonEncoderTest::testSupportsEncoding()
  2. 10 core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php \Drupal\Tests\serialization\Unit\Encoder\JsonEncoderTest::testSupportsEncoding()
  3. 11.x core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php \Drupal\Tests\serialization\Unit\Encoder\JsonEncoderTest::testSupportsEncoding()

Tests the supportsEncoding() method.

File

core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php, line 17

Class

JsonEncoderTest
@coversDefaultClass \Drupal\serialization\Encoder\JsonEncoder @group serialization

Namespace

Drupal\Tests\serialization\Unit\Encoder

Code

public function testSupportsEncoding() {
    $encoder = new JsonEncoder();
    $this->assertTrue($encoder->supportsEncoding('json'));
    $this->assertTrue($encoder->supportsEncoding('ajax'));
    $this->assertFalse($encoder->supportsEncoding('xml'));
}

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