|
@@ 2274-2294 (lines=21) @@
|
| 2271 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2272 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2273 |
|
*/ |
| 2274 |
|
public function testDeleteContent() |
| 2275 |
|
{ |
| 2276 |
|
$repository = $this->getRepository(); |
| 2277 |
|
|
| 2278 |
|
$contentService = $repository->getContentService(); |
| 2279 |
|
$locationService = $repository->getLocationService(); |
| 2280 |
|
|
| 2281 |
|
/* BEGIN: Use Case */ |
| 2282 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 2283 |
|
|
| 2284 |
|
// Load the locations for this content object |
| 2285 |
|
$locations = $locationService->loadLocations($contentVersion2->contentInfo); |
| 2286 |
|
|
| 2287 |
|
// This will delete the content, all versions and the associated locations |
| 2288 |
|
$contentService->deleteContent($contentVersion2->contentInfo); |
| 2289 |
|
/* END: Use Case */ |
| 2290 |
|
|
| 2291 |
|
foreach ($locations as $location) { |
| 2292 |
|
$locationService->loadLocation($location->id); |
| 2293 |
|
} |
| 2294 |
|
} |
| 2295 |
|
|
| 2296 |
|
/** |
| 2297 |
|
* Test for the deleteContent() method. |
|
@@ 2306-2326 (lines=21) @@
|
| 2303 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2304 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2305 |
|
*/ |
| 2306 |
|
public function testDeleteContentWithEmptyBinaryField() |
| 2307 |
|
{ |
| 2308 |
|
$repository = $this->getRepository(); |
| 2309 |
|
|
| 2310 |
|
$contentService = $repository->getContentService(); |
| 2311 |
|
$locationService = $repository->getLocationService(); |
| 2312 |
|
|
| 2313 |
|
/* BEGIN: Use Case */ |
| 2314 |
|
$contentVersion = $this->createContentVersion1EmptyBinaryField(); |
| 2315 |
|
|
| 2316 |
|
// Load the locations for this content object |
| 2317 |
|
$locations = $locationService->loadLocations($contentVersion->contentInfo); |
| 2318 |
|
|
| 2319 |
|
// This will delete the content, all versions and the associated locations |
| 2320 |
|
$contentService->deleteContent($contentVersion->contentInfo); |
| 2321 |
|
/* END: Use Case */ |
| 2322 |
|
|
| 2323 |
|
foreach ($locations as $location) { |
| 2324 |
|
$locationService->loadLocation($location->id); |
| 2325 |
|
} |
| 2326 |
|
} |
| 2327 |
|
|
| 2328 |
|
/** |
| 2329 |
|
* Test for the loadContentDrafts() method. |