|
@@ 1938-1958 (lines=21) @@
|
| 1935 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 1936 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1937 |
|
*/ |
| 1938 |
|
public function testDeleteContent() |
| 1939 |
|
{ |
| 1940 |
|
$repository = $this->getRepository(); |
| 1941 |
|
|
| 1942 |
|
$contentService = $repository->getContentService(); |
| 1943 |
|
$locationService = $repository->getLocationService(); |
| 1944 |
|
|
| 1945 |
|
/* BEGIN: Use Case */ |
| 1946 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1947 |
|
|
| 1948 |
|
// Load the locations for this content object |
| 1949 |
|
$locations = $locationService->loadLocations($contentVersion2->contentInfo); |
| 1950 |
|
|
| 1951 |
|
// This will delete the content, all versions and the associated locations |
| 1952 |
|
$contentService->deleteContent($contentVersion2->contentInfo); |
| 1953 |
|
/* END: Use Case */ |
| 1954 |
|
|
| 1955 |
|
foreach ($locations as $location) { |
| 1956 |
|
$locationService->loadLocation($location->id); |
| 1957 |
|
} |
| 1958 |
|
} |
| 1959 |
|
|
| 1960 |
|
/** |
| 1961 |
|
* Test for the deleteContent() method. |
|
@@ 1970-1990 (lines=21) @@
|
| 1967 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 1968 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1969 |
|
*/ |
| 1970 |
|
public function testDeleteContentWithEmptyBinaryField() |
| 1971 |
|
{ |
| 1972 |
|
$repository = $this->getRepository(); |
| 1973 |
|
|
| 1974 |
|
$contentService = $repository->getContentService(); |
| 1975 |
|
$locationService = $repository->getLocationService(); |
| 1976 |
|
|
| 1977 |
|
/* BEGIN: Use Case */ |
| 1978 |
|
$contentVersion = $this->createContentVersion1EmptyBinaryField(); |
| 1979 |
|
|
| 1980 |
|
// Load the locations for this content object |
| 1981 |
|
$locations = $locationService->loadLocations($contentVersion->contentInfo); |
| 1982 |
|
|
| 1983 |
|
// This will delete the content, all versions and the associated locations |
| 1984 |
|
$contentService->deleteContent($contentVersion->contentInfo); |
| 1985 |
|
/* END: Use Case */ |
| 1986 |
|
|
| 1987 |
|
foreach ($locations as $location) { |
| 1988 |
|
$locationService->loadLocation($location->id); |
| 1989 |
|
} |
| 1990 |
|
} |
| 1991 |
|
|
| 1992 |
|
/** |
| 1993 |
|
* Test for the loadContentDrafts() method. |