eZ\Bundle\EzPublishRestBundle\Tests\Functional\SectionTest::testCreateSection PHP Method

testCreateSection() public method

public testCreateSection ( ) : string
return string The created section href
    public function testCreateSection()
    {
        $xml = <<<XML
<SectionInput>
  <identifier>testCreateSection</identifier>
  <name>testCreateSection</name>
</SectionInput>
XML;
        $request = $this->createHttpRequest('POST', '/api/ezp/v2/content/sections', 'SectionInput+xml', 'Section+json');
        $request->setContent($xml);
        $response = $this->sendHttpRequest($request);
        self::assertHttpResponseCodeEquals($response, 201);
        self::assertHttpResponseHasHeader($response, 'Location');
        $href = $response->getHeader('Location');
        $this->addCreatedElement($href);
        return $href;
    }