|
@@ 2113-2133 (lines=21) @@
|
| 2110 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2111 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2112 |
|
*/ |
| 2113 |
|
public function testDeleteContent() |
| 2114 |
|
{ |
| 2115 |
|
$repository = $this->getRepository(); |
| 2116 |
|
|
| 2117 |
|
$contentService = $repository->getContentService(); |
| 2118 |
|
$locationService = $repository->getLocationService(); |
| 2119 |
|
|
| 2120 |
|
/* BEGIN: Use Case */ |
| 2121 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 2122 |
|
|
| 2123 |
|
// Load the locations for this content object |
| 2124 |
|
$locations = $locationService->loadLocations($contentVersion2->contentInfo); |
| 2125 |
|
|
| 2126 |
|
// This will delete the content, all versions and the associated locations |
| 2127 |
|
$contentService->deleteContent($contentVersion2->contentInfo); |
| 2128 |
|
/* END: Use Case */ |
| 2129 |
|
|
| 2130 |
|
foreach ($locations as $location) { |
| 2131 |
|
$locationService->loadLocation($location->id); |
| 2132 |
|
} |
| 2133 |
|
} |
| 2134 |
|
|
| 2135 |
|
/** |
| 2136 |
|
* Test for the deleteContent() method. |
|
@@ 2145-2165 (lines=21) @@
|
| 2142 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2143 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 2144 |
|
*/ |
| 2145 |
|
public function testDeleteContentWithEmptyBinaryField() |
| 2146 |
|
{ |
| 2147 |
|
$repository = $this->getRepository(); |
| 2148 |
|
|
| 2149 |
|
$contentService = $repository->getContentService(); |
| 2150 |
|
$locationService = $repository->getLocationService(); |
| 2151 |
|
|
| 2152 |
|
/* BEGIN: Use Case */ |
| 2153 |
|
$contentVersion = $this->createContentVersion1EmptyBinaryField(); |
| 2154 |
|
|
| 2155 |
|
// Load the locations for this content object |
| 2156 |
|
$locations = $locationService->loadLocations($contentVersion->contentInfo); |
| 2157 |
|
|
| 2158 |
|
// This will delete the content, all versions and the associated locations |
| 2159 |
|
$contentService->deleteContent($contentVersion->contentInfo); |
| 2160 |
|
/* END: Use Case */ |
| 2161 |
|
|
| 2162 |
|
foreach ($locations as $location) { |
| 2163 |
|
$locationService->loadLocation($location->id); |
| 2164 |
|
} |
| 2165 |
|
} |
| 2166 |
|
|
| 2167 |
|
/** |
| 2168 |
|
* Test for the loadContentDrafts() method. |