createDraft() public method

Uses a content type identifier + a hash of fields values to create and publish a draft below the root location.
public createDraft ( string $contentTypeIdentifier, array $fields ) : eZ\Publish\API\Repository\Values\Content\Content
$contentTypeIdentifier string
$fields array Hash of field def identifier => field value
return eZ\Publish\API\Repository\Values\Content\Content the created draft.
 /**
  * @Given /^I create a draft for a content type that uses a custom location controller$/
  */
 public function iCreateDraftOfContentTypeWithCustomLocationController()
 {
     $this->contentContext->createDraft('blog_post', ['title' => 'Preview draft ' . date('c'), 'body' => '<?xml version="1.0" encoding="UTF-8"?><section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"><para>This is a paragraph.</para></section>']);
 }