You are here

public function JsonTest::testEncodingLength in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Serialization/JsonTest.php \Drupal\Tests\Component\Serialization\JsonTest::testEncodingLength()

Tests encoding length.

File

core/tests/Drupal/Tests/Component/Serialization/JsonTest.php, line 75
Contains \Drupal\Tests\Component\Serialization\JsonTest.

Class

JsonTest
@coversDefaultClass \Drupal\Component\Serialization\Json @group Serialization

Namespace

Drupal\Tests\Component\Serialization

Code

public function testEncodingLength() {

  // Verify that JSON encoding produces a string with all of the characters.
  $json = Json::encode($this->string);
  $this
    ->assertTrue(strlen($json) > strlen($this->string), 'A JSON encoded string is larger than the source string.');
}