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