|
@@ 1945-1968 (lines=24) @@
|
| 1942 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 1943 |
|
* @dataProvider providerForTestCreateContentThrowsContentValidationExceptionTranslation |
| 1944 |
|
*/ |
| 1945 |
|
public function testCreateContentThrowsContentValidationExceptionTranslation($mainLanguageCode, $structFields) |
| 1946 |
|
{ |
| 1947 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\ContentValidationException::class); |
| 1948 |
|
$this->expectExceptionMessage('A value is set for non translatable field definition \'identifier\' with language \'eng-US\''); |
| 1949 |
|
|
| 1950 |
|
$fieldDefinitions = array( |
| 1951 |
|
new FieldDefinition( |
| 1952 |
|
array( |
| 1953 |
|
'id' => 'fieldDefinitionId1', |
| 1954 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 1955 |
|
'isTranslatable' => false, |
| 1956 |
|
'identifier' => 'identifier', |
| 1957 |
|
'isRequired' => false, |
| 1958 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 1959 |
|
) |
| 1960 |
|
), |
| 1961 |
|
); |
| 1962 |
|
|
| 1963 |
|
$this->assertForCreateContentContentValidationException( |
| 1964 |
|
$mainLanguageCode, |
| 1965 |
|
$structFields, |
| 1966 |
|
$fieldDefinitions |
| 1967 |
|
); |
| 1968 |
|
} |
| 1969 |
|
|
| 1970 |
|
/** |
| 1971 |
|
* Asserts behaviour necessary for testing ContentFieldValidationException because of required |
|
@@ 4756-4779 (lines=24) @@
|
| 4753 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::updateContent |
| 4754 |
|
* @dataProvider providerForTestUpdateContentThrowsContentValidationExceptionTranslation |
| 4755 |
|
*/ |
| 4756 |
|
public function testUpdateContentThrowsContentValidationExceptionTranslation($initialLanguageCode, $structFields) |
| 4757 |
|
{ |
| 4758 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\ContentValidationException::class); |
| 4759 |
|
$this->expectExceptionMessage('A value is set for non translatable field definition \'identifier\' with language \'eng-US\''); |
| 4760 |
|
|
| 4761 |
|
$fieldDefinitions = array( |
| 4762 |
|
new FieldDefinition( |
| 4763 |
|
array( |
| 4764 |
|
'id' => 'fieldDefinitionId1', |
| 4765 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 4766 |
|
'isTranslatable' => false, |
| 4767 |
|
'identifier' => 'identifier', |
| 4768 |
|
'isRequired' => false, |
| 4769 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 4770 |
|
) |
| 4771 |
|
), |
| 4772 |
|
); |
| 4773 |
|
|
| 4774 |
|
$this->assertForUpdateContentContentValidationException( |
| 4775 |
|
$initialLanguageCode, |
| 4776 |
|
$structFields, |
| 4777 |
|
$fieldDefinitions |
| 4778 |
|
); |
| 4779 |
|
} |
| 4780 |
|
|
| 4781 |
|
public function assertForTestUpdateContentRequiredField( |
| 4782 |
|
$initialLanguageCode, |