encode() 공개 메소드

Encode the object to string.
public encode ( mixed $mixed ) : string
$mixed mixed
리턴 string
예제 #1
0
 /**
  * @dataProvider parsersProvider
  */
 public function testApiEncode_EncodesArrayToJson_ForDefaultDecoder(ParserInterface $parser)
 {
     $this->assertEquals($this->getString(), $parser->encode($this->getArray()));
 }
예제 #2
0
 /**
  * @dataProvider parsersProvider
  */
 public function testApiEncode_ReturnsNull(ParserInterface $parser)
 {
     $this->assertEquals(null, $parser->encode($this->getObject()));
 }
예제 #3
0
 /**
  * @override
  * @inheritDoc
  */
 public function encode()
 {
     return $this->parser->encode($this->protocol->getAll());
 }
예제 #4
0
 /**
  * @dataProvider objectParsersProvider
  */
 public function testCaseParser_EncodesThenDecodesDataProperly_ForObjectParsers(ParserInterface $parser)
 {
     $data = $this->getObject();
     $this->assertEquals($data, $parser->decode($parser->encode($data)));
 }