You are here

public function JsonEncoderTest::testEncodeScalar in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/serializer/Tests/Encoder/JsonEncoderTest.php \Symfony\Component\Serializer\Tests\Encoder\JsonEncoderTest::testEncodeScalar()

File

vendor/symfony/serializer/Tests/Encoder/JsonEncoderTest.php, line 26

Class

JsonEncoderTest

Namespace

Symfony\Component\Serializer\Tests\Encoder

Code

public function testEncodeScalar() {
  $obj = new \stdClass();
  $obj->foo = 'foo';
  $expected = '{"foo":"foo"}';
  $this
    ->assertEquals($expected, $this->encoder
    ->encode($obj, 'json'));
}