eZ\Bundle\EzPublishRestBundle\Tests\Functional\ContentTest::testCreateRelation PHP Метод

testCreateRelation() публичный Метод

public testCreateRelation ( $restContentVersionHref ) : string
Результат string created relation HREF (/content/objects//versions//relations/
    public function testCreateRelation($restContentVersionHref)
    {
        $content = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<RelationCreate>
  <Destination href="/api/ezp/v2/content/objects/10"/>
</RelationCreate>
XML;
        $request = $this->createHttpRequest('POST', "{$restContentVersionHref}/relations", 'RelationCreate+xml', 'Relation+json');
        $request->setContent($content);
        $response = $this->sendHttpRequest($request);
        self::assertHttpResponseCodeEquals($response, 201);
        $response = json_decode($response->getContent(), true);
        return $response['Relation']['_href'];
    }