|
@@ 1884-1904 (lines=21) @@
|
| 1881 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 1882 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1883 |
|
*/ |
| 1884 |
|
public function testDeleteContent() |
| 1885 |
|
{ |
| 1886 |
|
$repository = $this->getRepository(); |
| 1887 |
|
|
| 1888 |
|
$contentService = $repository->getContentService(); |
| 1889 |
|
$locationService = $repository->getLocationService(); |
| 1890 |
|
|
| 1891 |
|
/* BEGIN: Use Case */ |
| 1892 |
|
$contentVersion2 = $this->createContentVersion2(); |
| 1893 |
|
|
| 1894 |
|
// Load the locations for this content object |
| 1895 |
|
$locations = $locationService->loadLocations($contentVersion2->contentInfo); |
| 1896 |
|
|
| 1897 |
|
// This will delete the content, all versions and the associated locations |
| 1898 |
|
$contentService->deleteContent($contentVersion2->contentInfo); |
| 1899 |
|
/* END: Use Case */ |
| 1900 |
|
|
| 1901 |
|
foreach ($locations as $location) { |
| 1902 |
|
$locationService->loadLocation($location->id); |
| 1903 |
|
} |
| 1904 |
|
} |
| 1905 |
|
|
| 1906 |
|
/** |
| 1907 |
|
* Test for the deleteContent() method. |
|
@@ 1916-1936 (lines=21) @@
|
| 1913 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 1914 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
| 1915 |
|
*/ |
| 1916 |
|
public function testDeleteContentWithEmptyBinaryField() |
| 1917 |
|
{ |
| 1918 |
|
$repository = $this->getRepository(); |
| 1919 |
|
|
| 1920 |
|
$contentService = $repository->getContentService(); |
| 1921 |
|
$locationService = $repository->getLocationService(); |
| 1922 |
|
|
| 1923 |
|
/* BEGIN: Use Case */ |
| 1924 |
|
$contentVersion = $this->createContentVersion1EmptyBinaryField(); |
| 1925 |
|
|
| 1926 |
|
// Load the locations for this content object |
| 1927 |
|
$locations = $locationService->loadLocations($contentVersion->contentInfo); |
| 1928 |
|
|
| 1929 |
|
// This will delete the content, all versions and the associated locations |
| 1930 |
|
$contentService->deleteContent($contentVersion->contentInfo); |
| 1931 |
|
/* END: Use Case */ |
| 1932 |
|
|
| 1933 |
|
foreach ($locations as $location) { |
| 1934 |
|
$locationService->loadLocation($location->id); |
| 1935 |
|
} |
| 1936 |
|
} |
| 1937 |
|
|
| 1938 |
|
/** |
| 1939 |
|
* Test for the loadContentDrafts() method. |