public testSetObjectStatesForContent ( $objectStateHref ) : string | ||
return | string | The created folder content href |
public function testSetObjectStatesForContent($objectStateHref)
{
$folder = $this->createFolder(__FUNCTION__, '/api/ezp/v2/content/locations/1/2');
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<ContentObjectStates>
<ObjectState href="{$objectStateHref}"/>
</ContentObjectStates>
XML;
$folderHref = $folder['_href'];
$request = $this->createHttpRequest('PATCH', "{$folderHref}/objectstates", 'ContentObjectStates+xml', 'ContentObjectStates+json');
$request->setContent($xml);
$response = $this->sendHttpRequest($request);
self::assertHttpResponseCodeEquals($response, 200);
return $folderHref;
}