| @@ 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. |
|
| @@ 1783-1801 (lines=19) @@ | ||
| 1780 | * |
|
| 1781 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 1782 | */ |
|
| 1783 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 1784 | { |
|
| 1785 | $repository = $this->getRepository(); |
|
| 1786 | $objectStateService = $repository->getObjectStateService(); |
|
| 1787 | ||
| 1788 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 1789 | ||
| 1790 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 1791 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 1792 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 1793 | // Only check the first object state which is the default one. |
|
| 1794 | $this->assertEquals( |
|
| 1795 | $objectState, |
|
| 1796 | $contentState |
|
| 1797 | ); |
|
| 1798 | break; |
|
| 1799 | } |
|
| 1800 | } |
|
| 1801 | } |
|
| 1802 | ||
| 1803 | /** |
|
| 1804 | * Test for the copySubtree() method. |
|