|
@@ 892-899 (lines=8) @@
|
| 889 |
|
* |
| 890 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 891 |
|
*/ |
| 892 |
|
public function testCreateContentThrowsInvalidArgumentExceptionMainLanguageCodeNotSet() |
| 893 |
|
{ |
| 894 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\InvalidArgumentException::class); |
| 895 |
|
$this->expectExceptionMessage('Argument \'$contentCreateStruct\' is invalid: the \'mainLanguageCode\' property must be set'); |
| 896 |
|
|
| 897 |
|
$mockedService = $this->getPartlyMockedContentService(); |
| 898 |
|
$mockedService->createContent(new ContentCreateStruct(), []); |
| 899 |
|
} |
| 900 |
|
|
| 901 |
|
/** |
| 902 |
|
* Test for the createContent() method. |
|
@@ 906-916 (lines=11) @@
|
| 903 |
|
* |
| 904 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 905 |
|
*/ |
| 906 |
|
public function testCreateContentThrowsInvalidArgumentExceptionContentTypeNotSet() |
| 907 |
|
{ |
| 908 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\InvalidArgumentException::class); |
| 909 |
|
$this->expectExceptionMessage('Argument \'$contentCreateStruct\' is invalid: the \'contentType\' property must be set'); |
| 910 |
|
|
| 911 |
|
$mockedService = $this->getPartlyMockedContentService(); |
| 912 |
|
$mockedService->createContent( |
| 913 |
|
new ContentCreateStruct(['mainLanguageCode' => 'eng-US']), |
| 914 |
|
[] |
| 915 |
|
); |
| 916 |
|
} |
| 917 |
|
|
| 918 |
|
/** |
| 919 |
|
* Test for the createContent() method. |