|
@@ 1467-1488 (lines=22) @@
|
| 1464 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 1465 |
|
* @dataProvider providerForTestCreateContentNonRedundantFieldSet1 |
| 1466 |
|
*/ |
| 1467 |
|
public function testCreateContentNonRedundantFieldSet1($mainLanguageCode, $structFields, $spiFields) |
| 1468 |
|
{ |
| 1469 |
|
$fieldDefinitions = [ |
| 1470 |
|
new FieldDefinition( |
| 1471 |
|
[ |
| 1472 |
|
'id' => 'fieldDefinitionId', |
| 1473 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 1474 |
|
'isTranslatable' => false, |
| 1475 |
|
'identifier' => 'identifier', |
| 1476 |
|
'isRequired' => false, |
| 1477 |
|
'defaultValue' => 'defaultValue', |
| 1478 |
|
] |
| 1479 |
|
), |
| 1480 |
|
]; |
| 1481 |
|
|
| 1482 |
|
$this->assertForTestCreateContentNonRedundantFieldSet( |
| 1483 |
|
$mainLanguageCode, |
| 1484 |
|
$structFields, |
| 1485 |
|
$spiFields, |
| 1486 |
|
$fieldDefinitions |
| 1487 |
|
); |
| 1488 |
|
} |
| 1489 |
|
|
| 1490 |
|
public function providerForTestCreateContentNonRedundantFieldSet2() |
| 1491 |
|
{ |
|
@@ 2033-2053 (lines=21) @@
|
| 2030 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentValidationException |
| 2031 |
|
* @expectedExceptionMessage A value is set for non translatable field definition 'identifier' with language 'eng-US' |
| 2032 |
|
*/ |
| 2033 |
|
public function testCreateContentThrowsContentValidationExceptionTranslation($mainLanguageCode, $structFields) |
| 2034 |
|
{ |
| 2035 |
|
$fieldDefinitions = [ |
| 2036 |
|
new FieldDefinition( |
| 2037 |
|
[ |
| 2038 |
|
'id' => 'fieldDefinitionId1', |
| 2039 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 2040 |
|
'isTranslatable' => false, |
| 2041 |
|
'identifier' => 'identifier', |
| 2042 |
|
'isRequired' => false, |
| 2043 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 2044 |
|
] |
| 2045 |
|
), |
| 2046 |
|
]; |
| 2047 |
|
|
| 2048 |
|
$this->assertForCreateContentContentValidationException( |
| 2049 |
|
$mainLanguageCode, |
| 2050 |
|
$structFields, |
| 2051 |
|
$fieldDefinitions |
| 2052 |
|
); |
| 2053 |
|
} |
| 2054 |
|
|
| 2055 |
|
/** |
| 2056 |
|
* Asserts behaviour necessary for testing ContentFieldValidationException because of required |
|
@@ 4857-4877 (lines=21) @@
|
| 4854 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentValidationException |
| 4855 |
|
* @expectedExceptionMessage A value is set for non translatable field definition 'identifier' with language 'eng-US' |
| 4856 |
|
*/ |
| 4857 |
|
public function testUpdateContentThrowsContentValidationExceptionTranslation($initialLanguageCode, $structFields) |
| 4858 |
|
{ |
| 4859 |
|
$fieldDefinitions = [ |
| 4860 |
|
new FieldDefinition( |
| 4861 |
|
[ |
| 4862 |
|
'id' => 'fieldDefinitionId1', |
| 4863 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 4864 |
|
'isTranslatable' => false, |
| 4865 |
|
'identifier' => 'identifier', |
| 4866 |
|
'isRequired' => false, |
| 4867 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 4868 |
|
] |
| 4869 |
|
), |
| 4870 |
|
]; |
| 4871 |
|
|
| 4872 |
|
$this->assertForUpdateContentContentValidationException( |
| 4873 |
|
$initialLanguageCode, |
| 4874 |
|
$structFields, |
| 4875 |
|
$fieldDefinitions |
| 4876 |
|
); |
| 4877 |
|
} |
| 4878 |
|
|
| 4879 |
|
public function assertForTestUpdateContentRequiredField( |
| 4880 |
|
$initialLanguageCode, |