function JsonEncoderTest::testSupportsEncoding

Tests the supportsEncoding() method.

File

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

Class

JsonEncoderTest
Tests Drupal\serialization\Encoder\JsonEncoder.

Namespace

Drupal\Tests\serialization\Unit\Encoder

Code

public function testSupportsEncoding() : void {
  $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.