|
@@ 1410-1431 (lines=22) @@
|
| 1407 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 1408 |
|
* @dataProvider providerForTestCreateContentNonRedundantFieldSet1 |
| 1409 |
|
*/ |
| 1410 |
|
public function testCreateContentNonRedundantFieldSet1($mainLanguageCode, $structFields, $spiFields) |
| 1411 |
|
{ |
| 1412 |
|
$fieldDefinitions = array( |
| 1413 |
|
new FieldDefinition( |
| 1414 |
|
array( |
| 1415 |
|
'id' => 'fieldDefinitionId', |
| 1416 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 1417 |
|
'isTranslatable' => false, |
| 1418 |
|
'identifier' => 'identifier', |
| 1419 |
|
'isRequired' => false, |
| 1420 |
|
'defaultValue' => 'defaultValue', |
| 1421 |
|
) |
| 1422 |
|
), |
| 1423 |
|
); |
| 1424 |
|
|
| 1425 |
|
$this->assertForTestCreateContentNonRedundantFieldSet( |
| 1426 |
|
$mainLanguageCode, |
| 1427 |
|
$structFields, |
| 1428 |
|
$spiFields, |
| 1429 |
|
$fieldDefinitions |
| 1430 |
|
); |
| 1431 |
|
} |
| 1432 |
|
|
| 1433 |
|
public function providerForTestCreateContentNonRedundantFieldSet2() |
| 1434 |
|
{ |
|
@@ 1976-1996 (lines=21) @@
|
| 1973 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentValidationException |
| 1974 |
|
* @expectedExceptionMessage A value is set for non translatable field definition 'identifier' with language 'eng-US' |
| 1975 |
|
*/ |
| 1976 |
|
public function testCreateContentThrowsContentValidationExceptionTranslation($mainLanguageCode, $structFields) |
| 1977 |
|
{ |
| 1978 |
|
$fieldDefinitions = array( |
| 1979 |
|
new FieldDefinition( |
| 1980 |
|
array( |
| 1981 |
|
'id' => 'fieldDefinitionId1', |
| 1982 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 1983 |
|
'isTranslatable' => false, |
| 1984 |
|
'identifier' => 'identifier', |
| 1985 |
|
'isRequired' => false, |
| 1986 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 1987 |
|
) |
| 1988 |
|
), |
| 1989 |
|
); |
| 1990 |
|
|
| 1991 |
|
$this->assertForCreateContentContentValidationException( |
| 1992 |
|
$mainLanguageCode, |
| 1993 |
|
$structFields, |
| 1994 |
|
$fieldDefinitions |
| 1995 |
|
); |
| 1996 |
|
} |
| 1997 |
|
|
| 1998 |
|
/** |
| 1999 |
|
* Asserts behaviour necessary for testing ContentFieldValidationException because of required |
|
@@ 4771-4791 (lines=21) @@
|
| 4768 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentValidationException |
| 4769 |
|
* @expectedExceptionMessage A value is set for non translatable field definition 'identifier' with language 'eng-US' |
| 4770 |
|
*/ |
| 4771 |
|
public function testUpdateContentThrowsContentValidationExceptionTranslation($initialLanguageCode, $structFields) |
| 4772 |
|
{ |
| 4773 |
|
$fieldDefinitions = array( |
| 4774 |
|
new FieldDefinition( |
| 4775 |
|
array( |
| 4776 |
|
'id' => 'fieldDefinitionId1', |
| 4777 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 4778 |
|
'isTranslatable' => false, |
| 4779 |
|
'identifier' => 'identifier', |
| 4780 |
|
'isRequired' => false, |
| 4781 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 4782 |
|
) |
| 4783 |
|
), |
| 4784 |
|
); |
| 4785 |
|
|
| 4786 |
|
$this->assertForUpdateContentContentValidationException( |
| 4787 |
|
$initialLanguageCode, |
| 4788 |
|
$structFields, |
| 4789 |
|
$fieldDefinitions |
| 4790 |
|
); |
| 4791 |
|
} |
| 4792 |
|
|
| 4793 |
|
public function assertForTestUpdateContentRequiredField( |
| 4794 |
|
$initialLanguageCode, |