| @@ 5885-5903 (lines=19) @@ | ||
| 5882 | * |
|
| 5883 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 5884 | */ |
|
| 5885 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 5886 | { |
|
| 5887 | $repository = $this->getRepository(); |
|
| 5888 | $objectStateService = $repository->getObjectStateService(); |
|
| 5889 | ||
| 5890 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 5891 | ||
| 5892 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 5893 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 5894 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 5895 | // Only check the first object state which is the default one. |
|
| 5896 | $this->assertEquals( |
|
| 5897 | $objectState, |
|
| 5898 | $contentState |
|
| 5899 | ); |
|
| 5900 | break; |
|
| 5901 | } |
|
| 5902 | } |
|
| 5903 | } |
|
| 5904 | ||
| 5905 | /** |
|
| 5906 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|
| @@ 1804-1822 (lines=19) @@ | ||
| 1801 | * |
|
| 1802 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 1803 | */ |
|
| 1804 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 1805 | { |
|
| 1806 | $repository = $this->getRepository(); |
|
| 1807 | $objectStateService = $repository->getObjectStateService(); |
|
| 1808 | ||
| 1809 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 1810 | ||
| 1811 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 1812 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 1813 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 1814 | // Only check the first object state which is the default one. |
|
| 1815 | $this->assertEquals( |
|
| 1816 | $objectState, |
|
| 1817 | $contentState |
|
| 1818 | ); |
|
| 1819 | break; |
|
| 1820 | } |
|
| 1821 | } |
|
| 1822 | } |
|
| 1823 | ||
| 1824 | /** |
|
| 1825 | * Test for the copySubtree() method. |
|