|
@@ 2092-2112 (lines=21) @@
|
| 2089 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2090 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2091 |
|
*/ |
| 2092 |
|
public function testDeleteContent() |
| 2093 |
|
{ |
| 2094 |
|
$repository = $this->getRepository(); |
| 2095 |
|
|
| 2096 |
|
$contentService = $repository->getContentService(); |
| 2097 |
|
$locationService = $repository->getLocationService(); |
| 2098 |
|
|
| 2099 |
|
/* BEGIN: Use Case */ |
| 2100 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 2101 |
|
|
| 2102 |
|
// Load the locations for this content object |
| 2103 |
|
$locations = $locationService->loadLocations($contentVersion2->contentInfo); |
| 2104 |
|
|
| 2105 |
|
// This will delete the content, all versions and the associated locations |
| 2106 |
|
$contentService->deleteContent($contentVersion2->contentInfo); |
| 2107 |
|
/* END: Use Case */ |
| 2108 |
|
|
| 2109 |
|
foreach ($locations as $location) { |
| 2110 |
|
$locationService->loadLocation($location->id); |
| 2111 |
|
} |
| 2112 |
|
} |
| 2113 |
|
|
| 2114 |
|
/** |
| 2115 |
|
* Test for the deleteContent() method. |
|
@@ 2124-2144 (lines=21) @@
|
| 2121 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2122 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2123 |
|
*/ |
| 2124 |
|
public function testDeleteContentWithEmptyBinaryField() |
| 2125 |
|
{ |
| 2126 |
|
$repository = $this->getRepository(); |
| 2127 |
|
|
| 2128 |
|
$contentService = $repository->getContentService(); |
| 2129 |
|
$locationService = $repository->getLocationService(); |
| 2130 |
|
|
| 2131 |
|
/* BEGIN: Use Case */ |
| 2132 |
|
$contentVersion = $this->createContentVersion1EmptyBinaryField(); |
| 2133 |
|
|
| 2134 |
|
// Load the locations for this content object |
| 2135 |
|
$locations = $locationService->loadLocations($contentVersion->contentInfo); |
| 2136 |
|
|
| 2137 |
|
// This will delete the content, all versions and the associated locations |
| 2138 |
|
$contentService->deleteContent($contentVersion->contentInfo); |
| 2139 |
|
/* END: Use Case */ |
| 2140 |
|
|
| 2141 |
|
foreach ($locations as $location) { |
| 2142 |
|
$locationService->loadLocation($location->id); |
| 2143 |
|
} |
| 2144 |
|
} |
| 2145 |
|
|
| 2146 |
|
/** |
| 2147 |
|
* Test for the loadContentDrafts() method. |