You are here

public function JsonEncoderTest::testSupportsEncoding in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 22
Contains \Drupal\Tests\serialization\Unit\Encoder\JsonEncoderTest.

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'));
}