JsonEncoderTest.php

Same filename in other branches
  1. 8.9.x core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php
  2. 10 core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php
  3. 11.x core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php

Namespace

Drupal\Tests\serialization\Unit\Encoder

File

core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php

View source
<?php

namespace Drupal\Tests\serialization\Unit\Encoder;

use Drupal\serialization\Encoder\JsonEncoder;
use Drupal\Tests\UnitTestCase;

/**
 * @coversDefaultClass \Drupal\serialization\Encoder\JsonEncoder
 * @group serialization
 */
class JsonEncoderTest extends UnitTestCase {
    
    /**
     * Tests the supportsEncoding() method.
     */
    public function testSupportsEncoding() {
        $encoder = new JsonEncoder();
        $this->assertTrue($encoder->supportsEncoding('json'));
        $this->assertTrue($encoder->supportsEncoding('ajax'));
        $this->assertFalse($encoder->supportsEncoding('xml'));
    }

}

Classes

Title Deprecated Summary
JsonEncoderTest @coversDefaultClass \Drupal\serialization\Encoder\JsonEncoder @group serialization

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