Code Duplication    Length = 24-24 lines in 2 locations

eZ/Publish/Core/Repository/Tests/Service/Mock/ContentTest.php 2 locations

@@ 1970-1993 (lines=24) @@
1967
     * @covers \eZ\Publish\Core\Repository\ContentService::createContent
1968
     * @dataProvider providerForTestCreateContentThrowsContentValidationExceptionTranslation
1969
     */
1970
    public function testCreateContentThrowsContentValidationExceptionTranslation($mainLanguageCode, $structFields)
1971
    {
1972
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\ContentValidationException::class);
1973
        $this->expectExceptionMessage('A value is set for non translatable field definition \'identifier\' with language \'eng-US\'');
1974
1975
        $fieldDefinitions = [
1976
            new FieldDefinition(
1977
                [
1978
                    'id' => 'fieldDefinitionId1',
1979
                    'fieldTypeIdentifier' => 'fieldTypeIdentifier',
1980
                    'isTranslatable' => false,
1981
                    'identifier' => 'identifier',
1982
                    'isRequired' => false,
1983
                    'defaultValue' => self::EMPTY_FIELD_VALUE,
1984
                ]
1985
            ),
1986
        ];
1987
1988
        $this->assertForCreateContentContentValidationException(
1989
            $mainLanguageCode,
1990
            $structFields,
1991
            $fieldDefinitions
1992
        );
1993
    }
1994
1995
    /**
1996
     * Asserts behaviour necessary for testing ContentFieldValidationException because of required
@@ 4787-4810 (lines=24) @@
4784
     * @covers \eZ\Publish\Core\Repository\ContentService::updateContent
4785
     * @dataProvider providerForTestUpdateContentThrowsContentValidationExceptionTranslation
4786
     */
4787
    public function testUpdateContentThrowsContentValidationExceptionTranslation($initialLanguageCode, $structFields)
4788
    {
4789
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\ContentValidationException::class);
4790
        $this->expectExceptionMessage('A value is set for non translatable field definition \'identifier\' with language \'eng-US\'');
4791
4792
        $fieldDefinitions = [
4793
            new FieldDefinition(
4794
                [
4795
                    'id' => 'fieldDefinitionId1',
4796
                    'fieldTypeIdentifier' => 'fieldTypeIdentifier',
4797
                    'isTranslatable' => false,
4798
                    'identifier' => 'identifier',
4799
                    'isRequired' => false,
4800
                    'defaultValue' => self::EMPTY_FIELD_VALUE,
4801
                ]
4802
            ),
4803
        ];
4804
4805
        $this->assertForUpdateContentContentValidationException(
4806
            $initialLanguageCode,
4807
            $structFields,
4808
            $fieldDefinitions
4809
        );
4810
    }
4811
4812
    public function assertForTestUpdateContentRequiredField(
4813
        $initialLanguageCode,