|
@@ 2012-2035 (lines=24) @@
|
| 2009 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 2010 |
|
* @dataProvider providerForTestCreateContentThrowsContentValidationExceptionTranslation |
| 2011 |
|
*/ |
| 2012 |
|
public function testCreateContentThrowsContentValidationExceptionTranslation($mainLanguageCode, $structFields) |
| 2013 |
|
{ |
| 2014 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\ContentValidationException::class); |
| 2015 |
|
$this->expectExceptionMessage('A value is set for non translatable field definition \'identifier\' with language \'eng-US\''); |
| 2016 |
|
|
| 2017 |
|
$fieldDefinitions = [ |
| 2018 |
|
new FieldDefinition( |
| 2019 |
|
[ |
| 2020 |
|
'id' => 'fieldDefinitionId1', |
| 2021 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 2022 |
|
'isTranslatable' => false, |
| 2023 |
|
'identifier' => 'identifier', |
| 2024 |
|
'isRequired' => false, |
| 2025 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 2026 |
|
] |
| 2027 |
|
), |
| 2028 |
|
]; |
| 2029 |
|
|
| 2030 |
|
$this->assertForCreateContentContentValidationException( |
| 2031 |
|
$mainLanguageCode, |
| 2032 |
|
$structFields, |
| 2033 |
|
$fieldDefinitions |
| 2034 |
|
); |
| 2035 |
|
} |
| 2036 |
|
|
| 2037 |
|
/** |
| 2038 |
|
* Asserts behaviour necessary for testing ContentFieldValidationException because of required |
|
@@ 4829-4852 (lines=24) @@
|
| 4826 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::updateContent |
| 4827 |
|
* @dataProvider providerForTestUpdateContentThrowsContentValidationExceptionTranslation |
| 4828 |
|
*/ |
| 4829 |
|
public function testUpdateContentThrowsContentValidationExceptionTranslation($initialLanguageCode, $structFields) |
| 4830 |
|
{ |
| 4831 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\ContentValidationException::class); |
| 4832 |
|
$this->expectExceptionMessage('A value is set for non translatable field definition \'identifier\' with language \'eng-US\''); |
| 4833 |
|
|
| 4834 |
|
$fieldDefinitions = [ |
| 4835 |
|
new FieldDefinition( |
| 4836 |
|
[ |
| 4837 |
|
'id' => 'fieldDefinitionId1', |
| 4838 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 4839 |
|
'isTranslatable' => false, |
| 4840 |
|
'identifier' => 'identifier', |
| 4841 |
|
'isRequired' => false, |
| 4842 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 4843 |
|
] |
| 4844 |
|
), |
| 4845 |
|
]; |
| 4846 |
|
|
| 4847 |
|
$this->assertForUpdateContentContentValidationException( |
| 4848 |
|
$initialLanguageCode, |
| 4849 |
|
$structFields, |
| 4850 |
|
$fieldDefinitions |
| 4851 |
|
); |
| 4852 |
|
} |
| 4853 |
|
|
| 4854 |
|
public function assertForTestUpdateContentRequiredField( |
| 4855 |
|
$initialLanguageCode, |