eZ\Publish\Core\Repository\Tests\Service\Integration\ContentTypeBase::testCreateContentTypeWithoutFieldDefinitions PHP Method

testCreateContentTypeWithoutFieldDefinitions() public method

Test for the createContentTypeGroup() method.
    public function testCreateContentTypeWithoutFieldDefinitions()
    {
        /* BEGIN: Use Case */
        $contentTypeService = $this->repository->getContentTypeService();
        // Creates published content type with remoteId "new-remoteid"
        $this->createPublishedContentType();
        $typeCreateStruct = $contentTypeService->newContentTypeCreateStruct('other-type');
        $typeCreateStruct->remoteId = 'new-unique-remoteid';
        $typeCreateStruct->creatorId = $this->repository->getCurrentUserReference()->getUserId();
        $typeCreateStruct->creationDate = new \DateTime();
        $typeCreateStruct->mainLanguageCode = 'eng-US';
        $typeCreateStruct->names = array('eng-US' => 'A name.');
        $typeCreateStruct->descriptions = array('eng-US' => 'A description.');
        // Throws an exception because content type create struct does not have any field definition create structs set
        self::assertInstanceOf('eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentTypeDraft', $contentTypeService->createContentType($typeCreateStruct, array($contentTypeService->loadContentTypeGroup(1))));
        /* END: Use Case */
    }
ContentTypeBase