eZ\Publish\Core\REST\Client\Tests\Input\Parser\ContentTest::testParse PHP Метод

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

Tests the section parser.
public testParse ( ) : eZ\Publish\API\Repository\Values\Content\Content
Результат eZ\Publish\API\Repository\Values\Content\Content
    public function testParse()
    {
        $relationParser = $this->getParser();
        $inputArray = array('_media-type' => 'application/vnd.ez.api.Version+json', '_href' => '/api/ezp/v2/content/objects/10/versions/2', 'CurrentVersion' => array('Version' => array('VersionInfo' => array(), 'Fields' => array('field' => array(0 => array('id' => 19, 'fieldDefinitionIdentifier' => 'first_name', 'languageCode' => 'eng-US', 'fieldValue' => 'Anonymous'), 1 => array('id' => 20, 'fieldDefinitionIdentifier' => 'last_name', 'languageCode' => 'eng-US', 'fieldValue' => 'User'))))));
        $versionInfoMock = new \stdClass();
        $versionInfoMock->contentInfoId = '/api/ezp/v2/content/objects/10';
        $this->getVersionInfoParserMock()->expects($this->once())->method('parse')->with($this->equalTo(array()), $this->isInstanceOf('eZ\\Publish\\Core\\REST\\Common\\Input\\ParsingDispatcher'))->will($this->returnValue($versionInfoMock));
        $this->getFieldTypeParserMock()->expects($this->exactly(2))->method('parseFieldValue')->will($this->returnValue('MockedValue'));
        $result = $relationParser->parse($inputArray, $this->getParsingDispatcherMock());
        $this->assertNotNull($result);
        return $result;
    }