|
@@ 1424-1445 (lines=22) @@
|
| 1421 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 1422 |
|
* @dataProvider providerForTestCreateContentNonRedundantFieldSet1 |
| 1423 |
|
*/ |
| 1424 |
|
public function testCreateContentNonRedundantFieldSet1($mainLanguageCode, $structFields, $spiFields) |
| 1425 |
|
{ |
| 1426 |
|
$fieldDefinitions = array( |
| 1427 |
|
new FieldDefinition( |
| 1428 |
|
array( |
| 1429 |
|
'id' => 'fieldDefinitionId', |
| 1430 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 1431 |
|
'isTranslatable' => false, |
| 1432 |
|
'identifier' => 'identifier', |
| 1433 |
|
'isRequired' => false, |
| 1434 |
|
'defaultValue' => 'defaultValue', |
| 1435 |
|
) |
| 1436 |
|
), |
| 1437 |
|
); |
| 1438 |
|
|
| 1439 |
|
$this->assertForTestCreateContentNonRedundantFieldSet( |
| 1440 |
|
$mainLanguageCode, |
| 1441 |
|
$structFields, |
| 1442 |
|
$spiFields, |
| 1443 |
|
$fieldDefinitions |
| 1444 |
|
); |
| 1445 |
|
} |
| 1446 |
|
|
| 1447 |
|
public function providerForTestCreateContentNonRedundantFieldSet2() |
| 1448 |
|
{ |
|
@@ 1990-2010 (lines=21) @@
|
| 1987 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentValidationException |
| 1988 |
|
* @expectedExceptionMessage A value is set for non translatable field definition 'identifier' with language 'eng-US' |
| 1989 |
|
*/ |
| 1990 |
|
public function testCreateContentThrowsContentValidationExceptionTranslation($mainLanguageCode, $structFields) |
| 1991 |
|
{ |
| 1992 |
|
$fieldDefinitions = array( |
| 1993 |
|
new FieldDefinition( |
| 1994 |
|
array( |
| 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 |
|
@@ 4785-4805 (lines=21) @@
|
| 4782 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentValidationException |
| 4783 |
|
* @expectedExceptionMessage A value is set for non translatable field definition 'identifier' with language 'eng-US' |
| 4784 |
|
*/ |
| 4785 |
|
public function testUpdateContentThrowsContentValidationExceptionTranslation($initialLanguageCode, $structFields) |
| 4786 |
|
{ |
| 4787 |
|
$fieldDefinitions = array( |
| 4788 |
|
new FieldDefinition( |
| 4789 |
|
array( |
| 4790 |
|
'id' => 'fieldDefinitionId1', |
| 4791 |
|
'fieldTypeIdentifier' => 'fieldTypeIdentifier', |
| 4792 |
|
'isTranslatable' => false, |
| 4793 |
|
'identifier' => 'identifier', |
| 4794 |
|
'isRequired' => false, |
| 4795 |
|
'defaultValue' => self::EMPTY_FIELD_VALUE, |
| 4796 |
|
) |
| 4797 |
|
), |
| 4798 |
|
); |
| 4799 |
|
|
| 4800 |
|
$this->assertForUpdateContentContentValidationException( |
| 4801 |
|
$initialLanguageCode, |
| 4802 |
|
$structFields, |
| 4803 |
|
$fieldDefinitions |
| 4804 |
|
); |
| 4805 |
|
} |
| 4806 |
|
|
| 4807 |
|
public function assertForTestUpdateContentRequiredField( |
| 4808 |
|
$initialLanguageCode, |