|
@@ 2906-2921 (lines=16) @@
|
| 2903 |
|
* @see \eZ\Publish\API\Repository\ContentService::loadContentByContentInfo($contentInfo, $languages, $versionNo) |
| 2904 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter |
| 2905 |
|
*/ |
| 2906 |
|
public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter() |
| 2907 |
|
{ |
| 2908 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class); |
| 2909 |
|
|
| 2910 |
|
$repository = $this->getRepository(); |
| 2911 |
|
|
| 2912 |
|
$contentService = $repository->getContentService(); |
| 2913 |
|
|
| 2914 |
|
/* BEGIN: Use Case */ |
| 2915 |
|
$content = $this->createContentVersion1(); |
| 2916 |
|
|
| 2917 |
|
// This call will fail with a "NotFoundException", because no content |
| 2918 |
|
// with versionNo = 2 exists. |
| 2919 |
|
$contentService->loadContentByContentInfo($content->contentInfo, null, 2); |
| 2920 |
|
/* END: Use Case */ |
| 2921 |
|
} |
| 2922 |
|
|
| 2923 |
|
/** |
| 2924 |
|
* Test for the loadContent() method. |
|
@@ 5608-5618 (lines=11) @@
|
| 5605 |
|
* |
| 5606 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::deleteTranslation |
| 5607 |
|
*/ |
| 5608 |
|
public function testDeleteTranslationThrowsInvalidArgumentException() |
| 5609 |
|
{ |
| 5610 |
|
$this->expectException(\eZ\Publish\API\Repository\Exceptions\InvalidArgumentException::class); |
| 5611 |
|
$this->expectExceptionMessage('Argument \'$languageCode\' is invalid: ger-DE does not exist in the Content item'); |
| 5612 |
|
|
| 5613 |
|
$repository = $this->getRepository(); |
| 5614 |
|
$contentService = $repository->getContentService(); |
| 5615 |
|
// content created by the createContentVersion1 method has eng-US translation only. |
| 5616 |
|
$content = $this->createContentVersion1(); |
| 5617 |
|
$contentService->deleteTranslation($content->contentInfo, 'ger-DE'); |
| 5618 |
|
} |
| 5619 |
|
|
| 5620 |
|
/** |
| 5621 |
|
* Test deleting a Translation from Draft. |