eZ\Publish\Core\REST\Common\Tests\Output\Generator\JsonTest::testGeneratorAttribute PHP Method

testGeneratorAttribute() public method

    public function testGeneratorAttribute()
    {
        $generator = $this->getGenerator();
        $generator->startDocument('test');
        $generator->startObjectElement('element');
        $generator->startAttribute('attribute', 'value');
        $generator->endAttribute('attribute');
        $generator->endObjectElement('element');
        $this->assertSame('{"element":{"_media-type":"application\\/vnd.ez.api.element+json","_attribute":"value"}}', $generator->endDocument('test'));
    }