|
@@ 846-853 (lines=8) @@
|
| 843 |
|
* |
| 844 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 845 |
|
*/ |
| 846 |
|
public function testCreateContentThrowsInvalidArgumentExceptionMainLanguageCodeNotSet() |
| 847 |
|
{ |
| 848 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\InvalidArgumentException::class); |
| 849 |
|
$this->expectExceptionMessage('Argument \'$contentCreateStruct\' is invalid: \'mainLanguageCode\' property must be set'); |
| 850 |
|
|
| 851 |
|
$mockedService = $this->getPartlyMockedContentService(); |
| 852 |
|
$mockedService->createContent(new ContentCreateStruct(), []); |
| 853 |
|
} |
| 854 |
|
|
| 855 |
|
/** |
| 856 |
|
* Test for the createContent() method. |
|
@@ 860-870 (lines=11) @@
|
| 857 |
|
* |
| 858 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContent |
| 859 |
|
*/ |
| 860 |
|
public function testCreateContentThrowsInvalidArgumentExceptionContentTypeNotSet() |
| 861 |
|
{ |
| 862 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\InvalidArgumentException::class); |
| 863 |
|
$this->expectExceptionMessage('Argument \'$contentCreateStruct\' is invalid: \'contentType\' property must be set'); |
| 864 |
|
|
| 865 |
|
$mockedService = $this->getPartlyMockedContentService(); |
| 866 |
|
$mockedService->createContent( |
| 867 |
|
new ContentCreateStruct(['mainLanguageCode' => 'eng-US']), |
| 868 |
|
[] |
| 869 |
|
); |
| 870 |
|
} |
| 871 |
|
|
| 872 |
|
/** |
| 873 |
|
* Test for the createContent() method. |