|
@@ 1987-2010 (lines=24) @@
|
| 1984 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 1985 |
|
* @dataProvider providerForTestCreateContentThrowsContentValidationExceptionTranslation |
| 1986 |
|
*/ |
| 1987 |
|
public function testCreateContentThrowsContentValidationExceptionTranslation($mainLanguageCode, $structFields) |
| 1988 |
|
{ |
| 1989 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\ContentValidationException::class); |
| 1990 |
|
$this->expectExceptionMessage('A value is set for non translatable field definition \'identifier\' with language \'eng-US\''); |
| 1991 |
|
|
| 1992 |
|
$fieldDefinitions = [ |
| 1993 |
|
new FieldDefinition( |
| 1994 |
|
[ |
| 1995 |
|
'id' => 'fieldDefinitionId1', |
| 1996 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 1997 |
|
'isTranslatable' => false, |
| 1998 |
|
'identifier' => 'identifier', |
| 1999 |
|
'isRequired' => false, |
| 2000 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 2001 |
|
] |
| 2002 |
|
), |
| 2003 |
|
]; |
| 2004 |
|
|
| 2005 |
|
$this->assertForCreateContentContentValidationException( |
| 2006 |
|
$mainLanguageCode, |
| 2007 |
|
$structFields, |
| 2008 |
|
$fieldDefinitions |
| 2009 |
|
); |
| 2010 |
|
} |
| 2011 |
|
|
| 2012 |
|
/** |
| 2013 |
|
* Asserts behaviour necessary for testing ContentFieldValidationException because of required |
|
@@ 4798-4821 (lines=24) @@
|
| 4795 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::updateContent |
| 4796 |
|
* @dataProvider providerForTestUpdateContentThrowsContentValidationExceptionTranslation |
| 4797 |
|
*/ |
| 4798 |
|
public function testUpdateContentThrowsContentValidationExceptionTranslation($initialLanguageCode, $structFields) |
| 4799 |
|
{ |
| 4800 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\ContentValidationException::class); |
| 4801 |
|
$this->expectExceptionMessage('A value is set for non translatable field definition \'identifier\' with language \'eng-US\''); |
| 4802 |
|
|
| 4803 |
|
$fieldDefinitions = [ |
| 4804 |
|
new FieldDefinition( |
| 4805 |
|
[ |
| 4806 |
|
'id' => 'fieldDefinitionId1', |
| 4807 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 4808 |
|
'isTranslatable' => false, |
| 4809 |
|
'identifier' => 'identifier', |
| 4810 |
|
'isRequired' => false, |
| 4811 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 4812 |
|
] |
| 4813 |
|
), |
| 4814 |
|
]; |
| 4815 |
|
|
| 4816 |
|
$this->assertForUpdateContentContentValidationException( |
| 4817 |
|
$initialLanguageCode, |
| 4818 |
|
$structFields, |
| 4819 |
|
$fieldDefinitions |
| 4820 |
|
); |
| 4821 |
|
} |
| 4822 |
|
|
| 4823 |
|
public function assertForTestUpdateContentRequiredField( |
| 4824 |
|
$initialLanguageCode, |