|
@@ 2235-2255 (lines=21) @@
|
| 2232 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2233 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2234 |
|
*/ |
| 2235 |
|
public function testDeleteContent() |
| 2236 |
|
{ |
| 2237 |
|
$repository = $this->getRepository(); |
| 2238 |
|
|
| 2239 |
|
$contentService = $repository->getContentService(); |
| 2240 |
|
$locationService = $repository->getLocationService(); |
| 2241 |
|
|
| 2242 |
|
/* BEGIN: Use Case */ |
| 2243 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 2244 |
|
|
| 2245 |
|
// Load the locations for this content object |
| 2246 |
|
$locations = $locationService->loadLocations($contentVersion2->contentInfo); |
| 2247 |
|
|
| 2248 |
|
// This will delete the content, all versions and the associated locations |
| 2249 |
|
$contentService->deleteContent($contentVersion2->contentInfo); |
| 2250 |
|
/* END: Use Case */ |
| 2251 |
|
|
| 2252 |
|
foreach ($locations as $location) { |
| 2253 |
|
$locationService->loadLocation($location->id); |
| 2254 |
|
} |
| 2255 |
|
} |
| 2256 |
|
|
| 2257 |
|
/** |
| 2258 |
|
* Test for the deleteContent() method. |
|
@@ 2267-2287 (lines=21) @@
|
| 2264 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2265 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2266 |
|
*/ |
| 2267 |
|
public function testDeleteContentWithEmptyBinaryField() |
| 2268 |
|
{ |
| 2269 |
|
$repository = $this->getRepository(); |
| 2270 |
|
|
| 2271 |
|
$contentService = $repository->getContentService(); |
| 2272 |
|
$locationService = $repository->getLocationService(); |
| 2273 |
|
|
| 2274 |
|
/* BEGIN: Use Case */ |
| 2275 |
|
$contentVersion = $this->createContentVersion1EmptyBinaryField(); |
| 2276 |
|
|
| 2277 |
|
// Load the locations for this content object |
| 2278 |
|
$locations = $locationService->loadLocations($contentVersion->contentInfo); |
| 2279 |
|
|
| 2280 |
|
// This will delete the content, all versions and the associated locations |
| 2281 |
|
$contentService->deleteContent($contentVersion->contentInfo); |
| 2282 |
|
/* END: Use Case */ |
| 2283 |
|
|
| 2284 |
|
foreach ($locations as $location) { |
| 2285 |
|
$locationService->loadLocation($location->id); |
| 2286 |
|
} |
| 2287 |
|
} |
| 2288 |
|
|
| 2289 |
|
/** |
| 2290 |
|
* Test for the loadContentDrafts() method. |