|
@@ 2293-2313 (lines=21) @@
|
| 2290 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2291 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2292 |
|
*/ |
| 2293 |
|
public function testDeleteContent() |
| 2294 |
|
{ |
| 2295 |
|
$repository = $this->getRepository(); |
| 2296 |
|
|
| 2297 |
|
$contentService = $repository->getContentService(); |
| 2298 |
|
$locationService = $repository->getLocationService(); |
| 2299 |
|
|
| 2300 |
|
/* BEGIN: Use Case */ |
| 2301 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 2302 |
|
|
| 2303 |
|
// Load the locations for this content object |
| 2304 |
|
$locations = $locationService->loadLocations($contentVersion2->contentInfo); |
| 2305 |
|
|
| 2306 |
|
// This will delete the content, all versions and the associated locations |
| 2307 |
|
$contentService->deleteContent($contentVersion2->contentInfo); |
| 2308 |
|
/* END: Use Case */ |
| 2309 |
|
|
| 2310 |
|
foreach ($locations as $location) { |
| 2311 |
|
$locationService->loadLocation($location->id); |
| 2312 |
|
} |
| 2313 |
|
} |
| 2314 |
|
|
| 2315 |
|
/** |
| 2316 |
|
* Test for the deleteContent() method. |
|
@@ 2325-2345 (lines=21) @@
|
| 2322 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2323 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2324 |
|
*/ |
| 2325 |
|
public function testDeleteContentWithEmptyBinaryField() |
| 2326 |
|
{ |
| 2327 |
|
$repository = $this->getRepository(); |
| 2328 |
|
|
| 2329 |
|
$contentService = $repository->getContentService(); |
| 2330 |
|
$locationService = $repository->getLocationService(); |
| 2331 |
|
|
| 2332 |
|
/* BEGIN: Use Case */ |
| 2333 |
|
$contentVersion = $this->createContentVersion1EmptyBinaryField(); |
| 2334 |
|
|
| 2335 |
|
// Load the locations for this content object |
| 2336 |
|
$locations = $locationService->loadLocations($contentVersion->contentInfo); |
| 2337 |
|
|
| 2338 |
|
// This will delete the content, all versions and the associated locations |
| 2339 |
|
$contentService->deleteContent($contentVersion->contentInfo); |
| 2340 |
|
/* END: Use Case */ |
| 2341 |
|
|
| 2342 |
|
foreach ($locations as $location) { |
| 2343 |
|
$locationService->loadLocation($location->id); |
| 2344 |
|
} |
| 2345 |
|
} |
| 2346 |
|
|
| 2347 |
|
/** |
| 2348 |
|
* Test for the loadContentDrafts() method. |