eZ\Publish\Core\Repository\Tests\Service\Integration\ContentBase::testCreateContentThrowsInvalidArgumentException PHP Method

testCreateContentThrowsInvalidArgumentException() public method

Test for the createContent() method.
    public function testCreateContentThrowsInvalidArgumentException()
    {
        $testContentType = $this->createTestContentType();
        /* BEGIN: Use Case */
        $contentService = $this->repository->getContentService();
        $contentCreate = $contentService->newContentCreateStruct($testContentType, 'eng-GB');
        $contentCreate->setField('test_required_empty', 'value for field definition with empty default value');
        $contentCreate->sectionId = 1;
        $contentCreate->ownerId = 14;
        $contentCreate->remoteId = 'f5c88a2209584891056f987fd965b0ba';
        $contentCreate->alwaysAvailable = true;
        // Throws an exception because remoteId "f5c88a2209584891056f987fd965b0ba" already exists
        $contentService->createContent($contentCreate);
        /* END: Use Case */
    }
ContentBase